Class: AmznSpApi::FbaInventoryApiModel::FbaInventoryApi
- Inherits:
-
Object
- Object
- AmznSpApi::FbaInventoryApiModel::FbaInventoryApi
- Defined in:
- lib/fba_inventory_api_model/api/fba_inventory_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, opts = {}) ⇒ GetInventorySummariesResponse
Returns a list of inventory summaries.
-
#get_inventory_summaries_with_http_info(granularity_type, granularity_id, marketplace_ids, opts = {}) ⇒ Array<(GetInventorySummariesResponse, Integer, Hash)>
Returns a list of inventory summaries.
-
#initialize(api_client = ApiClient.default) ⇒ FbaInventoryApi
constructor
A new instance of FbaInventoryApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ FbaInventoryApi
Returns a new instance of FbaInventoryApi.
14 15 16 |
# File 'lib/fba_inventory_api_model/api/fba_inventory_api.rb', line 14 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
12 13 14 |
# File 'lib/fba_inventory_api_model/api/fba_inventory_api.rb', line 12 def api_client @api_client end |
Instance Method Details
#get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, opts = {}) ⇒ GetInventorySummariesResponse
Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the ‘startDateTime`, `sellerSkus` and `sellerSku` parameters: - All inventory summaries with available details are returned when the `startDateTime`, `sellerSkus` and `sellerSku` parameters are omitted. - When `startDateTime` is provided, the operation returns inventory summaries that have had changes after the date and time specified. The `sellerSkus` and `sellerSku` parameters are ignored. Important: To avoid errors, use both `startDateTime` and `nextToken` to get the next page of inventory summaries that have changed after the date and time specified. - When the `sellerSkus` parameter is provided, the operation returns inventory summaries for only the specified `sellerSkus`. The `sellerSku` parameter is ignored. - When the `sellerSku` parameter is provided, the operation returns inventory summaries for only the specified `sellerSku`. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2 | 2 | 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 than 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).
29 30 31 32 |
# File 'lib/fba_inventory_api_model/api/fba_inventory_api.rb', line 29 def get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, opts = {}) data, _status_code, _headers = get_inventory_summaries_with_http_info(granularity_type, granularity_id, marketplace_ids, opts) data end |
#get_inventory_summaries_with_http_info(granularity_type, granularity_id, marketplace_ids, opts = {}) ⇒ Array<(GetInventorySummariesResponse, Integer, Hash)>
Returns a list of inventory summaries. The summaries returned depend on the presence or absence of the `startDateTime`, `sellerSkus` and `sellerSku` parameters: - All inventory summaries with available details are returned when the `startDateTime`, `sellerSkus` and `sellerSku` parameters are omitted. - When `startDateTime` is provided, the operation returns inventory summaries that have had changes after the date and time specified. The `sellerSkus` and `sellerSku` parameters are ignored. Important: To avoid errors, use both `startDateTime` and `nextToken` to get the next page of inventory summaries that have changed after the date and time specified. - When the `sellerSkus` parameter is provided, the operation returns inventory summaries for only the specified `sellerSkus`. The `sellerSku` parameter is ignored. - When the `sellerSku` parameter is provided, the operation returns inventory summaries for only the specified `sellerSku`. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2 | 2 | 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 than 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).
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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/fba_inventory_api_model/api/fba_inventory_api.rb', line 45 def get_inventory_summaries_with_http_info(granularity_type, granularity_id, marketplace_ids, opts = {}) @api_client.config.logger.debug 'Calling API: FbaInventoryApi.get_inventory_summaries ...' if @api_client.config.debugging # verify the required parameter 'granularity_type' is set raise ArgumentError, "Missing the required parameter 'granularity_type' when calling FbaInventoryApi.get_inventory_summaries" if @api_client.config.client_side_validation && granularity_type.nil? # verify enum value raise ArgumentError, "invalid value for 'granularity_type', must be one of Marketplace" if @api_client.config.client_side_validation && !['Marketplace'].include?(granularity_type) # verify the required parameter 'granularity_id' is set raise ArgumentError, "Missing the required parameter 'granularity_id' when calling FbaInventoryApi.get_inventory_summaries" if @api_client.config.client_side_validation && granularity_id.nil? # verify the required parameter 'marketplace_ids' is set raise ArgumentError, "Missing the required parameter 'marketplace_ids' when calling FbaInventoryApi.get_inventory_summaries" if @api_client.config.client_side_validation && marketplace_ids.nil? # resource path local_var_path = '/fba/inventory/v1/summaries' # query parameters query_params = opts[:query_params] || {} query_params[:granularityType] = granularity_type query_params[:granularityId] = granularity_id query_params[:marketplaceIds] = @api_client.build_collection_param(marketplace_ids, :csv) query_params[:details] = opts[:details] unless opts[:details].nil? query_params[:startDateTime] = opts[:start_date_time] unless opts[:start_date_time].nil? query_params[:sellerSkus] = @api_client.build_collection_param(opts[:seller_skus], :csv) unless opts[:seller_skus].nil? query_params[:sellerSku] = opts[:seller_sku] unless opts[:seller_sku].nil? query_params[:nextToken] = opts[:next_token] unless 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'GetInventorySummariesResponse' 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) @api_client.config.logger.debug "API called: FbaInventoryApi#get_inventory_summaries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging [data, status_code, headers] end |