Class: DropboxApi::Endpoints::Sharing::ListFileMembers

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

Constant Summary collapse

Method =
:post
Path =
"/2/sharing/list_file_members".freeze
ResultType =
DropboxApi::Results::SharedFileMembers
ErrorType =
DropboxApi::Errors::SharingFileAccessError

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

#list_file_members(file_id, actions = [], options = {}) ⇒ SharedFileMembers

Use to obtain the members who have been invited to a file, both inherited and uninherited members.

Apps must have full Dropbox access to use this endpoint.

Examples:

List file members.

client.list_file_members "1231273663"

List file members, with detail of permission to make owner.

client.list_file_members "1231273663", [:make_owner]

List file members, using the path instead of file ID.

client.list_file_members "/my/file.pdf"

Parameters:

  • file_id (String)

    The ID for the shared file.

  • actions (Array) (defaults to: [])

    This is an optional list of actions. The permissions for the actions requested will be included in the result.

Options Hash (options):

  • include_inherited (Boolean)

    Whether to include members who only have access from a parent shared folder. The default for this field is true.

  • limit (Numeric)

    The maximum number of results that include members, groups and invitees to return per request. The default for this field is 100.

Returns:

  • (SharedFileMembers)

    Shared file user and group membership.

See Also:



36
37
38
39
40
41
42
43
44
# File 'lib/dropbox_api/endpoints/sharing/list_file_members.rb', line 36

add_endpoint :list_file_members do |file_id, actions = [], options = {}|
  validate_options([:limit, :include_inherited], options)
  options[:limit] ||= 100

  perform_request options.merge({
    :file => file_id,
    :actions => DropboxApi::Metadata::MemberActionList.new(actions)
  })
end