Class: AmznSpApi::NotificationsApiModel::NotificationsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/notifications_api_model/api/notifications_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ NotificationsApi

Returns a new instance of NotificationsApi.



14
15
16
# File 'lib/notifications_api_model/api/notifications_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/notifications_api_model/api/notifications_api.rb', line 12

def api_client
  @api_client
end

Instance Method Details

#create_destination(body, opts = {}) ⇒ CreateDestinationResponse

Creates a destination resource to receive notifications. The createDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:



22
23
24
25
# File 'lib/notifications_api_model/api/notifications_api.rb', line 22

def create_destination(body, opts = {})
  data, _status_code, _headers = create_destination_with_http_info(body, opts)
  data
end

#create_destination_with_http_info(body, opts = {}) ⇒ Array<(CreateDestinationResponse, Integer, Hash)>

Creates a destination resource to receive notifications. The createDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:

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

    CreateDestinationResponse data, 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
67
68
# File 'lib/notifications_api_model/api/notifications_api.rb', line 31

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

  # resource path
  local_var_path = '/notifications/v1/destinations'

  # 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', 'Successful Response'])
  # 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] || 'CreateDestinationResponse'

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

#create_subscription(body, notification_type, opts = {}) ⇒ CreateSubscriptionResponse

Creates a subscription for the specified notification type to be delivered to the specified destination. Before you can subscribe, you must first create the destination by calling the createDestination operation. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • body
  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:



75
76
77
78
# File 'lib/notifications_api_model/api/notifications_api.rb', line 75

def create_subscription(body, notification_type, opts = {})
  data, _status_code, _headers = create_subscription_with_http_info(body, notification_type, opts)
  data
end

#create_subscription_with_http_info(body, notification_type, opts = {}) ⇒ Array<(CreateSubscriptionResponse, Integer, Hash)>

Creates a subscription for the specified notification type to be delivered to the specified destination. Before you can subscribe, you must first create the destination by calling the createDestination operation. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • body
  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:

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

    CreateSubscriptionResponse data, response status code and response headers

Raises:

  • (ArgumentError)


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
117
118
119
120
121
122
123
124
# File 'lib/notifications_api_model/api/notifications_api.rb', line 85

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

  # resource path
  local_var_path = '/notifications/v1/subscriptions/{notificationType}'.sub('{' + 'notificationType' + '}', notification_type.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', 'Successful Response'])
  # 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] || 'CreateSubscriptionResponse'

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

#delete_destination(destination_id, opts = {}) ⇒ DeleteDestinationResponse

Deletes the destination that you specify. The deleteDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • destination_id

    The identifier for the destination that you want to delete.

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

    the optional parameters

Returns:



130
131
132
133
# File 'lib/notifications_api_model/api/notifications_api.rb', line 130

def delete_destination(destination_id, opts = {})
  data, _status_code, _headers = delete_destination_with_http_info(destination_id, opts)
  data
end

#delete_destination_with_http_info(destination_id, opts = {}) ⇒ Array<(DeleteDestinationResponse, Integer, Hash)>

Deletes the destination that you specify. The deleteDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • destination_id

    The identifier for the destination that you want to delete.

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

    the optional parameters

Returns:

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

    DeleteDestinationResponse data, response status code and response headers

Raises:

  • (ArgumentError)


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
169
170
171
172
173
174
# File 'lib/notifications_api_model/api/notifications_api.rb', line 139

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

  # resource path
  local_var_path = '/notifications/v1/destinations/{destinationId}'.sub('{' + 'destinationId' + '}', destination_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', 'Successful Response'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body]

  return_type = opts[:return_type] || 'DeleteDestinationResponse'

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

#delete_subscription_by_id(subscription_id, notification_type, opts = {}) ⇒ DeleteSubscriptionByIdResponse

Deletes the subscription indicated by the subscription identifier and notification type that you specify. The subscription identifier can be for any subscription associated with your application. After you successfully call this operation, notifications will stop being sent for the associated subscription. The deleteSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • subscription_id

    The identifier for the subscription that you want to delete.

  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:



181
182
183
184
# File 'lib/notifications_api_model/api/notifications_api.rb', line 181

def delete_subscription_by_id(subscription_id, notification_type, opts = {})
  data, _status_code, _headers = delete_subscription_by_id_with_http_info(subscription_id, notification_type, opts)
  data
end

#delete_subscription_by_id_with_http_info(subscription_id, notification_type, opts = {}) ⇒ Array<(DeleteSubscriptionByIdResponse, Integer, Hash)>

Deletes the subscription indicated by the subscription identifier and notification type that you specify. The subscription identifier can be for any subscription associated with your application. After you successfully call this operation, notifications will stop being sent for the associated subscription. The deleteSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • subscription_id

    The identifier for the subscription that you want to delete.

  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:

Raises:

  • (ArgumentError)


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
221
222
223
224
225
226
227
228
# File 'lib/notifications_api_model/api/notifications_api.rb', line 191

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

  # resource path
  local_var_path = '/notifications/v1/subscriptions/{notificationType}/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'notificationType' + '}', notification_type.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', 'Successful Operation Response'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body]

  return_type = opts[:return_type] || 'DeleteSubscriptionByIdResponse'

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

#get_destination(destination_id, opts = {}) ⇒ GetDestinationResponse

Returns information about the destination that you specify. The getDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • destination_id

    The identifier generated when you created the destination.

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

    the optional parameters

Returns:



234
235
236
237
# File 'lib/notifications_api_model/api/notifications_api.rb', line 234

def get_destination(destination_id, opts = {})
  data, _status_code, _headers = get_destination_with_http_info(destination_id, opts)
  data
end

#get_destination_with_http_info(destination_id, opts = {}) ⇒ Array<(GetDestinationResponse, Integer, Hash)>

Returns information about the destination that you specify. The getDestination API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • destination_id

    The identifier generated when you created the destination.

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

    the optional parameters

Returns:

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

    GetDestinationResponse data, response status code and response headers

Raises:

  • (ArgumentError)


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
271
272
273
274
275
276
277
278
# File 'lib/notifications_api_model/api/notifications_api.rb', line 243

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

  # resource path
  local_var_path = '/notifications/v1/destinations/{destinationId}'.sub('{' + 'destinationId' + '}', destination_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', 'Successful Response'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body]

  return_type = opts[:return_type] || 'GetDestinationResponse'

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

#get_destinations(opts = {}) ⇒ GetDestinationsResponse

Returns information about all destinations. The getDestinations API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:



283
284
285
286
# File 'lib/notifications_api_model/api/notifications_api.rb', line 283

def get_destinations(opts = {})
  data, _status_code, _headers = get_destinations_with_http_info(opts)
  data
end

#get_destinations_with_http_info(opts = {}) ⇒ Array<(GetDestinationsResponse, Integer, Hash)>

Returns information about all destinations. The getDestinations API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

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

    the optional parameters

Returns:

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

    GetDestinationsResponse data, response status code and response headers



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
321
322
323
# File 'lib/notifications_api_model/api/notifications_api.rb', line 291

def get_destinations_with_http_info(opts = {})
  @api_client.config.logger.debug 'Calling API: NotificationsApi.get_destinations ...' if @api_client.config.debugging
  # resource path
  local_var_path = '/notifications/v1/destinations'

  # 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', 'Successful Response'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body]

  return_type = opts[:return_type] || 'GetDestinationsResponse'

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

#get_subscription(notification_type, opts = {}) ⇒ GetSubscriptionResponse

Returns information about subscriptions of the specified notification type. You can use this API to get subscription information when you do not have a subscription identifier. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:



329
330
331
332
# File 'lib/notifications_api_model/api/notifications_api.rb', line 329

def get_subscription(notification_type, opts = {})
  data, _status_code, _headers = get_subscription_with_http_info(notification_type, opts)
  data
end

#get_subscription_by_id(subscription_id, notification_type, opts = {}) ⇒ GetSubscriptionByIdResponse

Returns information about a subscription for the specified notification type. The getSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • subscription_id

    The identifier for the subscription that you want to get.

  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:



380
381
382
383
# File 'lib/notifications_api_model/api/notifications_api.rb', line 380

def get_subscription_by_id(subscription_id, notification_type, opts = {})
  data, _status_code, _headers = get_subscription_by_id_with_http_info(subscription_id, notification_type, opts)
  data
end

#get_subscription_by_id_with_http_info(subscription_id, notification_type, opts = {}) ⇒ Array<(GetSubscriptionByIdResponse, Integer, Hash)>

Returns information about a subscription for the specified notification type. The getSubscriptionById API is grantless. For more information, see [Grantless operations](doc:grantless-operations) in the Selling Partner API Developer Guide. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • subscription_id

    The identifier for the subscription that you want to get.

  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:

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

    GetSubscriptionByIdResponse data, response status code and response headers

Raises:

  • (ArgumentError)


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
422
423
424
425
426
427
# File 'lib/notifications_api_model/api/notifications_api.rb', line 390

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

  # resource path
  local_var_path = '/notifications/v1/subscriptions/{notificationType}/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'notificationType' + '}', notification_type.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', 'Successful Response'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body]

  return_type = opts[:return_type] || 'GetSubscriptionByIdResponse'

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

#get_subscription_with_http_info(notification_type, opts = {}) ⇒ Array<(GetSubscriptionResponse, Integer, Hash)>

Returns information about subscriptions of the specified notification type. You can use this API to get subscription information when you do not have a subscription identifier. **Usage Plan:** | Rate (requests per second) | Burst | | —- | —- | | 1 | 5 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).

Parameters:

  • notification_type

    The type of notification. For more information about notification types, see [the Notifications API Use Case Guide](doc:notifications-api-v1-use-case-guide).

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

    the optional parameters

Returns:

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

    GetSubscriptionResponse data, response status code and response headers

Raises:

  • (ArgumentError)


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
371
372
373
# File 'lib/notifications_api_model/api/notifications_api.rb', line 338

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

  # resource path
  local_var_path = '/notifications/v1/subscriptions/{notificationType}'.sub('{' + 'notificationType' + '}', notification_type.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', 'Successful Response'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body]

  return_type = opts[:return_type] || 'GetSubscriptionResponse'

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