Class: DropboxApi::Endpoints::Files::GetMetadata

Inherits:
Rpc
  • Object
show all
Includes:
OptionsValidator
Defined in:
lib/dropbox_api/endpoints/files/get_metadata.rb

Constant Summary collapse

Method =
:post
Path =
"/2/files/get_metadata".freeze
ResultType =
DropboxApi::Metadata::Resource
ErrorType =
DropboxApi::Errors::GetMetadataError

Instance Method Summary collapse

Methods included from OptionsValidator

#validate_options

Methods inherited from Rpc

#build_request, #initialize, #request_body

Methods inherited from Base

add_endpoint

Constructor Details

This class inherits a constructor from DropboxApi::Endpoints::Rpc

Instance Method Details

#get_metadata(path, options = {}) ⇒ Object

Returns the metadata for a file or folder.

Note: Metadata for the root folder is unsupported.

If you request the media_info attribute, note that it could be set to :pending or nil.

Parameters:

  • path (String)

    The path of a file or folder on Dropbox.

Options Hash (options):

  • include_media_info (Boolean)

    If true, media_info is set for photo and video. The default for this field is false.

  • include_has_explicit_shared_members (Boolean)

    If true, the results will include a flag for each file indicating whether or not that file has any explicit members. The default for this field is false.

  • include_deleted (Boolean)

    If true, Metadata::Deleted will be returned for deleted file or folder, otherwise DropboxApi::Errors::NotFoundError will be raised. The default for this field is false.



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/dropbox_api/endpoints/files/get_metadata.rb', line 29

add_endpoint :get_metadata do |path, options = {}|
  validate_options([
    :include_media_info,
    :include_deleted,
    :include_has_explicit_shared_members
  ], options)

  perform_request(options.merge({
    :path => path
  }))
end