Class: AmzSpApi::FeedsApiModel::FeedsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/feeds-api-model/api/feeds_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FeedsApi

Returns a new instance of FeedsApi.



16
17
18
# File 'lib/feeds-api-model/api/feeds_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/feeds-api-model/api/feeds_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#cancel_feed(feed_id, opts = {}) ⇒ nil

Cancels the feed that you specify. Only feeds with processingStatus=IN_QUEUE can be cancelled. Cancelled feeds are returned in subsequent calls to the getFeed and getFeeds operations. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

Parameters:

  • feed_id

    The identifier for the feed. This identifier is unique only in combination with a seller ID.

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

    the optional parameters

Returns:

  • (nil)


23
24
25
26
# File 'lib/feeds-api-model/api/feeds_api.rb', line 23

def cancel_feed(feed_id, opts = {})
  cancel_feed_with_http_info(feed_id, opts)
  nil
end

#cancel_feed_with_http_info(feed_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Cancels the feed that you specify. Only feeds with processingStatus&#x3D;IN_QUEUE can be cancelled. Cancelled feeds are returned in subsequent calls to the getFeed and getFeeds operations. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | For more information, see &quot;Usage Plans and Rate Limits&quot; in the Selling Partner API documentation.

Parameters:

  • feed_id

    The identifier for the feed. This identifier is unique only in combination with a seller ID.

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

    the optional parameters

Returns:

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

    nil, 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/feeds-api-model/api/feeds_api.rb', line 32

def cancel_feed_with_http_info(feed_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeedsApi.cancel_feed ...'
  end
  # verify the required parameter 'feed_id' is set
  if @api_client.config.client_side_validation && feed_id.nil?
    fail ArgumentError, "Missing the required parameter 'feed_id' when calling FeedsApi.cancel_feed"
  end
  # resource path
  local_var_path = '/feeds/2021-06-30/feeds/{feedId}'.sub('{' + 'feedId' + '}', feed_id.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] 

  auth_names = opts[:auth_names] || []
  data, status_code, headers = @api_client.call_api(:DELETE, 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: FeedsApi#cancel_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_feed(body, opts = {}) ⇒ CreateFeedResponse

Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0083 | 15 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

Parameters:

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

    the optional parameters

Returns:



77
78
79
80
# File 'lib/feeds-api-model/api/feeds_api.rb', line 77

def create_feed(body, opts = {})
  data, _status_code, _headers = create_feed_with_http_info(body, opts)
  data
end

#create_feed_document(body, opts = {}) ⇒ CreateFeedDocumentResponse

Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a feedDocumentId value that you can pass in with a subsequent call to the createFeed operation. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0083 | 15 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

Parameters:

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

    the optional parameters

Returns:



133
134
135
136
# File 'lib/feeds-api-model/api/feeds_api.rb', line 133

def create_feed_document(body, opts = {})
  data, _status_code, _headers = create_feed_document_with_http_info(body, opts)
  data
end

#create_feed_document_with_http_info(body, opts = {}) ⇒ Array<(CreateFeedDocumentResponse, Integer, Hash)>

Creates a feed document for the feed type that you specify. This operation returns a presigned URL for uploading the feed document contents. It also returns a feedDocumentId value that you can pass in with a subsequent call to the createFeed operation. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0083 | 15 | For more information, see &quot;Usage Plans and Rate Limits&quot; in the Selling Partner API documentation.

Parameters:

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

    the optional parameters

Returns:

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

    CreateFeedDocumentResponse data, response status code and response headers



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/feeds-api-model/api/feeds_api.rb', line 142

def create_feed_document_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeedsApi.create_feed_document ...'
  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 FeedsApi.create_feed_document"
  end
  # resource path
  local_var_path = '/feeds/2021-06-30/documents'

  # 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] || 'CreateFeedDocumentResponse' 

  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: FeedsApi#create_feed_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_feed_with_http_info(body, opts = {}) ⇒ Array<(CreateFeedResponse, Integer, Hash)>

Creates a feed. Upload the contents of the feed document before calling this operation. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0083 | 15 | For more information, see &quot;Usage Plans and Rate Limits&quot; in the Selling Partner API documentation.

Parameters:

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

    the optional parameters

Returns:

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

    CreateFeedResponse data, response status code and response headers



86
87
88
89
90
91
92
93
94
95
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
# File 'lib/feeds-api-model/api/feeds_api.rb', line 86

def create_feed_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeedsApi.create_feed ...'
  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 FeedsApi.create_feed"
  end
  # resource path
  local_var_path = '/feeds/2021-06-30/feeds'

  # 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] || 'CreateFeedResponse' 

  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: FeedsApi#create_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_feed(feed_id, opts = {}) ⇒ Feed

Returns feed details (including the resultDocumentId, if available) for the feed that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2.0 | 15 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

Parameters:

  • feed_id

    The identifier for the feed. This identifier is unique only in combination with a seller ID.

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

    the optional parameters

Returns:



189
190
191
192
# File 'lib/feeds-api-model/api/feeds_api.rb', line 189

def get_feed(feed_id, opts = {})
  data, _status_code, _headers = get_feed_with_http_info(feed_id, opts)
  data
end

#get_feed_document(feed_document_id, opts = {}) ⇒ FeedDocument

Returns the information required for retrieving a feed document’s contents. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

Parameters:

  • feed_document_id

    The identifier of the feed document.

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

    the optional parameters

Returns:



243
244
245
246
# File 'lib/feeds-api-model/api/feeds_api.rb', line 243

def get_feed_document(feed_document_id, opts = {})
  data, _status_code, _headers = get_feed_document_with_http_info(feed_document_id, opts)
  data
end

#get_feed_document_with_http_info(feed_document_id, opts = {}) ⇒ Array<(FeedDocument, Integer, Hash)>

Returns the information required for retrieving a feed document&#x27;s contents. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | For more information, see &quot;Usage Plans and Rate Limits&quot; in the Selling Partner API documentation.

Parameters:

  • feed_document_id

    The identifier of the feed document.

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

    the optional parameters

Returns:

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

    FeedDocument data, response status code and response headers



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/feeds-api-model/api/feeds_api.rb', line 252

def get_feed_document_with_http_info(feed_document_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeedsApi.get_feed_document ...'
  end
  # verify the required parameter 'feed_document_id' is set
  if @api_client.config.client_side_validation && feed_document_id.nil?
    fail ArgumentError, "Missing the required parameter 'feed_document_id' when calling FeedsApi.get_feed_document"
  end
  # resource path
  local_var_path = '/feeds/2021-06-30/documents/{feedDocumentId}'.sub('{' + 'feedDocumentId' + '}', feed_document_id.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] || 'FeedDocument' 

  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: FeedsApi#get_feed_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_feed_with_http_info(feed_id, opts = {}) ⇒ Array<(Feed, Integer, Hash)>

Returns feed details (including the resultDocumentId, if available) for the feed that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2.0 | 15 | For more information, see &quot;Usage Plans and Rate Limits&quot; in the Selling Partner API documentation.

Parameters:

  • feed_id

    The identifier for the feed. This identifier is unique only in combination with a seller ID.

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

    the optional parameters

Returns:

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

    Feed data, response status code and response headers



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/feeds-api-model/api/feeds_api.rb', line 198

def get_feed_with_http_info(feed_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeedsApi.get_feed ...'
  end
  # verify the required parameter 'feed_id' is set
  if @api_client.config.client_side_validation && feed_id.nil?
    fail ArgumentError, "Missing the required parameter 'feed_id' when calling FeedsApi.get_feed"
  end
  # resource path
  local_var_path = '/feeds/2021-06-30/feeds/{feedId}'.sub('{' + 'feedId' + '}', feed_id.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] || 'Feed' 

  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: FeedsApi#get_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_feeds(opts = {}) ⇒ GetFeedsResponse

Returns feed details for the feeds that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :feed_types (Array<String>)

    A list of feed types used to filter feeds. When feedTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either feedTypes or nextToken is required.

  • :marketplace_ids (Array<String>)

    A list of marketplace identifiers used to filter feeds. The feeds returned will match at least one of the marketplaces that you specify.

  • :page_size (Integer)

    The maximum number of feeds to return in a single call. (default to 10)

  • :processing_statuses (Array<String>)

    A list of processing statuses used to filter feeds.

  • :created_since (DateTime)

    The earliest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is 90 days ago. Feeds are retained for a maximum of 90 days.

  • :created_until (DateTime)

    The latest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is now.

  • :next_token (String)

    A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getFeeds operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail.

Returns:



303
304
305
306
# File 'lib/feeds-api-model/api/feeds_api.rb', line 303

def get_feeds(opts = {})
  data, _status_code, _headers = get_feeds_with_http_info(opts)
  data
end

#get_feeds_with_http_info(opts = {}) ⇒ Array<(GetFeedsResponse, Integer, Hash)>

Returns feed details for the feeds that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | For more information, see &quot;Usage Plans and Rate Limits&quot; in the Selling Partner API documentation.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :feed_types (Array<String>)

    A list of feed types used to filter feeds. When feedTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either feedTypes or nextToken is required.

  • :marketplace_ids (Array<String>)

    A list of marketplace identifiers used to filter feeds. The feeds returned will match at least one of the marketplaces that you specify.

  • :page_size (Integer)

    The maximum number of feeds to return in a single call.

  • :processing_statuses (Array<String>)

    A list of processing statuses used to filter feeds.

  • :created_since (DateTime)

    The earliest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is 90 days ago. Feeds are retained for a maximum of 90 days.

  • :created_until (DateTime)

    The latest feed creation date and time for feeds included in the response, in ISO 8601 format. The default is now.

  • :next_token (String)

    A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getFeeds operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail.

Returns:

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

    GetFeedsResponse data, response status code and response headers



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/feeds-api-model/api/feeds_api.rb', line 318

def get_feeds_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeedsApi.get_feeds ...'
  end
  if @api_client.config.client_side_validation && opts[:'processing_statuses'] && !opts[:'processing_statuses'].all? { |item| ['CANCELLED', 'DONE', 'FATAL', 'IN_PROGRESS', 'IN_QUEUE'].include?(item) }
    fail ArgumentError, 'invalid value for "processing_statuses", must include one of CANCELLED, DONE, FATAL, IN_PROGRESS, IN_QUEUE'
  end
  # resource path
  local_var_path = '/feeds/2021-06-30/feeds'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'feedTypes'] = @api_client.build_collection_param(opts[:'feed_types'], :csv) if !opts[:'feed_types'].nil?
  query_params[:'marketplaceIds'] = @api_client.build_collection_param(opts[:'marketplace_ids'], :csv) if !opts[:'marketplace_ids'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'processingStatuses'] = @api_client.build_collection_param(opts[:'processing_statuses'], :csv) if !opts[:'processing_statuses'].nil?
  query_params[:'createdSince'] = opts[:'created_since'] if !opts[:'created_since'].nil?
  query_params[:'createdUntil'] = opts[:'created_until'] if !opts[:'created_until'].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] || 'GetFeedsResponse' 

  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: FeedsApi#get_feeds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end