Class: Zyphr::WaaSDeliveriesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zyphr/api/waa_s_deliveries_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WaaSDeliveriesApi

Returns a new instance of WaaSDeliveriesApi.



19
20
21
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_waa_s_delivery(app_id, delivery_id, opts = {}) ⇒ nil

Get delivery detail Get full delivery details including request/response data.

Parameters:

  • app_id (String)
  • delivery_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


28
29
30
31
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 28

def get_waa_s_delivery(app_id, delivery_id, opts = {})
  get_waa_s_delivery_with_http_info(app_id, delivery_id, opts)
  nil
end

#get_waa_s_delivery_with_http_info(app_id, delivery_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Get delivery detail Get full delivery details including request/response data.

Parameters:

  • app_id (String)
  • delivery_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
79
80
81
82
83
84
85
86
87
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 39

def get_waa_s_delivery_with_http_info(app_id, delivery_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSDeliveriesApi.get_waa_s_delivery ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WaaSDeliveriesApi.get_waa_s_delivery"
  end
  # verify the required parameter 'delivery_id' is set
  if @api_client.config.client_side_validation && delivery_id.nil?
    fail ArgumentError, "Missing the required parameter 'delivery_id' when calling WaaSDeliveriesApi.get_waa_s_delivery"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/deliveries/{deliveryId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'deliveryId' + '}', CGI.escape(delivery_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"WaaSDeliveriesApi.get_waa_s_delivery",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WaaSDeliveriesApi#get_waa_s_delivery\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_waa_s_deliveries(app_id, opts = {}) ⇒ ListWaaSEndpointDeliveries200Response

List deliveries List delivery records for a WaaS application. Filter by tenant, event type, or status.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0
  • :tenant_id (String)
  • :event_type (String)
  • :status (String)

Returns:



99
100
101
102
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 99

def list_waa_s_deliveries(app_id, opts = {})
  data, _status_code, _headers = list_waa_s_deliveries_with_http_info(app_id, opts)
  data
end

#list_waa_s_deliveries_with_http_info(app_id, opts = {}) ⇒ Array<(ListWaaSEndpointDeliveries200Response, Integer, Hash)>

List deliveries List delivery records for a WaaS application. Filter by tenant, event type, or status.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0
  • :tenant_id (String)
  • :event_type (String)
  • :status (String)

Returns:



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
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
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 114

def list_waa_s_deliveries_with_http_info(app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSDeliveriesApi.list_waa_s_deliveries ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WaaSDeliveriesApi.list_waa_s_deliveries"
  end
  allowable_values = ["pending", "delivering", "delivered", "failed", "retrying", "exhausted"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/deliveries'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'tenant_id'] = opts[:'tenant_id'] if !opts[:'tenant_id'].nil?
  query_params[:'event_type'] = opts[:'event_type'] if !opts[:'event_type'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ListWaaSEndpointDeliveries200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"WaaSDeliveriesApi.list_waa_s_deliveries",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WaaSDeliveriesApi#list_waa_s_deliveries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_waa_s_endpoint_deliveries(app_id, endpoint_id, opts = {}) ⇒ ListWaaSEndpointDeliveries200Response

List endpoint deliveries List deliveries for a specific endpoint.

Parameters:

  • app_id (String)
  • endpoint_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0
  • :status (String)

Returns:



180
181
182
183
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 180

def list_waa_s_endpoint_deliveries(app_id, endpoint_id, opts = {})
  data, _status_code, _headers = list_waa_s_endpoint_deliveries_with_http_info(app_id, endpoint_id, opts)
  data
end

#list_waa_s_endpoint_deliveries_with_http_info(app_id, endpoint_id, opts = {}) ⇒ Array<(ListWaaSEndpointDeliveries200Response, Integer, Hash)>

List endpoint deliveries List deliveries for a specific endpoint.

Parameters:

  • app_id (String)
  • endpoint_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0
  • :status (String)

Returns:



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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 194

def list_waa_s_endpoint_deliveries_with_http_info(app_id, endpoint_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSDeliveriesApi.list_waa_s_endpoint_deliveries ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WaaSDeliveriesApi.list_waa_s_endpoint_deliveries"
  end
  # verify the required parameter 'endpoint_id' is set
  if @api_client.config.client_side_validation && endpoint_id.nil?
    fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WaaSDeliveriesApi.list_waa_s_endpoint_deliveries"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/endpoints/{endpointId}/deliveries'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpointId' + '}', CGI.escape(endpoint_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ListWaaSEndpointDeliveries200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"WaaSDeliveriesApi.list_waa_s_endpoint_deliveries",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WaaSDeliveriesApi#list_waa_s_endpoint_deliveries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retry_waa_s_delivery(app_id, delivery_id, opts = {}) ⇒ nil

Retry a delivery Retry a failed or exhausted delivery. Resets the delivery status and re-queues it.

Parameters:

  • app_id (String)
  • delivery_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


255
256
257
258
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 255

def retry_waa_s_delivery(app_id, delivery_id, opts = {})
  retry_waa_s_delivery_with_http_info(app_id, delivery_id, opts)
  nil
end

#retry_waa_s_delivery_with_http_info(app_id, delivery_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Retry a delivery Retry a failed or exhausted delivery. Resets the delivery status and re-queues it.

Parameters:

  • app_id (String)
  • delivery_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/zyphr/api/waa_s_deliveries_api.rb', line 266

def retry_waa_s_delivery_with_http_info(app_id, delivery_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSDeliveriesApi.retry_waa_s_delivery ...'
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling WaaSDeliveriesApi.retry_waa_s_delivery"
  end
  # verify the required parameter 'delivery_id' is set
  if @api_client.config.client_side_validation && delivery_id.nil?
    fail ArgumentError, "Missing the required parameter 'delivery_id' when calling WaaSDeliveriesApi.retry_waa_s_delivery"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/deliveries/{deliveryId}/retry'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'deliveryId' + '}', CGI.escape(delivery_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']

  new_options = opts.merge(
    :operation => :"WaaSDeliveriesApi.retry_waa_s_delivery",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WaaSDeliveriesApi#retry_waa_s_delivery\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end