Class: AmznSpApi::FinancesApiModel::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/finances_api_model/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



14
15
16
# File 'lib/finances_api_model/api/default_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/finances_api_model/api/default_api.rb', line 12

def api_client
  @api_client
end

Instance Method Details

#list_financial_event_groups(opts = {}) ⇒ ListFinancialEventGroupsResponse

Returns financial event groups for a given date range. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with 'InvalidInput'. (default to 100)

  • :financial_event_group_started_before (DateTime)

    A date used for selecting financial event groups that opened before (but not at) a specified date and time, in ISO 8601 format. The date-time must be later than FinancialEventGroupStartedAfter and no later than two minutes before the request was submitted. If FinancialEventGroupStartedAfter and FinancialEventGroupStartedBefore are more than 180 days apart, no financial event groups are returned.

  • :financial_event_group_started_after (DateTime)

    A date used for selecting financial event groups that opened after (or at) a specified date and time, in ISO 8601 format. The date-time must be no later than two minutes before the request was submitted.

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:



25
26
27
28
# File 'lib/finances_api_model/api/default_api.rb', line 25

def list_financial_event_groups(opts = {})
  data, _status_code, _headers = list_financial_event_groups_with_http_info(opts)
  data
end

#list_financial_event_groups_with_http_info(opts = {}) ⇒ Array<(ListFinancialEventGroupsResponse, Integer, Hash)>

Returns financial event groups for a given date range. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with &#x27;InvalidInput&#x27;.

  • :financial_event_group_started_before (DateTime)

    A date used for selecting financial event groups that opened before (but not at) a specified date and time, in ISO 8601 format. The date-time must be later than FinancialEventGroupStartedAfter and no later than two minutes before the request was submitted. If FinancialEventGroupStartedAfter and FinancialEventGroupStartedBefore are more than 180 days apart, no financial event groups are returned.

  • :financial_event_group_started_after (DateTime)

    A date used for selecting financial event groups that opened after (or at) a specified date and time, in ISO 8601 format. The date-time must be no later than two minutes before the request was submitted.

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:



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
73
# File 'lib/finances_api_model/api/default_api.rb', line 37

def list_financial_event_groups_with_http_info(opts = {})
  @api_client.config.logger.debug 'Calling API: DefaultApi.list_financial_event_groups ...' if @api_client.config.debugging
  # resource path
  local_var_path = '/finances/v0/financialEventGroups'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:MaxResultsPerPage] = opts[:max_results_per_page] unless opts[:max_results_per_page].nil?
  query_params[:FinancialEventGroupStartedBefore] = opts[:financial_event_group_started_before] unless opts[:financial_event_group_started_before].nil?
  query_params[:FinancialEventGroupStartedAfter] = opts[:financial_event_group_started_after] unless opts[:financial_event_group_started_after].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] || 'ListFinancialEventGroupsResponse'

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

#list_financial_events(opts = {}) ⇒ ListFinancialEventsResponse

Returns financial events for the specified data range. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with &#x27;InvalidInput&#x27;. (default to 100)

  • :posted_after (DateTime)

    A date used for selecting financial events posted after (or at) a specified time. The date-time must be no later than two minutes before the request was submitted, in ISO 8601 date time format.

  • :posted_before (DateTime)

    A date used for selecting financial events posted before (but not at) a specified time. The date-time must be later than PostedAfter and no later than two minutes before the request was submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no financial events are returned. You must specify the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes.

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:



82
83
84
85
# File 'lib/finances_api_model/api/default_api.rb', line 82

def list_financial_events(opts = {})
  data, _status_code, _headers = list_financial_events_with_http_info(opts)
  data
end

#list_financial_events_by_group_id(event_group_id, opts = {}) ⇒ ListFinancialEventsResponse

Returns all financial events for the specified financial event group. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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:

  • event_group_id

    The identifier of the financial event group to which the events belong.

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

    the optional parameters

Options Hash (opts):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with &#x27;InvalidInput&#x27;. (default to 100)

  • :posted_after (DateTime)

    A date used for selecting financial events posted after (or at) a specified time. The date-time must be more than two minutes before the time of the request, in ISO 8601 date time format.

  • :posted_before (DateTime)

    A date used for selecting financial events posted before (but not at) a specified time. The date-time must be later than &#x60;PostedAfter&#x60; and no later than two minutes before the request was submitted, in ISO 8601 date time format. If &#x60;PostedAfter&#x60; and &#x60;PostedBefore&#x60; are more than 180 days apart, no financial events are returned. You must specify the &#x60;PostedAfter&#x60; parameter if you specify the &#x60;PostedBefore&#x60; parameter. Default: Now minus two minutes.

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:



140
141
142
143
# File 'lib/finances_api_model/api/default_api.rb', line 140

def list_financial_events_by_group_id(event_group_id, opts = {})
  data, _status_code, _headers = list_financial_events_by_group_id_with_http_info(event_group_id, opts)
  data
end

#list_financial_events_by_group_id_with_http_info(event_group_id, opts = {}) ⇒ Array<(ListFinancialEventsResponse, Integer, Hash)>

Returns all financial events for the specified financial event group. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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:

  • event_group_id

    The identifier of the financial event group to which the events belong.

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

    the optional parameters

Options Hash (opts):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with &#x27;InvalidInput&#x27;.

  • :posted_after (DateTime)

    A date used for selecting financial events posted after (or at) a specified time. The date-time must be more than two minutes before the time of the request, in ISO 8601 date time format.

  • :posted_before (DateTime)

    A date used for selecting financial events posted before (but not at) a specified time. The date-time must be later than &#x60;PostedAfter&#x60; and no later than two minutes before the request was submitted, in ISO 8601 date time format. If &#x60;PostedAfter&#x60; and &#x60;PostedBefore&#x60; are more than 180 days apart, no financial events are returned. You must specify the &#x60;PostedAfter&#x60; parameter if you specify the &#x60;PostedBefore&#x60; parameter. Default: Now minus two minutes.

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:

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

    ListFinancialEventsResponse data, response status code and response headers

Raises:

  • (ArgumentError)


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
185
186
187
188
189
190
191
192
# File 'lib/finances_api_model/api/default_api.rb', line 153

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

  # resource path
  local_var_path = '/finances/v0/financialEventGroups/{eventGroupId}/financialEvents'.sub('{' + 'eventGroupId' + '}', event_group_id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:MaxResultsPerPage] = opts[:max_results_per_page] unless opts[:max_results_per_page].nil?
  query_params[:PostedAfter] = opts[:posted_after] unless opts[:posted_after].nil?
  query_params[:PostedBefore] = opts[:posted_before] unless opts[:posted_before].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] || 'ListFinancialEventsResponse'

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

#list_financial_events_by_order_id(order_id, opts = {}) ⇒ ListFinancialEventsResponse

Returns all financial events for the specified order. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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:

  • order_id

    An Amazon-defined order identifier, in 3-7-7 format.

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

    the optional parameters

Options Hash (opts):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with &#x27;InvalidInput&#x27;. (default to 100)

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:



200
201
202
203
# File 'lib/finances_api_model/api/default_api.rb', line 200

def list_financial_events_by_order_id(order_id, opts = {})
  data, _status_code, _headers = list_financial_events_by_order_id_with_http_info(order_id, opts)
  data
end

#list_financial_events_by_order_id_with_http_info(order_id, opts = {}) ⇒ Array<(ListFinancialEventsResponse, Integer, Hash)>

Returns all financial events for the specified order. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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:

  • order_id

    An Amazon-defined order identifier, in 3-7-7 format.

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

    the optional parameters

Options Hash (opts):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with &#x27;InvalidInput&#x27;.

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:

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

    ListFinancialEventsResponse data, response status code and response headers

Raises:

  • (ArgumentError)


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
239
240
241
242
243
244
245
246
247
248
# File 'lib/finances_api_model/api/default_api.rb', line 211

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

  # resource path
  local_var_path = '/finances/v0/orders/{orderId}/financialEvents'.sub('{' + 'orderId' + '}', order_id.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:MaxResultsPerPage] = opts[:max_results_per_page] unless opts[:max_results_per_page].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] || 'ListFinancialEventsResponse'

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

#list_financial_events_with_http_info(opts = {}) ⇒ Array<(ListFinancialEventsResponse, Integer, Hash)>

Returns financial events for the specified data range. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 0.5 | 30 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. If the response exceeds the maximum number of transactions or 10 MB, the API responds with &#x27;InvalidInput&#x27;.

  • :posted_after (DateTime)

    A date used for selecting financial events posted after (or at) a specified time. The date-time must be no later than two minutes before the request was submitted, in ISO 8601 date time format.

  • :posted_before (DateTime)

    A date used for selecting financial events posted before (but not at) a specified time. The date-time must be later than PostedAfter and no later than two minutes before the request was submitted, in ISO 8601 date time format. If PostedAfter and PostedBefore are more than 180 days apart, no financial events are returned. You must specify the PostedAfter parameter if you specify the PostedBefore parameter. Default: Now minus two minutes.

  • :next_token (String)

    A string token returned in the response of your previous request.

Returns:

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

    ListFinancialEventsResponse data, response status code and response headers



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
129
130
# File 'lib/finances_api_model/api/default_api.rb', line 94

def list_financial_events_with_http_info(opts = {})
  @api_client.config.logger.debug 'Calling API: DefaultApi.list_financial_events ...' if @api_client.config.debugging
  # resource path
  local_var_path = '/finances/v0/financialEvents'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:MaxResultsPerPage] = opts[:max_results_per_page] unless opts[:max_results_per_page].nil?
  query_params[:PostedAfter] = opts[:posted_after] unless opts[:posted_after].nil?
  query_params[:PostedBefore] = opts[:posted_before] unless opts[:posted_before].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] || 'ListFinancialEventsResponse'

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