Class: AmzSpApi::FbaInventoryApiModel::FbaInventoryApi
- Inherits:
-
Object
- Object
- AmzSpApi::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.
16 17 18 |
# File 'lib/fba-inventory-api-model/api/fba_inventory_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/fba-inventory-api-model/api/fba_inventory_api.rb', line 14 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 and sellerSkus parameters: - All inventory summaries with available details are returned when the startDateTime and sellerSkus parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus parameter is ignored. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2 | 2 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
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 and sellerSkus parameters: - All inventory summaries with available details are returned when the startDateTime and sellerSkus parameters are omitted. - When startDateTime is provided, the operation returns inventory summaries that have had changes after the date and time specified. The sellerSkus parameter is ignored. - When the sellerSkus parameter is provided, the operation returns inventory summaries for only the specified sellerSkus. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2 | 2 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.
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 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/fba-inventory-api-model/api/fba_inventory_api.rb', line 44 def get_inventory_summaries_with_http_info(granularity_type, granularity_id, marketplace_ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FbaInventoryApi.get_inventory_summaries ...' end # verify the required parameter 'granularity_type' is set if @api_client.config.client_side_validation && granularity_type.nil? fail ArgumentError, "Missing the required parameter 'granularity_type' when calling FbaInventoryApi.get_inventory_summaries" end # verify enum value if @api_client.config.client_side_validation && !['Marketplace'].include?(granularity_type) fail ArgumentError, "invalid value for 'granularity_type', must be one of Marketplace" end # verify the required parameter 'granularity_id' is set if @api_client.config.client_side_validation && granularity_id.nil? fail ArgumentError, "Missing the required parameter 'granularity_id' when calling FbaInventoryApi.get_inventory_summaries" end # verify the required parameter 'marketplace_ids' is set if @api_client.config.client_side_validation && marketplace_ids.nil? fail ArgumentError, "Missing the required parameter 'marketplace_ids' when calling FbaInventoryApi.get_inventory_summaries" end # 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'] if !opts[:'details'].nil? query_params[:'startDateTime'] = opts[:'start_date_time'] if !opts[:'start_date_time'].nil? query_params[:'sellerSkus'] = @api_client.build_collection_param(opts[:'seller_skus'], :csv) if !opts[:'seller_skus'].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']) # 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: FbaInventoryApi#get_inventory_summaries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |