Sha256: 1cc78c2bfe37140dc5d33f446999dccf3a1edb1d005f31d52e9bd07b0308f748

Contents?: true

Size: 721 Bytes

Versions: 14

Compression:

Stored size: 721 Bytes

Contents

module DropboxApi::Endpoints::Files
  class Copy < DropboxApi::Endpoints::Rpc
    Method      = :post
    Path        = "/2/files/copy".freeze
    ResultType  = DropboxApi::Metadata::Resource
    ErrorType   = DropboxApi::Errors::RelocationError

    # 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.
    #
    # @param from [String] Path in the user's Dropbox to be copied or moved.
    # @param to [String] Path in the user's Dropbox that is the destination.
    # @return The moved file.
    add_endpoint :copy do |from, to|
      perform_request({
        :from_path => from,
        :to_path => to
      })
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dropbox_api-0.1.18 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.17 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.16 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.15 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.14 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.13 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.12 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.11 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.10 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.9 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.8 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.7 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.6 lib/dropbox_api/endpoints/files/copy.rb
dropbox_api-0.1.5 lib/dropbox_api/endpoints/files/copy.rb