Class: AmzSpApi::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.



16
17
18
# File 'lib/finances-api-model/api/default_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/finances-api-model/api/default_api.rb', line 14

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 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. (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:



26
27
28
29
# File 'lib/finances-api-model/api/default_api.rb', line 26

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 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page.

  • :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:



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
74
75
76
77
78
# File 'lib/finances-api-model/api/default_api.rb', line 38

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

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

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#list_financial_event_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return 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 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page. (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:



86
87
88
89
# File 'lib/finances-api-model/api/default_api.rb', line 86

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 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

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. (default to 100)

  • :next_token (String)

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

Returns:



145
146
147
148
# File 'lib/finances-api-model/api/default_api.rb', line 145

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

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.

  • :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



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
193
194
195
196
197
198
# File 'lib/finances-api-model/api/default_api.rb', line 156

def list_financial_events_by_group_id_with_http_info(event_group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.list_financial_events_by_group_id ...'
  end
  # verify the required parameter 'event_group_id' is set
  if @api_client.config.client_side_validation && event_group_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_group_id' when calling DefaultApi.list_financial_events_by_group_id"
  end
  # 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'] if !opts[:'max_results_per_page'].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] || '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)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#list_financial_events_by_group_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return 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 | For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

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. (default to 100)

  • :next_token (String)

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

Returns:



205
206
207
208
# File 'lib/finances-api-model/api/default_api.rb', line 205

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

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.

  • :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



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
249
250
251
252
253
254
255
256
257
258
# File 'lib/finances-api-model/api/default_api.rb', line 216

def list_financial_events_by_order_id_with_http_info(order_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.list_financial_events_by_order_id ...'
  end
  # verify the required parameter 'order_id' is set
  if @api_client.config.client_side_validation && order_id.nil?
    fail ArgumentError, "Missing the required parameter 'order_id' when calling DefaultApi.list_financial_events_by_order_id"
  end
  # 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'] if !opts[:'max_results_per_page'].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] || '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)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#list_financial_events_by_order_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return 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 | 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):

  • :max_results_per_page (Integer)

    The maximum number of results to return per page.

  • :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



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
131
132
133
134
135
136
137
138
# File 'lib/finances-api-model/api/default_api.rb', line 98

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

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

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#list_financial_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end