Class: DropboxApi::Endpoints::Sharing::CreateSharedLinkWithSettings
- Includes:
- OptionsValidator
- Defined in:
- lib/dropbox_api/endpoints/sharing/create_shared_link_with_settings.rb
Constant Summary collapse
- Method =
:post
- Path =
"/2/sharing/create_shared_link_with_settings".freeze
- ResultType =
DropboxApi::Metadata::SharedLinkMetadata
- ErrorType =
DropboxApi::Errors::CreateSharedLinkWithSettingsError
Instance Method Summary collapse
-
#create_shared_link_with_settings(path, settings = {}) ⇒ DropboxApi::Metadata::SharedLinkMetadata
Create a shared link with custom settings.
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
#create_shared_link_with_settings(path, settings = {}) ⇒ DropboxApi::Metadata::SharedLinkMetadata
Create a shared link with custom settings. If no settings are given then the default visibility is :public. (The resolved visibility, though, may depend on other aspects such as team and shared folder settings).
NOTE: The settings
parameter will only work for pro, business or
enterprise accounts. It will return no permission error otherwise.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dropbox_api/endpoints/sharing/create_shared_link_with_settings.rb', line 31 add_endpoint :create_shared_link_with_settings do |path, settings = {}| ([ :requested_visibility, :link_password, :expires ], settings) settings[:requested_visibility] ||= 'public' settings[:link_password] ||= nil settings[:expires] ||= nil perform_request({ :path => path, :settings => settings }) end |