Class: MuffinMan::Uploads::V20201101
- Inherits:
-
SpApiClient
- Object
- SpApiClient
- MuffinMan::Uploads::V20201101
- Defined in:
- lib/muffin_man/uploads/v20201101.rb
Constant Summary
Constants inherited from SpApiClient
SpApiClient::ACCESS_TOKEN_URL, SpApiClient::AWS_REGION_MAP, SpApiClient::SERVICE_NAME, SpApiClient::UNPROCESSABLE_ENTITY_STATUS_CODE
Instance Attribute Summary
Attributes inherited from SpApiClient
#access_token_cache_key, #client_id, #client_secret, #config, #credentials, #local_var_path, #pii_data_elements, #query_params, #refresh_token, #region, #request_body, #request_type, #sandbox, #scope
Instance Method Summary collapse
-
#create_upload_destination_for_resource(marketplace_id, resource, content_md5, content_type: nil) ⇒ Hash
Creates a new upload destination for a resource.
Methods inherited from SpApiClient
Constructor Details
This class inherits a constructor from MuffinMan::SpApiClient
Instance Method Details
#create_upload_destination_for_resource(marketplace_id, resource, content_md5, content_type: nil) ⇒ Hash
Creates a new upload destination for a resource.
This method generates a signed upload destination URL for a specific resource that you can use to upload files to Amazon SP-API.
35 36 37 38 39 40 41 42 |
# File 'lib/muffin_man/uploads/v20201101.rb', line 35 def create_upload_destination_for_resource(marketplace_id, resource, content_md5, content_type: nil) @local_var_path = "/uploads/2020-11-01/uploadDestinations/#{resource}" @query_params = { "marketplaceIds" => marketplace_id, "contentMD5" => content_md5 } @query_params["contentType"] = content_type if content_type @request_type = "POST" call_api end |