Class: AmzSpApi::VendorDirectFulfillmentShippingApiModel::VendorShippingLabelsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ VendorShippingLabelsApi

Returns a new instance of VendorShippingLabelsApi.



16
17
18
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#get_shipping_label(purchase_order_number, opts = {}) ⇒ ShippingLabel

Returns a shipping label for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • purchase_order_number

    The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



23
24
25
26
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 23

def get_shipping_label(purchase_order_number, opts = {})
  data, _status_code, _headers = get_shipping_label_with_http_info(purchase_order_number, opts)
  data
end

#get_shipping_label_with_http_info(purchase_order_number, opts = {}) ⇒ Array<(ShippingLabel, Integer, Hash)>

Returns a shipping label for the purchaseOrderNumber that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • purchase_order_number

    The purchase order number for which you want to return the shipping label. It should be the same purchaseOrderNumber as received in the order.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ShippingLabel, Integer, Hash)>)

    ShippingLabel data, response status code and response headers



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 32

def get_shipping_label_with_http_info(purchase_order_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VendorShippingLabelsApi.get_shipping_label ...'
  end
  # verify the required parameter 'purchase_order_number' is set
  if @api_client.config.client_side_validation && purchase_order_number.nil?
    fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling VendorShippingLabelsApi.get_shipping_label"
  end
  # resource path
  local_var_path = '/vendor/directFulfillment/shipping/2021-12-28/shippingLabels/{purchaseOrderNumber}'.sub('{' + 'purchaseOrderNumber' + '}', purchase_order_number.to_s)

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'ShippingLabel' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VendorShippingLabelsApi#get_shipping_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_shipping_labels(created_after, created_before, opts = {}) ⇒ ShippingLabelList

Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • created_after

    Shipping labels that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.

  • created_before

    Shipping labels that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ship_from_party_id (String)

    The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.

  • :limit (Integer)

    The limit to the number of records returned.

  • :sort_order (String)

    Sort ASC or DESC by order creation date. (default to ASC)

  • :next_token (String)

    Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call.

Returns:



82
83
84
85
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 82

def get_shipping_labels(created_after, created_before, opts = {})
  data, _status_code, _headers = get_shipping_labels_with_http_info(created_after, created_before, opts)
  data
end

#get_shipping_labels_with_http_info(created_after, created_before, opts = {}) ⇒ Array<(ShippingLabelList, Integer, Hash)>

Returns a list of shipping labels created during the time frame that you specify. You define that time frame using the createdAfter and createdBefore parameters. You must use both of these parameters. The date range to search must not be more than 7 days. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • created_after

    Shipping labels that became available after this date and time will be included in the result. Must be in ISO-8601 date/time format.

  • created_before

    Shipping labels that became available before this date and time will be included in the result. Must be in ISO-8601 date/time format.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :ship_from_party_id (String)

    The vendor warehouseId for order fulfillment. If not specified, the result will contain orders for all warehouses.

  • :limit (Integer)

    The limit to the number of records returned.

  • :sort_order (String)

    Sort ASC or DESC by order creation date.

  • :next_token (String)

    Used for pagination when there are more ship labels than the specified result size limit. The token value is returned in the previous API call.

Returns:

  • (Array<(ShippingLabelList, Integer, Hash)>)

    ShippingLabelList data, response status code and response headers



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 96

def get_shipping_labels_with_http_info(created_after, created_before, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VendorShippingLabelsApi.get_shipping_labels ...'
  end
  # verify the required parameter 'created_after' is set
  if @api_client.config.client_side_validation && created_after.nil?
    fail ArgumentError, "Missing the required parameter 'created_after' when calling VendorShippingLabelsApi.get_shipping_labels"
  end
  # verify the required parameter 'created_before' is set
  if @api_client.config.client_side_validation && created_before.nil?
    fail ArgumentError, "Missing the required parameter 'created_before' when calling VendorShippingLabelsApi.get_shipping_labels"
  end
  if @api_client.config.client_side_validation && opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order'])
    fail ArgumentError, 'invalid value for "sort_order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = '/vendor/directFulfillment/shipping/2021-12-28/shippingLabels'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'createdAfter'] = created_after
  query_params[:'createdBefore'] = created_before
  query_params[:'shipFromPartyId'] = opts[:'ship_from_party_id'] if !opts[:'ship_from_party_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'pagination', 'shippingLabels'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'ShippingLabelList' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VendorShippingLabelsApi#get_shipping_labels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#submit_shipping_label_request(body, opts = {}) ⇒ TransactionReference

Creates a shipping label for a purchase order and returns a transactionId for reference. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The ‘x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



154
155
156
157
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 154

def submit_shipping_label_request(body, opts = {})
  data, _status_code, _headers = submit_shipping_label_request_with_http_info(body, opts)
  data
end

#submit_shipping_label_request_with_http_info(body, opts = {}) ⇒ Array<(TransactionReference, Integer, Hash)>

Creates a shipping label for a purchase order and returns a transactionId for reference. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 10 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values then those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(TransactionReference, Integer, Hash)>)

    TransactionReference data, response status code and response headers



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/vendor-direct-fulfillment-shipping-api-model/api/vendor_shipping_labels_api.rb', line 163

def submit_shipping_label_request_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: VendorShippingLabelsApi.submit_shipping_label_request ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling VendorShippingLabelsApi.submit_shipping_label_request"
  end
  # resource path
  local_var_path = '/vendor/directFulfillment/shipping/2021-12-28/shippingLabels'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  return_type = opts[:return_type] || 'TransactionReference' 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: VendorShippingLabelsApi#submit_shipping_label_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end