Class: DropboxApi::Endpoints::Files::ListFolder

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

Constant Summary collapse

Method =
:post
Path =
"/2/files/list_folder".freeze
ResultType =
DropboxApi::Results::ListFolderResult
ErrorType =
DropboxApi::Errors::ListFolderError

Instance Method Summary collapse

Methods included from OptionsValidator

#validate_options

Methods inherited from Rpc

#build_request, #initialize

Methods inherited from Base

add_endpoint

Constructor Details

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

Instance Method Details

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

Returns the contents of a folder.

Parameters:

  • path (String)

    The path to the folder you want to read.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/dropbox_api/endpoints/files/list_folder.rb', line 21

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

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