class AmzSpApi::FbaInventoryApiModel::FbaInventoryApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/fba-inventory-api-model/api/fba_inventory_api.rb, line 16
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_inventory_summaries(granularity_type, granularity_id, marketplace_ids, opts = {}) click to toggle source

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 | | —- | —- | | 90 | 150 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation. @param granularity_type The granularity type for the inventory aggregation level. @param granularity_id The granularity ID for the inventory aggregation level. @param marketplace_ids The marketplace ID for the marketplace for which to return inventory summaries. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :details true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value). (default to false) @option opts [DateTime] :start_date_time A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected. @option opts [Array<String>] :seller_skus A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs. @option opts [String] :next_token String token returned in the response of your previous request. @return [GetInventorySummariesResponse]

# 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 = {}) click to toggle source

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 | | —- | —- | | 90 | 150 | For more information, see "Usage Plans and Rate Limits&quot; in the Selling Partner API documentation. @param granularity_type The granularity type for the inventory aggregation level. @param granularity_id The granularity ID for the inventory aggregation level. @param marketplace_ids The marketplace ID for the marketplace for which to return inventory summaries. @param [Hash] opts the optional parameters @option opts [BOOLEAN] :details true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value). @option opts [DateTime] :start_date_time A start date and time in ISO8601 format. If specified, all inventory summaries that have changed since then are returned. You must specify a date and time that is no earlier than 18 months prior to the date and time when you call the API. Note: Changes in inboundWorkingQuantity, inboundShippedQuantity and inboundReceivingQuantity are not detected. @option opts [Array<String>] :seller_skus A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs. @option opts [String] :next_token String token returned in the response of your previous request. @return [Array<(GetInventorySummariesResponse, Integer, Hash)>] GetInventorySummariesResponse data, response status code and response headers

# 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