Class: Peddler::API::Uploads20201101
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::API::Uploads20201101
- Defined in:
- lib/peddler/api/uploads_2020_11_01.rb
Overview
Selling Partner API for Uploads
The Uploads API lets you upload files that you can programmatically access using other Selling Partner APIs, such as the A+ Content API and the Messaging API.
Instance Attribute Summary
Attributes inherited from Peddler::API
Instance Method Summary collapse
-
#create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil, rate_limit: 10.0) ⇒ Hash
Creates an upload destination, returning the information required to upload a file to the destination and to programmatically access the file.
Methods inherited from Peddler::API
#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil, rate_limit: 10.0) ⇒ Hash
Creates an upload destination, returning the information required to upload a file to the destination and to programmatically access the file.
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/peddler/api/uploads_2020_11_01.rb', line 35 def create_upload_destination_for_resource(marketplace_ids, content_md5, resource, content_type: nil, rate_limit: 10.0) cannot_sandbox! path = "/uploads/2020-11-01/uploadDestinations/#{resource}" params = { "marketplaceIds" => marketplace_ids, "contentMD5" => content_md5, "contentType" => content_type, }.compact meter(rate_limit).post(path, params:) end |