Class: AmznSpApi::ReportsApiModel::ReportsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/reports_api_model/api/reports_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReportsApi

Returns a new instance of ReportsApi.



14
15
16
# File 'lib/reports_api_model/api/reports_api.rb', line 14

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



12
13
14
# File 'lib/reports_api_model/api/reports_api.rb', line 12

def api_client
  @api_client
end

Instance Method Details

#cancel_report(report_id, opts = {}) ⇒ nil

Cancels the report that you specify. Only reports with processingStatus=IN_QUEUE can be cancelled. Cancelled reports are returned in subsequent calls to the getReport and getReports operations. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_id

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

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

    the optional parameters

Returns:

  • (nil)


22
23
24
25
# File 'lib/reports_api_model/api/reports_api.rb', line 22

def cancel_report(report_id, opts = {})
  cancel_report_with_http_info(report_id, opts)
  nil
end

#cancel_report_schedule(report_schedule_id, opts = {}) ⇒ nil

Cancels the report schedule that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_schedule_id

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

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

    the optional parameters

Returns:

  • (nil)


72
73
74
75
# File 'lib/reports_api_model/api/reports_api.rb', line 72

def cancel_report_schedule(report_schedule_id, opts = {})
  cancel_report_schedule_with_http_info(report_schedule_id, opts)
  nil
end

#cancel_report_schedule_with_http_info(report_schedule_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Cancels the report schedule that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_schedule_id

    The identifier for the report schedule. 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

Raises:

  • (ArgumentError)


81
82
83
84
85
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
# File 'lib/reports_api_model/api/reports_api.rb', line 81

def cancel_report_schedule_with_http_info(report_schedule_id, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.cancel_report_schedule ...' if @api_client.config.debugging
  # verify the required parameter 'report_schedule_id' is set
  raise ArgumentError, "Missing the required parameter 'report_schedule_id' when calling ReportsApi.cancel_report_schedule" if @api_client.config.client_side_validation && report_schedule_id.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/schedules/{reportScheduleId}'.sub('{' + 'reportScheduleId' + '}', report_schedule_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)

  @api_client.config.logger.debug "API called: ReportsApi#cancel_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#cancel_report_with_http_info(report_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Cancels the report that you specify. Only reports with processingStatus&#x3D;IN_QUEUE can be cancelled. Cancelled reports are returned in subsequent calls to the getReport and getReports operations. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_id

    The identifier for the report. 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

Raises:

  • (ArgumentError)


31
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
# File 'lib/reports_api_model/api/reports_api.rb', line 31

def cancel_report_with_http_info(report_id, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.cancel_report ...' if @api_client.config.debugging
  # verify the required parameter 'report_id' is set
  raise ArgumentError, "Missing the required parameter 'report_id' when calling ReportsApi.cancel_report" if @api_client.config.client_side_validation && report_id.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/reports/{reportId}'.sub('{' + 'reportId' + '}', report_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)

  @api_client.config.logger.debug "API called: ReportsApi#cancel_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#create_report(body, opts = {}) ⇒ CreateReportResponse

Creates a report. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0167 | 15 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:



122
123
124
125
# File 'lib/reports_api_model/api/reports_api.rb', line 122

def create_report(body, opts = {})
  data, _status_code, _headers = create_report_with_http_info(body, opts)
  data
end

#create_report_schedule(body, opts = {}) ⇒ CreateReportScheduleResponse

Creates a report schedule. If a report schedule with the same report type and marketplace IDs already exists, it will be cancelled and replaced with this one. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:



174
175
176
177
# File 'lib/reports_api_model/api/reports_api.rb', line 174

def create_report_schedule(body, opts = {})
  data, _status_code, _headers = create_report_schedule_with_http_info(body, opts)
  data
end

#create_report_schedule_with_http_info(body, opts = {}) ⇒ Array<(CreateReportScheduleResponse, Integer, Hash)>

Creates a report schedule. If a report schedule with the same report type and marketplace IDs already exists, it will be cancelled and replaced with this one. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:

Raises:

  • (ArgumentError)


183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'lib/reports_api_model/api/reports_api.rb', line 183

def create_report_schedule_with_http_info(body, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.create_report_schedule ...' if @api_client.config.debugging
  # verify the required parameter 'body' is set
  raise ArgumentError, "Missing the required parameter 'body' when calling ReportsApi.create_report_schedule" if @api_client.config.client_side_validation && body.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/schedules'

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

  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)

  @api_client.config.logger.debug "API called: ReportsApi#create_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#create_report_with_http_info(body, opts = {}) ⇒ Array<(CreateReportResponse, Integer, Hash)>

Creates a report. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0167 | 15 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:

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

    CreateReportResponse data, response status code and response headers

Raises:

  • (ArgumentError)


131
132
133
134
135
136
137
138
139
140
141
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
# File 'lib/reports_api_model/api/reports_api.rb', line 131

def create_report_with_http_info(body, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.create_report ...' if @api_client.config.debugging
  # verify the required parameter 'body' is set
  raise ArgumentError, "Missing the required parameter 'body' when calling ReportsApi.create_report" if @api_client.config.client_side_validation && body.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/reports'

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

  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)

  @api_client.config.logger.debug "API called: ReportsApi#create_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#get_report(report_id, opts = {}) ⇒ Report

Returns report details (including the reportDocumentId, if available) for the report that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2 | 15 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_id

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

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

    the optional parameters

Returns:



226
227
228
229
# File 'lib/reports_api_model/api/reports_api.rb', line 226

def get_report(report_id, opts = {})
  data, _status_code, _headers = get_report_with_http_info(report_id, opts)
  data
end

#get_report_document(report_document_id, opts = {}) ⇒ ReportDocument

Returns the information required for retrieving a report document’s contents. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0167 | 15 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_document_id

    The identifier for the report document.

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

    the optional parameters

Returns:



276
277
278
279
# File 'lib/reports_api_model/api/reports_api.rb', line 276

def get_report_document(report_document_id, opts = {})
  data, _status_code, _headers = get_report_document_with_http_info(report_document_id, opts)
  data
end

#get_report_document_with_http_info(report_document_id, opts = {}) ⇒ Array<(ReportDocument, Integer, Hash)>

Returns the information required for retrieving a report document&#x27;s contents. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0167 | 15 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_document_id

    The identifier for the report document.

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

    the optional parameters

Returns:

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

    ReportDocument data, response status code and response headers

Raises:

  • (ArgumentError)


285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/reports_api_model/api/reports_api.rb', line 285

def get_report_document_with_http_info(report_document_id, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.get_report_document ...' if @api_client.config.debugging
  # verify the required parameter 'report_document_id' is set
  raise ArgumentError, "Missing the required parameter 'report_document_id' when calling ReportsApi.get_report_document" if @api_client.config.client_side_validation && report_document_id.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/documents/{reportDocumentId}'.sub('{' + 'reportDocumentId' + '}', report_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] || 'ReportDocument'

  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: ReportsApi#get_report_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#get_report_schedule(report_schedule_id, opts = {}) ⇒ ReportSchedule

Returns report schedule details for the report schedule that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_schedule_id

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

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

    the optional parameters

Returns:



326
327
328
329
# File 'lib/reports_api_model/api/reports_api.rb', line 326

def get_report_schedule(report_schedule_id, opts = {})
  data, _status_code, _headers = get_report_schedule_with_http_info(report_schedule_id, opts)
  data
end

#get_report_schedule_with_http_info(report_schedule_id, opts = {}) ⇒ Array<(ReportSchedule, Integer, Hash)>

Returns report schedule details for the report schedule that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_schedule_id

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

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

    the optional parameters

Returns:

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

    ReportSchedule data, response status code and response headers

Raises:

  • (ArgumentError)


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
365
366
367
368
369
370
# File 'lib/reports_api_model/api/reports_api.rb', line 335

def get_report_schedule_with_http_info(report_schedule_id, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.get_report_schedule ...' if @api_client.config.debugging
  # verify the required parameter 'report_schedule_id' is set
  raise ArgumentError, "Missing the required parameter 'report_schedule_id' when calling ReportsApi.get_report_schedule" if @api_client.config.client_side_validation && report_schedule_id.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/schedules/{reportScheduleId}'.sub('{' + 'reportScheduleId' + '}', report_schedule_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] || 'ReportSchedule'

  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: ReportsApi#get_report_schedule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#get_report_schedules(report_types, opts = {}) ⇒ ReportScheduleList

Returns report schedule details that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

Returns:



376
377
378
379
# File 'lib/reports_api_model/api/reports_api.rb', line 376

def get_report_schedules(report_types, opts = {})
  data, _status_code, _headers = get_report_schedules_with_http_info(report_types, opts)
  data
end

#get_report_schedules_with_http_info(report_types, opts = {}) ⇒ Array<(ReportScheduleList, Integer, Hash)>

Returns report schedule details that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

Returns:

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

    ReportScheduleList data, response status code and response headers

Raises:

  • (ArgumentError)


385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/reports_api_model/api/reports_api.rb', line 385

def get_report_schedules_with_http_info(report_types, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.get_report_schedules ...' if @api_client.config.debugging
  # verify the required parameter 'report_types' is set
  raise ArgumentError, "Missing the required parameter 'report_types' when calling ReportsApi.get_report_schedules" if @api_client.config.client_side_validation && report_types.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/schedules'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:reportTypes] = @api_client.build_collection_param(report_types, :csv)

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

  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: ReportsApi#get_report_schedules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#get_report_with_http_info(report_id, opts = {}) ⇒ Array<(Report, Integer, Hash)>

Returns report details (including the reportDocumentId, if available) for the report that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 2 | 15 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • report_id

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

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

    the optional parameters

Returns:

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

    Report data, response status code and response headers

Raises:

  • (ArgumentError)


235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/reports_api_model/api/reports_api.rb', line 235

def get_report_with_http_info(report_id, opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.get_report ...' if @api_client.config.debugging
  # verify the required parameter 'report_id' is set
  raise ArgumentError, "Missing the required parameter 'report_id' when calling ReportsApi.get_report" if @api_client.config.client_side_validation && report_id.nil?

  # resource path
  local_var_path = '/reports/2021-06-30/reports/{reportId}'.sub('{' + 'reportId' + '}', report_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] || 'Report'

  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: ReportsApi#get_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end

#get_reports(opts = {}) ⇒ GetReportsResponse

Returns report details for the reports that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :report_types (Array<String>)

    A list of report types used to filter reports. Refer to [Report Type Values](developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required.

  • :processing_statuses (Array<String>)

    A list of processing statuses used to filter reports.

  • :marketplace_ids (Array<String>)

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

  • :page_size (Integer)

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

  • :created_since (DateTime)

    The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days.

  • :created_until (DateTime)

    The latest report creation date and time for reports to include in the response, in ISO 8601 date time 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 getReports operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail.

Returns:



433
434
435
436
# File 'lib/reports_api_model/api/reports_api.rb', line 433

def get_reports(opts = {})
  data, _status_code, _headers = get_reports_with_http_info(opts)
  data
end

#get_reports_with_http_info(opts = {}) ⇒ Array<(GetReportsResponse, Integer, Hash)>

Returns report details for the reports that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.0222 | 10 | The &#x60;x-amzn-RateLimit-Limit&#x60; 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](developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :report_types (Array<String>)

    A list of report types used to filter reports. Refer to [Report Type Values](developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required.

  • :processing_statuses (Array<String>)

    A list of processing statuses used to filter reports.

  • :marketplace_ids (Array<String>)

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

  • :page_size (Integer)

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

  • :created_since (DateTime)

    The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days.

  • :created_until (DateTime)

    The latest report creation date and time for reports to include in the response, in ISO 8601 date time 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 getReports operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail.

Returns:

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

    GetReportsResponse data, response status code and response headers

Raises:

  • (ArgumentError)


448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/reports_api_model/api/reports_api.rb', line 448

def get_reports_with_http_info(opts = {})
  @api_client.config.logger.debug 'Calling API: ReportsApi.get_reports ...' if @api_client.config.debugging
  raise ArgumentError, 'invalid value for "processing_statuses", must include one of CANCELLED, DONE, FATAL, IN_PROGRESS, IN_QUEUE' if @api_client.config.client_side_validation && opts[:processing_statuses] && !opts[:processing_statuses].all? { |item| %w[CANCELLED DONE FATAL IN_PROGRESS IN_QUEUE].include?(item) }

  # resource path
  local_var_path = '/reports/2021-06-30/reports'

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

  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: ReportsApi#get_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
  [data, status_code, headers]
end