Class: DropboxApi::Endpoints::Sharing::ShareFolder
- Includes:
- OptionsValidator
- Defined in:
- lib/dropbox_api/endpoints/sharing/share_folder.rb
Constant Summary collapse
- Method =
:post
- Path =
"/2/sharing/share_folder".freeze
- ResultType =
DropboxApi::Results::ShareFolderLaunch
- ErrorType =
DropboxApi::Errors::ShareFolderError
Instance Method Summary collapse
-
#share_folder(path, options = {}) ⇒ DropboxApi::Results::ShareFolderLaunch
Share a folder with collaborators.
Methods included from OptionsValidator
Methods inherited from Rpc
#build_request, #initialize, #request_body
Methods inherited from Base
Constructor Details
This class inherits a constructor from DropboxApi::Endpoints::Rpc
Instance Method Details
#share_folder(path, options = {}) ⇒ DropboxApi::Results::ShareFolderLaunch
Share a folder with collaborators.
Most sharing will be completed synchronously. Large folders will be
completed asynchronously. To make testing the async case repeatable, set
force_async
.
If a ShareFolderLaunch.async_job_id is returned, you'll need to call check_share_job_status until the action completes to get the metadata for the folder.
Apps must have full Dropbox access to use this endpoint.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/dropbox_api/endpoints/sharing/share_folder.rb', line 36 add_endpoint :share_folder do |path, = {}| ([ :member_policy, :acl_update_policy, :shared_link_policy, :force_async ], ) [:member_policy] ||= :anyone [:acl_update_policy] ||= :owner [:shared_link_policy] ||= :anyone [:force_async] ||= false begin perform_request .merge({ :path => path }) rescue DropboxApi::Errors::AlreadySharedError => error error.shared_folder end end |