Class: AmzSpApi::FbaInventoryApiModel::FbaInventoryApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fba-inventory-api-model/api/fba_inventory_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_clientObject

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.

Parameters:

  • granularity_type

    The granularity type for the inventory aggregation level.

  • granularity_id

    The granularity ID for the inventory aggregation level.

  • marketplace_ids

    The marketplace ID for the marketplace for which to return inventory summaries.

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

    the optional parameters

Options Hash (opts):

  • :details (BOOLEAN)

    true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value). (default to false)

  • :start_date_time (DateTime)

    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.

  • :seller_skus (Array<String>)

    A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.

  • :next_token (String)

    String token returned in the response of your previous request.

Returns:



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 &quot;Usage Plans and Rate Limits&quot; in the Selling Partner API documentation.

Parameters:

  • granularity_type

    The granularity type for the inventory aggregation level.

  • granularity_id

    The granularity ID for the inventory aggregation level.

  • marketplace_ids

    The marketplace ID for the marketplace for which to return inventory summaries.

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

    the optional parameters

Options Hash (opts):

  • :details (BOOLEAN)

    true to return inventory summaries with additional summarized inventory details and quantities. Otherwise, returns inventory summaries only (default value).

  • :start_date_time (DateTime)

    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.

  • :seller_skus (Array<String>)

    A list of seller SKUs for which to return inventory summaries. You may specify up to 50 SKUs.

  • :next_token (String)

    String token returned in the response of your previous request.

Returns:



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