def to_hash
      Hash[self.class.fields.keys.map do |field_name|
        [field_name.to_s, serialized_field(field_name)]
      end.select { |k, v| !v.nil? }]
    end
def to_hash
      Hash[self.class.fields.keys.map do |field_name|
        [field_name.to_s, serialized_field(field_name)]
      end.select { |k, v| !v.nil? }]
    end
Takes in a hash containing all the attributes required to initialize the
 object.

 Each hash entry should have a key which identifies a field and its value,
 so a valid call would be something like this:

     DropboxApi::Metadata::File.new({
       "name" => "a.jpg",
       "path_lower" => "/a.jpg",
       "path_display" => "/a.jpg",
       "id" => "id:evvfE6q6cK0AAAAAAAAB2w",
       "client_modified" => "2016-10-19T17:17:34Z",
       "server_modified" => "2016-10-19T17:17:34Z",
       "rev" => "28924061bdd",
       "size" => 396317
     })

 @raise [ArgumentError] If a required attribute is missing.
 @param metadata [Hash]