Class: DropboxApi::Endpoints::Files::Copy

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

Constant Summary collapse

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

Instance Method Summary collapse

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

#copy(from, to) ⇒ Object

Copy a file or folder to a different location in the user's Dropbox. If the source path is a folder all its contents will be copied.

Parameters:

  • from (String)

    Path in the user's Dropbox to be copied or moved.

  • to (String)

    Path in the user's Dropbox that is the destination.

Returns:

  • The moved file.



14
15
16
17
18
19
# File 'lib/dropbox_api/endpoints/files/copy.rb', line 14

add_endpoint :copy do |from, to|
  perform_request({
    :from_path => from,
    :to_path => to
  })
end