Class: Svix::WebhookEndpointApi

Inherits:
Object
  • Object
show all
Defined in:
lib/svix/api/webhook_endpoint_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WebhookEndpointApi

Returns a new instance of WebhookEndpointApi.



19
20
21
# File 'lib/svix/api/webhook_endpoint_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/svix/api/webhook_endpoint_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_operational_webhook_endpoint(operational_webhook_endpoint_in, opts = {}) ⇒ OperationalWebhookEndpointOut

Create Operational Webhook Endpoint Create an operational webhook endpoint.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    The request's idempotency key

Returns:



28
29
30
31
# File 'lib/svix/api/webhook_endpoint_api.rb', line 28

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

#create_operational_webhook_endpoint_with_http_info(operational_webhook_endpoint_in, opts = {}) ⇒ Array<(OperationalWebhookEndpointOut, Integer, Hash)>

Create Operational Webhook Endpoint Create an operational webhook endpoint.

Parameters:

Options Hash (opts):

  • :idempotency_key (String)

    The request&#39;s idempotency key

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
# File 'lib/svix/api/webhook_endpoint_api.rb', line 39

def create_operational_webhook_endpoint_with_http_info(operational_webhook_endpoint_in, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookEndpointApi.create_operational_webhook_endpoint ...'
  end
  # verify the required parameter 'operational_webhook_endpoint_in' is set
  if @api_client.config.client_side_validation && operational_webhook_endpoint_in.nil?
    fail ArgumentError, "Missing the required parameter 'operational_webhook_endpoint_in' when calling WebhookEndpointApi.create_operational_webhook_endpoint"
  end
  # resource path
  local_var_path = '/api/v1/operational-webhook/endpoint'

  # 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
  header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

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

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

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

#delete_operational_webhook_endpoint(endpoint_id, opts = {}) ⇒ nil

Delete Operational Webhook Endpoint Delete an operational webhook endpoint.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:

  • (nil)


98
99
100
101
# File 'lib/svix/api/webhook_endpoint_api.rb', line 98

def delete_operational_webhook_endpoint(endpoint_id, opts = {})
  delete_operational_webhook_endpoint_with_http_info(endpoint_id, opts)
  nil
end

#delete_operational_webhook_endpoint_with_http_info(endpoint_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Operational Webhook Endpoint Delete an operational webhook endpoint.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/svix/api/webhook_endpoint_api.rb', line 108

def delete_operational_webhook_endpoint_with_http_info(endpoint_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookEndpointApi.delete_operational_webhook_endpoint ...'
  end
  # verify the required parameter 'endpoint_id' is set
  if @api_client.config.client_side_validation && endpoint_id.nil?
    fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WebhookEndpointApi.delete_operational_webhook_endpoint"
  end
  if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.delete_operational_webhook_endpoint, the character length must be smaller than or equal to 256.'
  end

  if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.delete_operational_webhook_endpoint, the character length must be great than or equal to 1.'
  end

  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
  if @api_client.config.client_side_validation && endpoint_id !~ pattern
    fail ArgumentError, "invalid value for 'endpoint_id' when calling WebhookEndpointApi.delete_operational_webhook_endpoint, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api/v1/operational-webhook/endpoint/{endpoint_id}'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_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]

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

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

#get_operational_webhook_endpoint(endpoint_id, opts = {}) ⇒ OperationalWebhookEndpointOut

Get Operational Webhook Endpoint Get an operational webhook endpoint.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:



174
175
176
177
# File 'lib/svix/api/webhook_endpoint_api.rb', line 174

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

#get_operational_webhook_endpoint_secret(endpoint_id, opts = {}) ⇒ OperationalWebhookEndpointSecretOut

Get Operational Webhook Endpoint Secret Get an operational webhook endpoint’s signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](docs.svix.com/consuming-webhooks/).

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:



250
251
252
253
# File 'lib/svix/api/webhook_endpoint_api.rb', line 250

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

#get_operational_webhook_endpoint_secret_with_http_info(endpoint_id, opts = {}) ⇒ Array<(OperationalWebhookEndpointSecretOut, Integer, Hash)>

Get Operational Webhook Endpoint Secret Get an operational webhook endpoint&#39;s signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](docs.svix.com/consuming-webhooks/).

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:



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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/svix/api/webhook_endpoint_api.rb', line 260

def get_operational_webhook_endpoint_secret_with_http_info(endpoint_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookEndpointApi.get_operational_webhook_endpoint_secret ...'
  end
  # verify the required parameter 'endpoint_id' is set
  if @api_client.config.client_side_validation && endpoint_id.nil?
    fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WebhookEndpointApi.get_operational_webhook_endpoint_secret"
  end
  if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.get_operational_webhook_endpoint_secret, the character length must be smaller than or equal to 256.'
  end

  if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.get_operational_webhook_endpoint_secret, the character length must be great than or equal to 1.'
  end

  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
  if @api_client.config.client_side_validation && endpoint_id !~ pattern
    fail ArgumentError, "invalid value for 'endpoint_id' when calling WebhookEndpointApi.get_operational_webhook_endpoint_secret, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api/v1/operational-webhook/endpoint/{endpoint_id}/secret'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_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] || 'OperationalWebhookEndpointSecretOut'

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

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

#get_operational_webhook_endpoint_with_http_info(endpoint_id, opts = {}) ⇒ Array<(OperationalWebhookEndpointOut, Integer, Hash)>

Get Operational Webhook Endpoint Get an operational webhook endpoint.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:



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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/svix/api/webhook_endpoint_api.rb', line 184

def get_operational_webhook_endpoint_with_http_info(endpoint_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookEndpointApi.get_operational_webhook_endpoint ...'
  end
  # verify the required parameter 'endpoint_id' is set
  if @api_client.config.client_side_validation && endpoint_id.nil?
    fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WebhookEndpointApi.get_operational_webhook_endpoint"
  end
  if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.get_operational_webhook_endpoint, the character length must be smaller than or equal to 256.'
  end

  if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.get_operational_webhook_endpoint, the character length must be great than or equal to 1.'
  end

  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
  if @api_client.config.client_side_validation && endpoint_id !~ pattern
    fail ArgumentError, "invalid value for 'endpoint_id' when calling WebhookEndpointApi.get_operational_webhook_endpoint, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api/v1/operational-webhook/endpoint/{endpoint_id}'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_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] || 'OperationalWebhookEndpointOut'

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

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

#list_operational_webhook_endpoints(opts = {}) ⇒ ListResponseOperationalWebhookEndpointOut

List Operational Webhook Endpoints List operational webhook endpoints.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit the number of returned items

  • :iterator (String)

    The iterator returned from a prior invocation

  • :order (Ordering)

    The sorting order of the returned items

Returns:



328
329
330
331
# File 'lib/svix/api/webhook_endpoint_api.rb', line 328

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

#list_operational_webhook_endpoints_with_http_info(opts = {}) ⇒ Array<(ListResponseOperationalWebhookEndpointOut, Integer, Hash)>

List Operational Webhook Endpoints List operational webhook endpoints.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit the number of returned items

  • :iterator (String)

    The iterator returned from a prior invocation

  • :order (Ordering)

    The sorting order of the returned items

Returns:



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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/svix/api/webhook_endpoint_api.rb', line 340

def list_operational_webhook_endpoints_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookEndpointApi.list_operational_webhook_endpoints ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 250
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WebhookEndpointApi.list_operational_webhook_endpoints, must be smaller than or equal to 250.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WebhookEndpointApi.list_operational_webhook_endpoints, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/api/v1/operational-webhook/endpoint'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].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] || 'ListResponseOperationalWebhookEndpointOut'

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

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

#rotate_operational_webhook_endpoint_secret(endpoint_id, operational_webhook_endpoint_secret_in, opts = {}) ⇒ nil

Rotate Operational Webhook Endpoint Secret Rotates an operational webhook endpoint’s signing secret. The previous secret will remain valid for the next 24 hours.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    The request&#39;s idempotency key

Returns:

  • (nil)


402
403
404
405
# File 'lib/svix/api/webhook_endpoint_api.rb', line 402

def rotate_operational_webhook_endpoint_secret(endpoint_id, operational_webhook_endpoint_secret_in, opts = {})
  rotate_operational_webhook_endpoint_secret_with_http_info(endpoint_id, operational_webhook_endpoint_secret_in, opts)
  nil
end

#rotate_operational_webhook_endpoint_secret_with_http_info(endpoint_id, operational_webhook_endpoint_secret_in, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Rotate Operational Webhook Endpoint Secret Rotates an operational webhook endpoint&#39;s signing secret. The previous secret will remain valid for the next 24 hours.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    The request&#39;s idempotency key

Returns:

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

    nil, response status code and response headers



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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/svix/api/webhook_endpoint_api.rb', line 414

def rotate_operational_webhook_endpoint_secret_with_http_info(endpoint_id, operational_webhook_endpoint_secret_in, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookEndpointApi.rotate_operational_webhook_endpoint_secret ...'
  end
  # verify the required parameter 'endpoint_id' is set
  if @api_client.config.client_side_validation && endpoint_id.nil?
    fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WebhookEndpointApi.rotate_operational_webhook_endpoint_secret"
  end
  if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.rotate_operational_webhook_endpoint_secret, the character length must be smaller than or equal to 256.'
  end

  if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.rotate_operational_webhook_endpoint_secret, the character length must be great than or equal to 1.'
  end

  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
  if @api_client.config.client_side_validation && endpoint_id !~ pattern
    fail ArgumentError, "invalid value for 'endpoint_id' when calling WebhookEndpointApi.rotate_operational_webhook_endpoint_secret, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'operational_webhook_endpoint_secret_in' is set
  if @api_client.config.client_side_validation && operational_webhook_endpoint_secret_in.nil?
    fail ArgumentError, "Missing the required parameter 'operational_webhook_endpoint_secret_in' when calling WebhookEndpointApi.rotate_operational_webhook_endpoint_secret"
  end
  # resource path
  local_var_path = '/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_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
  header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

#update_operational_webhook_endpoint(endpoint_id, operational_webhook_endpoint_update, opts = {}) ⇒ OperationalWebhookEndpointOut

Update Operational Webhook Endpoint Update an operational webhook endpoint.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:



491
492
493
494
# File 'lib/svix/api/webhook_endpoint_api.rb', line 491

def update_operational_webhook_endpoint(endpoint_id, operational_webhook_endpoint_update, opts = {})
  data, _status_code, _headers = update_operational_webhook_endpoint_with_http_info(endpoint_id, operational_webhook_endpoint_update, opts)
  data
end

#update_operational_webhook_endpoint_with_http_info(endpoint_id, operational_webhook_endpoint_update, opts = {}) ⇒ Array<(OperationalWebhookEndpointOut, Integer, Hash)>

Update Operational Webhook Endpoint Update an operational webhook endpoint.

Parameters:

  • endpoint_id (String)

    The ep&#39;s ID or UID

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

    the optional parameters

Returns:



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
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/svix/api/webhook_endpoint_api.rb', line 502

def update_operational_webhook_endpoint_with_http_info(endpoint_id, operational_webhook_endpoint_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookEndpointApi.update_operational_webhook_endpoint ...'
  end
  # verify the required parameter 'endpoint_id' is set
  if @api_client.config.client_side_validation && endpoint_id.nil?
    fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling WebhookEndpointApi.update_operational_webhook_endpoint"
  end
  if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.update_operational_webhook_endpoint, the character length must be smaller than or equal to 256.'
  end

  if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
    fail ArgumentError, 'invalid value for "endpoint_id" when calling WebhookEndpointApi.update_operational_webhook_endpoint, the character length must be great than or equal to 1.'
  end

  pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
  if @api_client.config.client_side_validation && endpoint_id !~ pattern
    fail ArgumentError, "invalid value for 'endpoint_id' when calling WebhookEndpointApi.update_operational_webhook_endpoint, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'operational_webhook_endpoint_update' is set
  if @api_client.config.client_side_validation && operational_webhook_endpoint_update.nil?
    fail ArgumentError, "Missing the required parameter 'operational_webhook_endpoint_update' when calling WebhookEndpointApi.update_operational_webhook_endpoint"
  end
  # resource path
  local_var_path = '/api/v1/operational-webhook/endpoint/{endpoint_id}'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_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(operational_webhook_endpoint_update)

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

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

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