Class: Zyphr::WebhooksApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WebhooksApi

Returns a new instance of WebhooksApi.



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

def api_client
  @api_client
end

Instance Method Details

#bulk_retry_webhook_deliveries(id, opts = {}) ⇒ WebhookBulkRetryResponse

Bulk retry failed deliveries Bulk retry failed or exhausted deliveries for a webhook. Creates an asynchronous job.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Options Hash (opts):

Returns:



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

def bulk_retry_webhook_deliveries(id, opts = {})
  data, _status_code, _headers = bulk_retry_webhook_deliveries_with_http_info(id, opts)
  data
end

#bulk_retry_webhook_deliveries_with_http_info(id, opts = {}) ⇒ Array<(WebhookBulkRetryResponse, Integer, Hash)>

Bulk retry failed deliveries Bulk retry failed or exhausted deliveries for a webhook. Creates an asynchronous job.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Options Hash (opts):

Returns:

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

    WebhookBulkRetryResponse data, 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
88
89
90
# File 'lib/zyphr/api/webhooks_api.rb', line 39

def bulk_retry_webhook_deliveries_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.bulk_retry_webhook_deliveries ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.bulk_retry_webhook_deliveries"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/deliveries/bulk-retry'.sub('{' + 'id' + '}', CGI.escape(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(opts[:'bulk_retry_webhook_deliveries_request'])

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

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

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

#close_webhook_circuit(id, opts = {}) ⇒ WebhookCircuitStateResponse

Force close circuit breaker Force-close the circuit breaker for a webhook, allowing deliveries to resume.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



97
98
99
100
# File 'lib/zyphr/api/webhooks_api.rb', line 97

def close_webhook_circuit(id, opts = {})
  data, _status_code, _headers = close_webhook_circuit_with_http_info(id, opts)
  data
end

#close_webhook_circuit_with_http_info(id, opts = {}) ⇒ Array<(WebhookCircuitStateResponse, Integer, Hash)>

Force close circuit breaker Force-close the circuit breaker for a webhook, allowing deliveries to resume.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookCircuitStateResponse data, response status code and response headers



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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/zyphr/api/webhooks_api.rb', line 107

def close_webhook_circuit_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.close_webhook_circuit ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.close_webhook_circuit"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/circuit/close'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebhookCircuitStateResponse'

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

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

#create_webhook(create_webhook_request, opts = {}) ⇒ WebhookCreateResponse

Create webhook Create a new webhook endpoint. The signing secret is only returned on creation.

Parameters:

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

    the optional parameters

Returns:



160
161
162
163
# File 'lib/zyphr/api/webhooks_api.rb', line 160

def create_webhook(create_webhook_request, opts = {})
  data, _status_code, _headers = create_webhook_with_http_info(create_webhook_request, opts)
  data
end

#create_webhook_with_http_info(create_webhook_request, opts = {}) ⇒ Array<(WebhookCreateResponse, Integer, Hash)>

Create webhook Create a new webhook endpoint. The signing secret is only returned on creation.

Parameters:

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

    the optional parameters

Returns:

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

    WebhookCreateResponse data, response status code and response headers



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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/zyphr/api/webhooks_api.rb', line 170

def create_webhook_with_http_info(create_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.create_webhook ...'
  end
  # verify the required parameter 'create_webhook_request' is set
  if @api_client.config.client_side_validation && create_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_webhook_request' when calling WebhooksApi.create_webhook"
  end
  # resource path
  local_var_path = '/v1/webhooks'

  # 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_webhook_request)

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

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

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

#delete_webhook(id, opts = {}) ⇒ WebhookDeleteResponse

Delete webhook Delete a webhook and clean up associated circuit breaker, rate limit, and metrics state.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



228
229
230
231
# File 'lib/zyphr/api/webhooks_api.rb', line 228

def delete_webhook(id, opts = {})
  data, _status_code, _headers = delete_webhook_with_http_info(id, opts)
  data
end

#delete_webhook_with_http_info(id, opts = {}) ⇒ Array<(WebhookDeleteResponse, Integer, Hash)>

Delete webhook Delete a webhook and clean up associated circuit breaker, rate limit, and metrics state.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookDeleteResponse data, response status code and response headers



238
239
240
241
242
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
279
280
281
282
283
284
# File 'lib/zyphr/api/webhooks_api.rb', line 238

def delete_webhook_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.delete_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.delete_webhook"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebhookDeleteResponse'

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

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

#get_account_webhook_metrics(opts = {}) ⇒ WebhookAccountMetricsResponse

Get account webhook metrics Get aggregate webhook health and performance metrics for the entire account.

Parameters:

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

    the optional parameters

Returns:



290
291
292
293
# File 'lib/zyphr/api/webhooks_api.rb', line 290

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

#get_account_webhook_metrics_with_http_info(opts = {}) ⇒ Array<(WebhookAccountMetricsResponse, Integer, Hash)>

Get account webhook metrics Get aggregate webhook health and performance metrics for the entire account.

Parameters:

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

    the optional parameters

Returns:



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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# File 'lib/zyphr/api/webhooks_api.rb', line 299

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_account_webhook_metrics ...'
  end
  # resource path
  local_var_path = '/v1/webhooks/metrics'

  # 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] || 'WebhookAccountMetricsResponse'

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

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

#get_webhook(id, opts = {}) ⇒ WebhookResponse

Get webhook Get a specific webhook by ID.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



348
349
350
351
# File 'lib/zyphr/api/webhooks_api.rb', line 348

def get_webhook(id, opts = {})
  data, _status_code, _headers = get_webhook_with_http_info(id, opts)
  data
end

#get_webhook_circuit_state(id, opts = {}) ⇒ WebhookCircuitStateResponse

Get circuit breaker state Get the circuit breaker state for a webhook endpoint.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



411
412
413
414
# File 'lib/zyphr/api/webhooks_api.rb', line 411

def get_webhook_circuit_state(id, opts = {})
  data, _status_code, _headers = get_webhook_circuit_state_with_http_info(id, opts)
  data
end

#get_webhook_circuit_state_with_http_info(id, opts = {}) ⇒ Array<(WebhookCircuitStateResponse, Integer, Hash)>

Get circuit breaker state Get the circuit breaker state for a webhook endpoint.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookCircuitStateResponse data, response status code and response headers



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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/zyphr/api/webhooks_api.rb', line 421

def get_webhook_circuit_state_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_circuit_state ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_webhook_circuit_state"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/circuit'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebhookCircuitStateResponse'

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

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

#get_webhook_delivery(id, delivery_id, opts = {}) ⇒ WebhookDeliveryResponse

Get webhook delivery details Get a single delivery with full details including payload, headers, and response for debugging.

Parameters:

  • id (String)

    Webhook ID

  • delivery_id (String)

    Delivery ID

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

    the optional parameters

Returns:



475
476
477
478
# File 'lib/zyphr/api/webhooks_api.rb', line 475

def get_webhook_delivery(id, delivery_id, opts = {})
  data, _status_code, _headers = get_webhook_delivery_with_http_info(id, delivery_id, opts)
  data
end

#get_webhook_delivery_with_http_info(id, delivery_id, opts = {}) ⇒ Array<(WebhookDeliveryResponse, Integer, Hash)>

Get webhook delivery details Get a single delivery with full details including payload, headers, and response for debugging.

Parameters:

  • id (String)

    Webhook ID

  • delivery_id (String)

    Delivery ID

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

    the optional parameters

Returns:

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

    WebhookDeliveryResponse data, response status code and response headers



486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/zyphr/api/webhooks_api.rb', line 486

def get_webhook_delivery_with_http_info(id, delivery_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_delivery ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_webhook_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 WebhooksApi.get_webhook_delivery"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/deliveries/{deliveryId}'.sub('{' + 'id' + '}', CGI.escape(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] || {}
  # 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] || 'WebhookDeliveryResponse'

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

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

#get_webhook_ips(opts = {}) ⇒ WebhookIpsResponse

Get static webhook IPs Get static IP addresses used for webhook deliveries. Requires dedicated_ip plan feature (Scale/Enterprise).

Parameters:

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

    the optional parameters

Returns:



542
543
544
545
# File 'lib/zyphr/api/webhooks_api.rb', line 542

def get_webhook_ips(opts = {})
  data, _status_code, _headers = get_webhook_ips_with_http_info(opts)
  data
end

#get_webhook_ips_with_http_info(opts = {}) ⇒ Array<(WebhookIpsResponse, Integer, Hash)>

Get static webhook IPs Get static IP addresses used for webhook deliveries. Requires dedicated_ip plan feature (Scale/Enterprise).

Parameters:

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

    the optional parameters

Returns:

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

    WebhookIpsResponse data, response status code and response headers



551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/zyphr/api/webhooks_api.rb', line 551

def get_webhook_ips_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_ips ...'
  end
  # resource path
  local_var_path = '/v1/webhooks/ips'

  # 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] || 'WebhookIpsResponse'

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

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

#get_webhook_job(job_id, opts = {}) ⇒ WebhookJobResponse

Get replay/retry job status Get the status of a replay or bulk retry job.

Parameters:

  • job_id (String)

    Job ID

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

    the optional parameters

Returns:



600
601
602
603
# File 'lib/zyphr/api/webhooks_api.rb', line 600

def get_webhook_job(job_id, opts = {})
  data, _status_code, _headers = get_webhook_job_with_http_info(job_id, opts)
  data
end

#get_webhook_job_with_http_info(job_id, opts = {}) ⇒ Array<(WebhookJobResponse, Integer, Hash)>

Get replay/retry job status Get the status of a replay or bulk retry job.

Parameters:

  • job_id (String)

    Job ID

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

    the optional parameters

Returns:

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

    WebhookJobResponse data, response status code and response headers



610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/zyphr/api/webhooks_api.rb', line 610

def get_webhook_job_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_job ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling WebhooksApi.get_webhook_job"
  end
  # resource path
  local_var_path = '/v1/webhooks/jobs/{jobId}'.sub('{' + 'jobId' + '}', CGI.escape(job_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] || 'WebhookJobResponse'

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

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

#get_webhook_metrics(id, opts = {}) ⇒ WebhookMetricsResponse

Get webhook health metrics Get health and performance metrics for a specific webhook endpoint.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



663
664
665
666
# File 'lib/zyphr/api/webhooks_api.rb', line 663

def get_webhook_metrics(id, opts = {})
  data, _status_code, _headers = get_webhook_metrics_with_http_info(id, opts)
  data
end

#get_webhook_metrics_with_http_info(id, opts = {}) ⇒ Array<(WebhookMetricsResponse, Integer, Hash)>

Get webhook health metrics Get health and performance metrics for a specific webhook endpoint.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookMetricsResponse data, response status code and response headers



673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'lib/zyphr/api/webhooks_api.rb', line 673

def get_webhook_metrics_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_metrics ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_webhook_metrics"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/metrics'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebhookMetricsResponse'

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

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

#get_webhook_regions(opts = {}) ⇒ WebhookRegionsResponse

Get available webhook regions Get available webhook delivery regions. Requires multi_region plan feature (Enterprise only).

Parameters:

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

    the optional parameters

Returns:



725
726
727
728
# File 'lib/zyphr/api/webhooks_api.rb', line 725

def get_webhook_regions(opts = {})
  data, _status_code, _headers = get_webhook_regions_with_http_info(opts)
  data
end

#get_webhook_regions_with_http_info(opts = {}) ⇒ Array<(WebhookRegionsResponse, Integer, Hash)>

Get available webhook regions Get available webhook delivery regions. Requires multi_region plan feature (Enterprise only).

Parameters:

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

    the optional parameters

Returns:

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

    WebhookRegionsResponse data, response status code and response headers



734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
# File 'lib/zyphr/api/webhooks_api.rb', line 734

def get_webhook_regions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_regions ...'
  end
  # resource path
  local_var_path = '/v1/webhooks/regions'

  # 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] || 'WebhookRegionsResponse'

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

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

#get_webhook_usage(opts = {}) ⇒ WebhookUsageResponse

Get webhook usage metrics Get webhook delivery usage statistics for the current billing period.

Parameters:

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

    the optional parameters

Returns:



782
783
784
785
# File 'lib/zyphr/api/webhooks_api.rb', line 782

def get_webhook_usage(opts = {})
  data, _status_code, _headers = get_webhook_usage_with_http_info(opts)
  data
end

#get_webhook_usage_with_http_info(opts = {}) ⇒ Array<(WebhookUsageResponse, Integer, Hash)>

Get webhook usage metrics Get webhook delivery usage statistics for the current billing period.

Parameters:

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

    the optional parameters

Returns:

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

    WebhookUsageResponse data, response status code and response headers



791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
# File 'lib/zyphr/api/webhooks_api.rb', line 791

def get_webhook_usage_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook_usage ...'
  end
  # resource path
  local_var_path = '/v1/webhooks/usage'

  # 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] || 'WebhookUsageResponse'

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

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

#get_webhook_with_http_info(id, opts = {}) ⇒ Array<(WebhookResponse, Integer, Hash)>

Get webhook Get a specific webhook by ID.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookResponse data, response status code and response headers



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/zyphr/api/webhooks_api.rb', line 358

def get_webhook_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.get_webhook"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebhookResponse'

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

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

#list_webhook_deliveries(id, opts = {}) ⇒ WebhookDeliveryListResponse

List webhook deliveries List delivery attempts for a webhook with filtering and pagination.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by delivery status

  • :event_type (String)

    Filter by event type

  • :search (String)

    Search deliveries

  • :start_date (Time)

    Filter deliveries after this date

  • :end_date (Time)

    Filter deliveries before this date

  • :limit (Integer)

    Maximum number of deliveries to return (default to 50)

  • :offset (Integer)

    Number of deliveries to skip (default to 0)

Returns:



847
848
849
850
# File 'lib/zyphr/api/webhooks_api.rb', line 847

def list_webhook_deliveries(id, opts = {})
  data, _status_code, _headers = list_webhook_deliveries_with_http_info(id, opts)
  data
end

#list_webhook_deliveries_with_http_info(id, opts = {}) ⇒ Array<(WebhookDeliveryListResponse, Integer, Hash)>

List webhook deliveries List delivery attempts for a webhook with filtering and pagination.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter by delivery status

  • :event_type (String)

    Filter by event type

  • :search (String)

    Search deliveries

  • :start_date (Time)

    Filter deliveries after this date

  • :end_date (Time)

    Filter deliveries before this date

  • :limit (Integer)

    Maximum number of deliveries to return (default to 50)

  • :offset (Integer)

    Number of deliveries to skip (default to 0)

Returns:

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

    WebhookDeliveryListResponse data, response status code and response headers



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
# File 'lib/zyphr/api/webhooks_api.rb', line 864

def list_webhook_deliveries_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.list_webhook_deliveries ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.list_webhook_deliveries"
  end
  allowable_values = ["pending", "delivering", "delivered", "failed", "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/webhooks/{id}/deliveries'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'event_type'] = opts[:'event_type'] if !opts[:'event_type'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].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] || 'WebhookDeliveryListResponse'

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

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

#list_webhook_event_types(opts = {}) ⇒ WebhookEventTypesResponse

List webhook event types List available webhook event types with full registry information. Optionally filter by category.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :category (String)

    Filter event types by category

Returns:



928
929
930
931
# File 'lib/zyphr/api/webhooks_api.rb', line 928

def list_webhook_event_types(opts = {})
  data, _status_code, _headers = list_webhook_event_types_with_http_info(opts)
  data
end

#list_webhook_event_types_with_http_info(opts = {}) ⇒ Array<(WebhookEventTypesResponse, Integer, Hash)>

List webhook event types List available webhook event types with full registry information. Optionally filter by category.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :category (String)

    Filter event types by category

Returns:

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

    WebhookEventTypesResponse data, response status code and response headers



938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/zyphr/api/webhooks_api.rb', line 938

def list_webhook_event_types_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.list_webhook_event_types ...'
  end
  # resource path
  local_var_path = '/v1/webhooks/events'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].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] || 'WebhookEventTypesResponse'

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

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

#list_webhook_versions(opts = {}) ⇒ WebhookVersionsResponse

List webhook API versions List available webhook API versions with changelog and deprecation info.

Parameters:

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

    the optional parameters

Returns:



987
988
989
990
# File 'lib/zyphr/api/webhooks_api.rb', line 987

def list_webhook_versions(opts = {})
  data, _status_code, _headers = list_webhook_versions_with_http_info(opts)
  data
end

#list_webhook_versions_with_http_info(opts = {}) ⇒ Array<(WebhookVersionsResponse, Integer, Hash)>

List webhook API versions List available webhook API versions with changelog and deprecation info.

Parameters:

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

    the optional parameters

Returns:

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

    WebhookVersionsResponse data, response status code and response headers



996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
# File 'lib/zyphr/api/webhooks_api.rb', line 996

def list_webhook_versions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.list_webhook_versions ...'
  end
  # resource path
  local_var_path = '/v1/webhooks/versions'

  # 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] || 'WebhookVersionsResponse'

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

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

#list_webhooks(opts = {}) ⇒ WebhookListResponse

List webhooks List all webhooks for the account with pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Maximum number of webhooks to return (default to 50)

  • :offset (Integer)

    Number of webhooks to skip (default to 0)

Returns:



1046
1047
1048
1049
# File 'lib/zyphr/api/webhooks_api.rb', line 1046

def list_webhooks(opts = {})
  data, _status_code, _headers = list_webhooks_with_http_info(opts)
  data
end

#list_webhooks_with_http_info(opts = {}) ⇒ Array<(WebhookListResponse, Integer, Hash)>

List webhooks List all webhooks for the account with pagination.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Maximum number of webhooks to return (default to 50)

  • :offset (Integer)

    Number of webhooks to skip (default to 0)

Returns:

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

    WebhookListResponse data, response status code and response headers



1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
# File 'lib/zyphr/api/webhooks_api.rb', line 1057

def list_webhooks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.list_webhooks ...'
  end
  # resource path
  local_var_path = '/v1/webhooks'

  # 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?

  # 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] || 'WebhookListResponse'

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

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

#replay_webhook_events(id, replay_webhook_events_request, opts = {}) ⇒ WebhookReplayResponse

Replay webhook events Replay events for a webhook within a date range. Creates an asynchronous job that re-delivers matching events.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



1109
1110
1111
1112
# File 'lib/zyphr/api/webhooks_api.rb', line 1109

def replay_webhook_events(id, replay_webhook_events_request, opts = {})
  data, _status_code, _headers = replay_webhook_events_with_http_info(id, replay_webhook_events_request, opts)
  data
end

#replay_webhook_events_with_http_info(id, replay_webhook_events_request, opts = {}) ⇒ Array<(WebhookReplayResponse, Integer, Hash)>

Replay webhook events Replay events for a webhook within a date range. Creates an asynchronous job that re-delivers matching events.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookReplayResponse data, response status code and response headers



1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
# File 'lib/zyphr/api/webhooks_api.rb', line 1120

def replay_webhook_events_with_http_info(id, replay_webhook_events_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.replay_webhook_events ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.replay_webhook_events"
  end
  # verify the required parameter 'replay_webhook_events_request' is set
  if @api_client.config.client_side_validation && replay_webhook_events_request.nil?
    fail ArgumentError, "Missing the required parameter 'replay_webhook_events_request' when calling WebhooksApi.replay_webhook_events"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/replay'.sub('{' + 'id' + '}', CGI.escape(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(replay_webhook_events_request)

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

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

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

#retry_webhook_delivery(id, delivery_id, opts = {}) ⇒ WebhookDeliveryRetryResponse

Retry webhook delivery Retry a failed or exhausted webhook delivery. Only deliveries with status ‘failed’ or ‘exhausted’ can be retried.

Parameters:

  • id (String)

    Webhook ID

  • delivery_id (String)

    Delivery ID

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

    the optional parameters

Returns:



1183
1184
1185
1186
# File 'lib/zyphr/api/webhooks_api.rb', line 1183

def retry_webhook_delivery(id, delivery_id, opts = {})
  data, _status_code, _headers = retry_webhook_delivery_with_http_info(id, delivery_id, opts)
  data
end

#retry_webhook_delivery_with_http_info(id, delivery_id, opts = {}) ⇒ Array<(WebhookDeliveryRetryResponse, Integer, Hash)>

Retry webhook delivery Retry a failed or exhausted webhook delivery. Only deliveries with status &#39;failed&#39; or &#39;exhausted&#39; can be retried.

Parameters:

  • id (String)

    Webhook ID

  • delivery_id (String)

    Delivery ID

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

    the optional parameters

Returns:



1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
# File 'lib/zyphr/api/webhooks_api.rb', line 1194

def retry_webhook_delivery_with_http_info(id, delivery_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.retry_webhook_delivery ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.retry_webhook_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 WebhooksApi.retry_webhook_delivery"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/deliveries/{deliveryId}/retry'.sub('{' + 'id' + '}', CGI.escape(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] || {}
  # 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] || 'WebhookDeliveryRetryResponse'

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

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

#rotate_webhook_secret(id, opts = {}) ⇒ WebhookSecretRotateResponse

Rotate webhook secret Rotate the signing secret for a webhook. The new secret is only returned once.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



1251
1252
1253
1254
# File 'lib/zyphr/api/webhooks_api.rb', line 1251

def rotate_webhook_secret(id, opts = {})
  data, _status_code, _headers = rotate_webhook_secret_with_http_info(id, opts)
  data
end

#rotate_webhook_secret_with_http_info(id, opts = {}) ⇒ Array<(WebhookSecretRotateResponse, Integer, Hash)>

Rotate webhook secret Rotate the signing secret for a webhook. The new secret is only returned once.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookSecretRotateResponse data, response status code and response headers



1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
# File 'lib/zyphr/api/webhooks_api.rb', line 1261

def rotate_webhook_secret_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.rotate_webhook_secret ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.rotate_webhook_secret"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/rotate-secret'.sub('{' + 'id' + '}', CGI.escape(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] || 'WebhookSecretRotateResponse'

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

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

#send_webhook_test_event(id, opts = {}) ⇒ WebhookTestEventResponse

Send test event Send a test event to the webhook endpoint. Accepts optional event_type and custom payload.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Options Hash (opts):

Returns:



1315
1316
1317
1318
# File 'lib/zyphr/api/webhooks_api.rb', line 1315

def send_webhook_test_event(id, opts = {})
  data, _status_code, _headers = send_webhook_test_event_with_http_info(id, opts)
  data
end

#send_webhook_test_event_with_http_info(id, opts = {}) ⇒ Array<(WebhookTestEventResponse, Integer, Hash)>

Send test event Send a test event to the webhook endpoint. Accepts optional event_type and custom payload.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Options Hash (opts):

Returns:

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

    WebhookTestEventResponse data, response status code and response headers



1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
# File 'lib/zyphr/api/webhooks_api.rb', line 1326

def send_webhook_test_event_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.send_webhook_test_event ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.send_webhook_test_event"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/test'.sub('{' + 'id' + '}', CGI.escape(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(opts[:'send_webhook_test_event_request'])

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

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

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

#test_webhook_transform(id, test_webhook_transform_request, opts = {}) ⇒ WebhookTransformTestResponse

Test payload transformation Preview how a payload would be transformed by the webhook’s transformation rules without actually delivering.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



1385
1386
1387
1388
# File 'lib/zyphr/api/webhooks_api.rb', line 1385

def test_webhook_transform(id, test_webhook_transform_request, opts = {})
  data, _status_code, _headers = test_webhook_transform_with_http_info(id, test_webhook_transform_request, opts)
  data
end

#test_webhook_transform_with_http_info(id, test_webhook_transform_request, opts = {}) ⇒ Array<(WebhookTransformTestResponse, Integer, Hash)>

Test payload transformation Preview how a payload would be transformed by the webhook&#39;s transformation rules without actually delivering.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
# File 'lib/zyphr/api/webhooks_api.rb', line 1396

def test_webhook_transform_with_http_info(id, test_webhook_transform_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.test_webhook_transform ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.test_webhook_transform"
  end
  # verify the required parameter 'test_webhook_transform_request' is set
  if @api_client.config.client_side_validation && test_webhook_transform_request.nil?
    fail ArgumentError, "Missing the required parameter 'test_webhook_transform_request' when calling WebhooksApi.test_webhook_transform"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}/transform/test'.sub('{' + 'id' + '}', CGI.escape(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(test_webhook_transform_request)

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

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

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

#update_webhook(id, update_webhook_request, opts = {}) ⇒ WebhookResponse

Update webhook Update an existing webhook configuration.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:



1459
1460
1461
1462
# File 'lib/zyphr/api/webhooks_api.rb', line 1459

def update_webhook(id, update_webhook_request, opts = {})
  data, _status_code, _headers = update_webhook_with_http_info(id, update_webhook_request, opts)
  data
end

#update_webhook_with_http_info(id, update_webhook_request, opts = {}) ⇒ Array<(WebhookResponse, Integer, Hash)>

Update webhook Update an existing webhook configuration.

Parameters:

  • id (String)

    Webhook ID

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

    the optional parameters

Returns:

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

    WebhookResponse data, response status code and response headers



1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
# File 'lib/zyphr/api/webhooks_api.rb', line 1470

def update_webhook_with_http_info(id, update_webhook_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhooksApi.update_webhook ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling WebhooksApi.update_webhook"
  end
  # verify the required parameter 'update_webhook_request' is set
  if @api_client.config.client_side_validation && update_webhook_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_webhook_request' when calling WebhooksApi.update_webhook"
  end
  # resource path
  local_var_path = '/v1/webhooks/{id}'.sub('{' + 'id' + '}', CGI.escape(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(update_webhook_request)

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

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

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