Class: Zyphr::WaaSEventTypesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WaaSEventTypesApi

Returns a new instance of WaaSEventTypesApi.



19
20
21
# File 'lib/zyphr/api/waa_s_event_types_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_event_types_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_waa_s_event_type(app_id, create_waa_s_event_type_request, opts = {}) ⇒ CreateWaaSEventType201Response

Register an event type Register a new custom event type for a WaaS application.

Parameters:

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

    the optional parameters

Returns:



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

def create_waa_s_event_type(app_id, create_waa_s_event_type_request, opts = {})
  data, _status_code, _headers = create_waa_s_event_type_with_http_info(app_id, create_waa_s_event_type_request, opts)
  data
end

#create_waa_s_event_type_with_http_info(app_id, create_waa_s_event_type_request, opts = {}) ⇒ Array<(CreateWaaSEventType201Response, Integer, Hash)>

Register an event type Register a new custom event type for a WaaS application.

Parameters:

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

    the optional parameters

Returns:



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
88
89
90
91
92
93
94
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 39

def create_waa_s_event_type_with_http_info(app_id, create_waa_s_event_type_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSEventTypesApi.create_waa_s_event_type ...'
  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 WaaSEventTypesApi.create_waa_s_event_type"
  end
  # verify the required parameter 'create_waa_s_event_type_request' is set
  if @api_client.config.client_side_validation && create_waa_s_event_type_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_waa_s_event_type_request' when calling WaaSEventTypesApi.create_waa_s_event_type"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/event-types'.sub('{' + 'appId' + '}', CGI.escape(app_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']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_waa_s_event_type_request)

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

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

  new_options = opts.merge(
    :operation => :"WaaSEventTypesApi.create_waa_s_event_type",
    :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: WaaSEventTypesApi#create_waa_s_event_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_waa_s_event_type(app_id, event_type_id, opts = {}) ⇒ nil

Delete an event type Permanently delete an event type. Endpoints subscribed to this type will stop receiving deliveries.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


102
103
104
105
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 102

def delete_waa_s_event_type(app_id, event_type_id, opts = {})
  delete_waa_s_event_type_with_http_info(app_id, event_type_id, opts)
  nil
end

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

Delete an event type Permanently delete an event type. Endpoints subscribed to this type will stop receiving deliveries.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 113

def delete_waa_s_event_type_with_http_info(app_id, event_type_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSEventTypesApi.delete_waa_s_event_type ...'
  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 WaaSEventTypesApi.delete_waa_s_event_type"
  end
  # verify the required parameter 'event_type_id' is set
  if @api_client.config.client_side_validation && event_type_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_type_id' when calling WaaSEventTypesApi.delete_waa_s_event_type"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/event-types/{eventTypeId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'eventTypeId' + '}', CGI.escape(event_type_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 => :"WaaSEventTypesApi.delete_waa_s_event_type",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WaaSEventTypesApi#delete_waa_s_event_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#deprecate_waa_s_event_type(app_id, event_type_id, opts = {}) ⇒ nil

Deprecate an event type Mark an event type as deprecated. Existing subscriptions continue to receive deliveries, but new subscriptions are blocked.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


169
170
171
172
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 169

def deprecate_waa_s_event_type(app_id, event_type_id, opts = {})
  deprecate_waa_s_event_type_with_http_info(app_id, event_type_id, opts)
  nil
end

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

Deprecate an event type Mark an event type as deprecated. Existing subscriptions continue to receive deliveries, but new subscriptions are blocked.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 180

def deprecate_waa_s_event_type_with_http_info(app_id, event_type_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSEventTypesApi.deprecate_waa_s_event_type ...'
  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 WaaSEventTypesApi.deprecate_waa_s_event_type"
  end
  # verify the required parameter 'event_type_id' is set
  if @api_client.config.client_side_validation && event_type_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_type_id' when calling WaaSEventTypesApi.deprecate_waa_s_event_type"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/event-types/{eventTypeId}/deprecate'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'eventTypeId' + '}', CGI.escape(event_type_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 => :"WaaSEventTypesApi.deprecate_waa_s_event_type",
    :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: WaaSEventTypesApi#deprecate_waa_s_event_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_waa_s_event_type(app_id, event_type_id, opts = {}) ⇒ CreateWaaSEventType201Response

Get an event type

Parameters:

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

    the optional parameters

Returns:



235
236
237
238
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 235

def get_waa_s_event_type(app_id, event_type_id, opts = {})
  data, _status_code, _headers = get_waa_s_event_type_with_http_info(app_id, event_type_id, opts)
  data
end

#get_waa_s_event_type_with_http_info(app_id, event_type_id, opts = {}) ⇒ Array<(CreateWaaSEventType201Response, Integer, Hash)>

Get an event type

Parameters:

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

    the optional parameters

Returns:



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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 245

def get_waa_s_event_type_with_http_info(app_id, event_type_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSEventTypesApi.get_waa_s_event_type ...'
  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 WaaSEventTypesApi.get_waa_s_event_type"
  end
  # verify the required parameter 'event_type_id' is set
  if @api_client.config.client_side_validation && event_type_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_type_id' when calling WaaSEventTypesApi.get_waa_s_event_type"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/event-types/{eventTypeId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'eventTypeId' + '}', CGI.escape(event_type_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']) 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] || 'CreateWaaSEventType201Response'

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

  new_options = opts.merge(
    :operation => :"WaaSEventTypesApi.get_waa_s_event_type",
    :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: WaaSEventTypesApi#get_waa_s_event_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_waa_s_event_types(app_id, opts = {}) ⇒ ListWaaSEventTypes200Response

List event types List all event types registered for a WaaS application.

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
  • :category (String)
  • :status (String)

Returns:



306
307
308
309
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 306

def list_waa_s_event_types(app_id, opts = {})
  data, _status_code, _headers = list_waa_s_event_types_with_http_info(app_id, opts)
  data
end

#list_waa_s_event_types_with_http_info(app_id, opts = {}) ⇒ Array<(ListWaaSEventTypes200Response, Integer, Hash)>

List event types List all event types registered for a WaaS application.

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
  • :category (String)
  • :status (String)

Returns:



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 320

def list_waa_s_event_types_with_http_info(app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSEventTypesApi.list_waa_s_event_types ...'
  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 WaaSEventTypesApi.list_waa_s_event_types"
  end
  allowable_values = ["active", "deprecated"]
  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}/event-types'.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[:'category'] = opts[:'category'] if !opts[:'category'].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] || 'ListWaaSEventTypes200Response'

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

  new_options = opts.merge(
    :operation => :"WaaSEventTypesApi.list_waa_s_event_types",
    :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: WaaSEventTypesApi#list_waa_s_event_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_waa_s_event_type(app_id, event_type_id, update_waa_s_event_type_request, opts = {}) ⇒ nil

Update an event type

Parameters:

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

    the optional parameters

Returns:

  • (nil)


382
383
384
385
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 382

def update_waa_s_event_type(app_id, event_type_id, update_waa_s_event_type_request, opts = {})
  update_waa_s_event_type_with_http_info(app_id, event_type_id, update_waa_s_event_type_request, opts)
  nil
end

#update_waa_s_event_type_with_http_info(app_id, event_type_id, update_waa_s_event_type_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update an event type

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/zyphr/api/waa_s_event_types_api.rb', line 393

def update_waa_s_event_type_with_http_info(app_id, event_type_id, update_waa_s_event_type_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WaaSEventTypesApi.update_waa_s_event_type ...'
  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 WaaSEventTypesApi.update_waa_s_event_type"
  end
  # verify the required parameter 'event_type_id' is set
  if @api_client.config.client_side_validation && event_type_id.nil?
    fail ArgumentError, "Missing the required parameter 'event_type_id' when calling WaaSEventTypesApi.update_waa_s_event_type"
  end
  # verify the required parameter 'update_waa_s_event_type_request' is set
  if @api_client.config.client_side_validation && update_waa_s_event_type_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_waa_s_event_type_request' when calling WaaSEventTypesApi.update_waa_s_event_type"
  end
  # resource path
  local_var_path = '/v1/waas/applications/{appId}/event-types/{eventTypeId}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'eventTypeId' + '}', CGI.escape(event_type_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_waa_s_event_type_request)

  # return_type
  return_type = opts[:debug_return_type]

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

  new_options = opts.merge(
    :operation => :"WaaSEventTypesApi.update_waa_s_event_type",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WaaSEventTypesApi#update_waa_s_event_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end