Class: MailSlurpClient::WebhookControllerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailslurp_client/api/webhook_controller_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WebhookControllerApi

Returns a new instance of WebhookControllerApi.



19
20
21
# File 'lib/mailslurp_client/api/webhook_controller_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/mailslurp_client/api/webhook_controller_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_account_webhook(create_webhook_options, opts = {}) ⇒ WebhookDto

Attach a WebHook URL to an inbox Get notified of account level events such as bounce and bounce recipient.

Parameters:

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 27

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

#create_account_webhook_with_http_info(create_webhook_options, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>

Attach a WebHook URL to an inbox Get notified of account level events such as bounce and bounce recipient.

Parameters:

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

    the optional parameters

Returns:

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

    WebhookDto data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 37

def (create_webhook_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.create_account_webhook ...'
  end
  # verify the required parameter 'create_webhook_options' is set
  if @api_client.config.client_side_validation && create_webhook_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_webhook_options' when calling WebhookControllerApi.create_account_webhook"
  end
  # resource path
  local_var_path = '/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(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#create_webhook(inbox_id, create_webhook_options, opts = {}) ⇒ WebhookDto

Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

Parameters:

  • inbox_id (String)
  • create_webhook_options (CreateWebhookOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



92
93
94
95
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 92

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

#create_webhook_for_phone_number(phone_number_id, create_webhook_options, opts = {}) ⇒ WebhookDto

Attach a WebHook URL to a phone number Get notified whenever a phone number receives an SMS via a WebHook URL.

Parameters:

  • phone_number_id (String)
  • create_webhook_options (CreateWebhookOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



162
163
164
165
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 162

def create_webhook_for_phone_number(phone_number_id, create_webhook_options, opts = {})
  data, _status_code, _headers = create_webhook_for_phone_number_with_http_info(phone_number_id, create_webhook_options, opts)
  data
end

#create_webhook_for_phone_number_with_http_info(phone_number_id, create_webhook_options, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>

Attach a WebHook URL to a phone number Get notified whenever a phone number receives an SMS via a WebHook URL.

Parameters:

  • phone_number_id (String)
  • create_webhook_options (CreateWebhookOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    WebhookDto data, response status code and response headers



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
222
223
224
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 173

def create_webhook_for_phone_number_with_http_info(phone_number_id, create_webhook_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.create_webhook_for_phone_number ...'
  end
  # verify the required parameter 'phone_number_id' is set
  if @api_client.config.client_side_validation && phone_number_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling WebhookControllerApi.create_webhook_for_phone_number"
  end
  # verify the required parameter 'create_webhook_options' is set
  if @api_client.config.client_side_validation && create_webhook_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_webhook_options' when calling WebhookControllerApi.create_webhook_for_phone_number"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneNumberId}/webhooks'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_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(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#create_webhook_with_http_info(inbox_id, create_webhook_options, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>

Attach a WebHook URL to an inbox Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.

Parameters:

  • inbox_id (String)
  • create_webhook_options (CreateWebhookOptions)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    WebhookDto data, response status code and response headers



103
104
105
106
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
154
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 103

def create_webhook_with_http_info(inbox_id, create_webhook_options, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.create_webhook ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.create_webhook"
  end
  # verify the required parameter 'create_webhook_options' is set
  if @api_client.config.client_side_validation && create_webhook_options.nil?
    fail ArgumentError, "Missing the required parameter 'create_webhook_options' when calling WebhookControllerApi.create_webhook"
  end
  # resource path
  local_var_path = '/inboxes/{inboxId}/webhooks'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_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(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#delete_all_webhooks(opts = {}) ⇒ nil

Delete all webhooks

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :before (DateTime)

    before

Returns:

  • (nil)


230
231
232
233
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 230

def delete_all_webhooks(opts = {})
  delete_all_webhooks_with_http_info(opts)
  nil
end

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

Delete all webhooks

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :before (DateTime)

    before

Returns:

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

    nil, response status code and response headers



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
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 239

def delete_all_webhooks_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.delete_all_webhooks ...'
  end
  # resource path
  local_var_path = '/webhooks'

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

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

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#delete_webhook(inbox_id, webhook_id, opts = {}) ⇒ nil

Delete and disable a Webhook for an Inbox

Parameters:

  • inbox_id (String)
  • webhook_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


286
287
288
289
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 286

def delete_webhook(inbox_id, webhook_id, opts = {})
  delete_webhook_with_http_info(inbox_id, webhook_id, opts)
  nil
end

#delete_webhook_by_id(webhook_id, opts = {}) ⇒ nil

Delete a webhook

Parameters:

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

    the optional parameters

Returns:

  • (nil)


349
350
351
352
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 349

def delete_webhook_by_id(webhook_id, opts = {})
  delete_webhook_by_id_with_http_info(webhook_id, opts)
  nil
end

#delete_webhook_by_id_with_http_info(webhook_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a webhook

Parameters:

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

    the optional parameters

Returns:

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

    nil, 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
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 358

def delete_webhook_by_id_with_http_info(webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.delete_webhook_by_id ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.delete_webhook_by_id"
  end
  # resource path
  local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

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

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

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#delete_webhook_with_http_info(inbox_id, webhook_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete and disable a Webhook for an Inbox

Parameters:

  • inbox_id (String)
  • webhook_id (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 296

def delete_webhook_with_http_info(inbox_id, webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.delete_webhook ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.delete_webhook"
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.delete_webhook"
  end
  # resource path
  local_var_path = '/inboxes/{inboxId}/webhooks/{webhookId}'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s)).sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

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

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

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_all_account_webhooks(opts = {}) ⇒ PageWebhookProjection

List account webhooks Paginated List account webhooks in paginated form. Allows for page index, page size, and sort direction.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size for paginated result list. (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'DESC')

  • :event_type (String)

    Optional event type

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



413
414
415
416
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 413

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

#get_all_account_webhooks_with_http_info(opts = {}) ⇒ Array<(PageWebhookProjection, Integer, Hash)>

List account webhooks Paginated List account webhooks in paginated form. Allows for page index, page size, and sort direction.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size for paginated result list.

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :event_type (String)

    Optional event type

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:

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

    PageWebhookProjection data, response status code and response headers



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
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 428

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

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

  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling WebhookControllerApi.get_all_account_webhooks, must be smaller than or equal to 100.'
  end

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

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "DELIVERY_STATUS", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"]
  if @api_client.config.client_side_validation && opts[:'event_type'] && !allowable_values.include?(opts[:'event_type'])
    fail ArgumentError, "invalid value for \"event_type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/webhooks/account/paginated'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'eventType'] = opts[:'event_type'] if !opts[:'event_type'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'PageWebhookProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_all_webhook_results(opts = {}) ⇒ PageWebhookResult

Get results for all webhooks

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size in list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :unseen_only (Boolean)

    Filter for unseen exceptions only

  • :result_type (String)

    Filter by result type

  • :event_name (String)

    Filter by event name

  • :min_status_code (Integer)

    Minimum response status

  • :max_status_code (Integer)

    Maximum response status

  • :inbox_id (String)

    Inbox ID

  • :sms_id (String)

    Sms ID

  • :attachment_id (String)

    Attachment ID

  • :email_id (String)

    Email ID

  • :phone_id (String)

    Phone ID

Returns:



520
521
522
523
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 520

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

#get_all_webhook_results_with_http_info(opts = {}) ⇒ Array<(PageWebhookResult, Integer, Hash)>

Get results for all webhooks

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size in list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :unseen_only (Boolean)

    Filter for unseen exceptions only

  • :result_type (String)

    Filter by result type

  • :event_name (String)

    Filter by event name

  • :min_status_code (Integer)

    Minimum response status

  • :max_status_code (Integer)

    Maximum response status

  • :inbox_id (String)

    Inbox ID

  • :sms_id (String)

    Sms ID

  • :attachment_id (String)

    Attachment ID

  • :email_id (String)

    Email ID

  • :phone_id (String)

    Phone ID

Returns:

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

    PageWebhookResult data, response status code and response headers



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
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 544

def get_all_webhook_results_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_all_webhook_results ...'
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["BAD_RESPONSE", "EXCEPTION", "SUCCESS", "REDRIVEN"]
  if @api_client.config.client_side_validation && opts[:'result_type'] && !allowable_values.include?(opts[:'result_type'])
    fail ArgumentError, "invalid value for \"result_type\", must be one of #{allowable_values}"
  end
  allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "DELIVERY_STATUS", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"]
  if @api_client.config.client_side_validation && opts[:'event_name'] && !allowable_values.include?(opts[:'event_name'])
    fail ArgumentError, "invalid value for \"event_name\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/webhooks/results'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'unseenOnly'] = opts[:'unseen_only'] if !opts[:'unseen_only'].nil?
  query_params[:'resultType'] = opts[:'result_type'] if !opts[:'result_type'].nil?
  query_params[:'eventName'] = opts[:'event_name'] if !opts[:'event_name'].nil?
  query_params[:'minStatusCode'] = opts[:'min_status_code'] if !opts[:'min_status_code'].nil?
  query_params[:'maxStatusCode'] = opts[:'max_status_code'] if !opts[:'max_status_code'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'smsId'] = opts[:'sms_id'] if !opts[:'sms_id'].nil?
  query_params[:'attachmentId'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?
  query_params[:'emailId'] = opts[:'email_id'] if !opts[:'email_id'].nil?
  query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'PageWebhookResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_all_webhooks(opts = {}) ⇒ PageWebhookProjection

List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size for paginated result list. (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'DESC')

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :inbox_id (String)

    Filter by inboxId

  • :phone_id (String)

    Filter by phoneId

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



627
628
629
630
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 627

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

#get_all_webhooks_with_http_info(opts = {}) ⇒ Array<(PageWebhookProjection, Integer, Hash)>

List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size for paginated result list.

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :inbox_id (String)

    Filter by inboxId

  • :phone_id (String)

    Filter by phoneId

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:

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

    PageWebhookProjection data, response status code and response headers



644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
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
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 644

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

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

  if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"size"]" when calling WebhookControllerApi.get_all_webhooks, must be smaller than or equal to 100.'
  end

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

  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/webhooks/paginated'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'PageWebhookProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_inbox_webhooks_paginated(inbox_id, opts = {}) ⇒ PageWebhookProjection

Get paginated webhooks for an Inbox

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size in list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



725
726
727
728
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 725

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

#get_inbox_webhooks_paginated_with_http_info(inbox_id, opts = {}) ⇒ Array<(PageWebhookProjection, Integer, Hash)>

Get paginated webhooks for an Inbox

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size in list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:

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

    PageWebhookProjection data, response status code and response headers



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
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 740

def get_inbox_webhooks_paginated_with_http_info(inbox_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_inbox_webhooks_paginated ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.get_inbox_webhooks_paginated"
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/inboxes/{inboxId}/webhooks/paginated'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'PageWebhookProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_json_schema_for_webhook_event(event, opts = {}) ⇒ JSONSchemaDto

Get JSON Schema definition for webhook payload by event

Parameters:

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

    the optional parameters

Returns:



801
802
803
804
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 801

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

#get_json_schema_for_webhook_event_with_http_info(event, opts = {}) ⇒ Array<(JSONSchemaDto, Integer, Hash)>

Get JSON Schema definition for webhook payload by event

Parameters:

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

    the optional parameters

Returns:

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

    JSONSchemaDto data, response status code and response headers



810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 810

def get_json_schema_for_webhook_event_with_http_info(event, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_json_schema_for_webhook_event ...'
  end
  # verify the required parameter 'event' is set
  if @api_client.config.client_side_validation && event.nil?
    fail ArgumentError, "Missing the required parameter 'event' when calling WebhookControllerApi.get_json_schema_for_webhook_event"
  end
  # verify enum value
  allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "DELIVERY_STATUS", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(event)
    fail ArgumentError, "invalid value for \"event\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/webhooks/schema'

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

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

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

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

  # return_type
  return_type = opts[:return_type] || 'JSONSchemaDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_json_schema_for_webhook_payload(webhook_id, opts = {}) ⇒ JSONSchemaDto

Get JSON Schema definition for webhook payload

Parameters:

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

    the optional parameters

Returns:



867
868
869
870
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 867

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

#get_json_schema_for_webhook_payload_with_http_info(webhook_id, opts = {}) ⇒ Array<(JSONSchemaDto, Integer, Hash)>

Get JSON Schema definition for webhook payload

Parameters:

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

    the optional parameters

Returns:

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

    JSONSchemaDto data, response status code and response headers



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/mailslurp_client/api/webhook_controller_api.rb', line 876

def get_json_schema_for_webhook_payload_with_http_info(webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_json_schema_for_webhook_payload ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.get_json_schema_for_webhook_payload"
  end
  # resource path
  local_var_path = '/webhooks/{webhookId}/schema'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'JSONSchemaDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_phone_number_webhooks_paginated(phone_id, opts = {}) ⇒ PageWebhookProjection

Get paginated webhooks for a phone number

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size in list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:



932
933
934
935
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 932

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

#get_phone_number_webhooks_paginated_with_http_info(phone_id, opts = {}) ⇒ Array<(PageWebhookProjection, Integer, Hash)>

Get paginated webhooks for a phone number

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size in list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

Returns:

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

    PageWebhookProjection data, response status code and response headers



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
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 946

def get_phone_number_webhooks_paginated_with_http_info(phone_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_phone_number_webhooks_paginated ...'
  end
  # verify the required parameter 'phone_id' is set
  if @api_client.config.client_side_validation && phone_id.nil?
    fail ArgumentError, "Missing the required parameter 'phone_id' when calling WebhookControllerApi.get_phone_number_webhooks_paginated"
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/phone/numbers/{phoneId}/webhooks/paginated'.sub('{' + 'phoneId' + '}', CGI.escape(phone_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'PageWebhookProjection' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload(opts = {}) ⇒ AbstractWebhookPayload

Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :event_name (String)

Returns:



1006
1007
1008
1009
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1006

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

#get_test_webhook_payload_bounce(opts = {}) ⇒ WebhookBouncePayload

Get webhook test payload for bounce

Parameters:

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

    the optional parameters

Returns:



1066
1067
1068
1069
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1066

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

#get_test_webhook_payload_bounce_recipient(opts = {}) ⇒ WebhookBounceRecipientPayload

Get webhook test payload for bounce recipient

Parameters:

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

    the optional parameters

Returns:



1120
1121
1122
1123
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1120

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

#get_test_webhook_payload_bounce_recipient_with_http_info(opts = {}) ⇒ Array<(WebhookBounceRecipientPayload, Integer, Hash)>

Get webhook test payload for bounce recipient

Parameters:

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

    the optional parameters

Returns:



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
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1128

def get_test_webhook_payload_bounce_recipient_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_bounce_recipient ...'
  end
  # resource path
  local_var_path = '/webhooks/test/email-bounce-recipient-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookBounceRecipientPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_bounce_with_http_info(opts = {}) ⇒ Array<(WebhookBouncePayload, Integer, Hash)>

Get webhook test payload for bounce

Parameters:

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

    the optional parameters

Returns:

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

    WebhookBouncePayload data, response status code and response headers



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
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1074

def get_test_webhook_payload_bounce_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_bounce ...'
  end
  # resource path
  local_var_path = '/webhooks/test/email-bounce-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookBouncePayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_delivery_status(opts = {}) ⇒ WebhookDeliveryStatusPayload

Get webhook test payload for delivery status event

Parameters:

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

    the optional parameters

Returns:



1174
1175
1176
1177
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1174

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

#get_test_webhook_payload_delivery_status_with_http_info(opts = {}) ⇒ Array<(WebhookDeliveryStatusPayload, Integer, Hash)>

Get webhook test payload for delivery status event

Parameters:

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

    the optional parameters

Returns:



1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
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
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1182

def get_test_webhook_payload_delivery_status_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_delivery_status ...'
  end
  # resource path
  local_var_path = '/webhooks/test/delivery-status-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookDeliveryStatusPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_email_opened(opts = {}) ⇒ WebhookEmailOpenedPayload

Get webhook test payload for email opened event

Parameters:

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

    the optional parameters

Returns:



1228
1229
1230
1231
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1228

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

#get_test_webhook_payload_email_opened_with_http_info(opts = {}) ⇒ Array<(WebhookEmailOpenedPayload, Integer, Hash)>

Get webhook test payload for email opened event

Parameters:

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

    the optional parameters

Returns:

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

    WebhookEmailOpenedPayload data, response status code and response headers



1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1236

def get_test_webhook_payload_email_opened_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_email_opened ...'
  end
  # resource path
  local_var_path = '/webhooks/test/email-opened-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookEmailOpenedPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_email_read(opts = {}) ⇒ WebhookEmailReadPayload

Get webhook test payload for email opened event

Parameters:

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

    the optional parameters

Returns:



1282
1283
1284
1285
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1282

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

#get_test_webhook_payload_email_read_with_http_info(opts = {}) ⇒ Array<(WebhookEmailReadPayload, Integer, Hash)>

Get webhook test payload for email opened event

Parameters:

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

    the optional parameters

Returns:

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

    WebhookEmailReadPayload data, response status code and response headers



1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1290

def get_test_webhook_payload_email_read_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_email_read ...'
  end
  # resource path
  local_var_path = '/webhooks/test/email-read-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookEmailReadPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_for_webhook(webhook_id, opts = {}) ⇒ AbstractWebhookPayload

Get example payload for webhook

Parameters:

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

    the optional parameters

Returns:



1337
1338
1339
1340
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1337

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

#get_test_webhook_payload_for_webhook_with_http_info(webhook_id, opts = {}) ⇒ Array<(AbstractWebhookPayload, Integer, Hash)>

Get example payload for webhook

Parameters:

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

    the optional parameters

Returns:

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

    AbstractWebhookPayload data, response status code and response headers



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
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1346

def get_test_webhook_payload_for_webhook_with_http_info(webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_for_webhook ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.get_test_webhook_payload_for_webhook"
  end
  # resource path
  local_var_path = '/webhooks/{webhookId}/example'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'AbstractWebhookPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_new_attachment(opts = {}) ⇒ WebhookNewAttachmentPayload

Get webhook test payload for new attachment event

Parameters:

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

    the optional parameters

Returns:



1396
1397
1398
1399
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1396

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

#get_test_webhook_payload_new_attachment_with_http_info(opts = {}) ⇒ Array<(WebhookNewAttachmentPayload, Integer, Hash)>

Get webhook test payload for new attachment event

Parameters:

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

    the optional parameters

Returns:

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

    WebhookNewAttachmentPayload data, response status code and response headers



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
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1404

def get_test_webhook_payload_new_attachment_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_new_attachment ...'
  end
  # resource path
  local_var_path = '/webhooks/test/new-attachment-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookNewAttachmentPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_new_contact(opts = {}) ⇒ WebhookNewContactPayload

Get webhook test payload for new contact event

Parameters:

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

    the optional parameters

Returns:



1450
1451
1452
1453
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1450

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

#get_test_webhook_payload_new_contact_with_http_info(opts = {}) ⇒ Array<(WebhookNewContactPayload, Integer, Hash)>

Get webhook test payload for new contact event

Parameters:

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

    the optional parameters

Returns:

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

    WebhookNewContactPayload data, response status code and response headers



1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
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
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1458

def get_test_webhook_payload_new_contact_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_new_contact ...'
  end
  # resource path
  local_var_path = '/webhooks/test/new-contact-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookNewContactPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_new_email(opts = {}) ⇒ WebhookNewEmailPayload

Get webhook test payload for new email event

Parameters:

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

    the optional parameters

Returns:



1504
1505
1506
1507
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1504

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

#get_test_webhook_payload_new_email_with_http_info(opts = {}) ⇒ Array<(WebhookNewEmailPayload, Integer, Hash)>

Get webhook test payload for new email event

Parameters:

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

    the optional parameters

Returns:

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

    WebhookNewEmailPayload data, response status code and response headers



1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1512

def get_test_webhook_payload_new_email_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_new_email ...'
  end
  # resource path
  local_var_path = '/webhooks/test/new-email-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookNewEmailPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_new_sms(opts = {}) ⇒ WebhookNewSmsPayload

Get webhook test payload for new sms event

Parameters:

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

    the optional parameters

Returns:



1558
1559
1560
1561
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1558

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

#get_test_webhook_payload_new_sms_with_http_info(opts = {}) ⇒ Array<(WebhookNewSmsPayload, Integer, Hash)>

Get webhook test payload for new sms event

Parameters:

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

    the optional parameters

Returns:

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

    WebhookNewSmsPayload data, response status code and response headers



1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1566

def get_test_webhook_payload_new_sms_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload_new_sms ...'
  end
  # resource path
  local_var_path = '/webhooks/test/new-sms-payload'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookNewSmsPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_test_webhook_payload_with_http_info(opts = {}) ⇒ Array<(AbstractWebhookPayload, Integer, Hash)>

Get test webhook payload example. Response content depends on eventName passed. Uses &#x60;EMAIL_RECEIVED&#x60; as default.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :event_name (String)

Returns:

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

    AbstractWebhookPayload data, response status code and response headers



1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1015

def get_test_webhook_payload_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_test_webhook_payload ...'
  end
  allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "DELIVERY_STATUS", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"]
  if @api_client.config.client_side_validation && opts[:'event_name'] && !allowable_values.include?(opts[:'event_name'])
    fail ArgumentError, "invalid value for \"event_name\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/webhooks/test'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'eventName'] = opts[:'event_name'] if !opts[:'event_name'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'AbstractWebhookPayload' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_webhook(webhook_id, opts = {}) ⇒ WebhookDto

Get a webhook

Parameters:

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

    the optional parameters

Returns:



1613
1614
1615
1616
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1613

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

#get_webhook_result(webhook_result_id, opts = {}) ⇒ WebhookResultDto

Get a webhook result for a webhook

Parameters:

  • webhook_result_id (String)

    Webhook Result ID

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

    the optional parameters

Returns:



1673
1674
1675
1676
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1673

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

#get_webhook_result_with_http_info(webhook_result_id, opts = {}) ⇒ Array<(WebhookResultDto, Integer, Hash)>

Get a webhook result for a webhook

Parameters:

  • webhook_result_id (String)

    Webhook Result ID

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

    the optional parameters

Returns:

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

    WebhookResultDto data, response status code and response headers



1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1682

def get_webhook_result_with_http_info(webhook_result_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhook_result ...'
  end
  # verify the required parameter 'webhook_result_id' is set
  if @api_client.config.client_side_validation && webhook_result_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_result_id' when calling WebhookControllerApi.get_webhook_result"
  end
  # resource path
  local_var_path = '/webhooks/results/{webhookResultId}'.sub('{' + 'webhookResultId' + '}', CGI.escape(webhook_result_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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookResultDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_webhook_results(webhook_id, opts = {}) ⇒ PageWebhookResult

Get a webhook results for a webhook

Parameters:

  • webhook_id (String)

    ID of webhook to get results for

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination (default to 0)

  • :size (Integer)

    Optional page size in list pagination (default to 20)

  • :sort (String)

    Optional createdAt sort direction ASC or DESC (default to 'ASC')

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :unseen_only (Boolean)

    Filter for unseen exceptions only

  • :result_type (String)

    Filter by result type

  • :event_name (String)

    Filter by event name

  • :min_status_code (Integer)

    Minimum response status

  • :max_status_code (Integer)

    Maximum response status

  • :inbox_id (String)

    Inbox ID

  • :sms_id (String)

    Sms ID

  • :attachment_id (String)

    Attachment ID

  • :email_id (String)

    Email ID

  • :phone_id (String)

    Phone ID

Returns:



1749
1750
1751
1752
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1749

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

#get_webhook_results_count(webhook_id, opts = {}) ⇒ CountDto

Get a webhook results count for a webhook

Parameters:

  • webhook_id (String)

    ID of webhook to get results for

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

    the optional parameters

Returns:



1853
1854
1855
1856
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1853

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

#get_webhook_results_count_with_http_info(webhook_id, opts = {}) ⇒ Array<(CountDto, Integer, Hash)>

Get a webhook results count for a webhook

Parameters:

  • webhook_id (String)

    ID of webhook to get results for

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

    the optional parameters

Returns:

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

    CountDto data, response status code and response headers



1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1862

def get_webhook_results_count_with_http_info(webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhook_results_count ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.get_webhook_results_count"
  end
  # resource path
  local_var_path = '/webhooks/{webhookId}/results/count'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'CountDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_webhook_results_unseen_error_count(opts = {}) ⇒ UnseenErrorCountDto

Get count of unseen webhook results with error status

Parameters:

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

    the optional parameters

Returns:



1912
1913
1914
1915
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1912

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

#get_webhook_results_unseen_error_count_with_http_info(opts = {}) ⇒ Array<(UnseenErrorCountDto, Integer, Hash)>

Get count of unseen webhook results with error status

Parameters:

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

    the optional parameters

Returns:

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

    UnseenErrorCountDto data, response status code and response headers



1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1920

def get_webhook_results_unseen_error_count_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhook_results_unseen_error_count ...'
  end
  # resource path
  local_var_path = '/webhooks/results/unseen-count'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'UnseenErrorCountDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_webhook_results_with_http_info(webhook_id, opts = {}) ⇒ Array<(PageWebhookResult, Integer, Hash)>

Get a webhook results for a webhook

Parameters:

  • webhook_id (String)

    ID of webhook to get results for

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Optional page index in list pagination

  • :size (Integer)

    Optional page size in list pagination

  • :sort (String)

    Optional createdAt sort direction ASC or DESC

  • :search_filter (String)

    Optional search filter

  • :since (DateTime)

    Filter by created at after the given timestamp

  • :before (DateTime)

    Filter by created at before the given timestamp

  • :unseen_only (Boolean)

    Filter for unseen exceptions only

  • :result_type (String)

    Filter by result type

  • :event_name (String)

    Filter by event name

  • :min_status_code (Integer)

    Minimum response status

  • :max_status_code (Integer)

    Maximum response status

  • :inbox_id (String)

    Inbox ID

  • :sms_id (String)

    Sms ID

  • :attachment_id (String)

    Attachment ID

  • :email_id (String)

    Email ID

  • :phone_id (String)

    Phone ID

Returns:

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

    PageWebhookResult data, response status code and response headers



1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1774

def get_webhook_results_with_http_info(webhook_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhook_results ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.get_webhook_results"
  end
  allowable_values = ["ASC", "DESC"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  allowable_values = ["BAD_RESPONSE", "EXCEPTION", "SUCCESS", "REDRIVEN"]
  if @api_client.config.client_side_validation && opts[:'result_type'] && !allowable_values.include?(opts[:'result_type'])
    fail ArgumentError, "invalid value for \"result_type\", must be one of #{allowable_values}"
  end
  allowable_values = ["EMAIL_RECEIVED", "NEW_EMAIL", "NEW_CONTACT", "NEW_ATTACHMENT", "EMAIL_OPENED", "EMAIL_READ", "DELIVERY_STATUS", "BOUNCE", "BOUNCE_RECIPIENT", "NEW_SMS"]
  if @api_client.config.client_side_validation && opts[:'event_name'] && !allowable_values.include?(opts[:'event_name'])
    fail ArgumentError, "invalid value for \"event_name\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/webhooks/{webhookId}/results'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'unseenOnly'] = opts[:'unseen_only'] if !opts[:'unseen_only'].nil?
  query_params[:'resultType'] = opts[:'result_type'] if !opts[:'result_type'].nil?
  query_params[:'eventName'] = opts[:'event_name'] if !opts[:'event_name'].nil?
  query_params[:'minStatusCode'] = opts[:'min_status_code'] if !opts[:'min_status_code'].nil?
  query_params[:'maxStatusCode'] = opts[:'max_status_code'] if !opts[:'max_status_code'].nil?
  query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
  query_params[:'smsId'] = opts[:'sms_id'] if !opts[:'sms_id'].nil?
  query_params[:'attachmentId'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?
  query_params[:'emailId'] = opts[:'email_id'] if !opts[:'email_id'].nil?
  query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'PageWebhookResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_webhook_with_http_info(webhook_id, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>

Get a webhook

Parameters:

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

    the optional parameters

Returns:

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

    WebhookDto data, response status code and response headers



1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1622

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

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#get_webhooks(inbox_id, opts = {}) ⇒ Array<WebhookDto>

Get all webhooks for an Inbox

Parameters:

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

    the optional parameters

Returns:



1967
1968
1969
1970
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1967

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

#get_webhooks_with_http_info(inbox_id, opts = {}) ⇒ Array<(Array<WebhookDto>, Integer, Hash)>

Get all webhooks for an Inbox

Parameters:

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

    the optional parameters

Returns:

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

    Array<WebhookDto> data, response status code and response headers



1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 1976

def get_webhooks_with_http_info(inbox_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.get_webhooks ...'
  end
  # verify the required parameter 'inbox_id' is set
  if @api_client.config.client_side_validation && inbox_id.nil?
    fail ArgumentError, "Missing the required parameter 'inbox_id' when calling WebhookControllerApi.get_webhooks"
  end
  # resource path
  local_var_path = '/inboxes/{inboxId}/webhooks'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'Array<WebhookDto>' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#redrive_all_webhook_results(opts = {}) ⇒ WebhookRedriveAllResult

Redrive all webhook results that have failed status Allows you to resend webhook payloads for any recorded webhook result that failed to deliver the payload.

Parameters:

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

    the optional parameters

Returns:



2027
2028
2029
2030
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2027

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

#redrive_all_webhook_results_with_http_info(opts = {}) ⇒ Array<(WebhookRedriveAllResult, Integer, Hash)>

Redrive all webhook results that have failed status Allows you to resend webhook payloads for any recorded webhook result that failed to deliver the payload.

Parameters:

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

    the optional parameters

Returns:

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

    WebhookRedriveAllResult data, response status code and response headers



2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2036

def redrive_all_webhook_results_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.redrive_all_webhook_results ...'
  end
  # resource path
  local_var_path = '/webhooks/results/redrive'

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookRedriveAllResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#redrive_webhook_result(webhook_result_id, opts = {}) ⇒ WebhookRedriveResult

Get a webhook result and try to resend the original webhook payload Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.

Parameters:

  • webhook_result_id (String)

    Webhook Result ID

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

    the optional parameters

Returns:



2084
2085
2086
2087
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2084

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

#redrive_webhook_result_with_http_info(webhook_result_id, opts = {}) ⇒ Array<(WebhookRedriveResult, Integer, Hash)>

Get a webhook result and try to resend the original webhook payload Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.

Parameters:

  • webhook_result_id (String)

    Webhook Result ID

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

    the optional parameters

Returns:

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

    WebhookRedriveResult data, response status code and response headers



2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2094

def redrive_webhook_result_with_http_info(webhook_result_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.redrive_webhook_result ...'
  end
  # verify the required parameter 'webhook_result_id' is set
  if @api_client.config.client_side_validation && webhook_result_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_result_id' when calling WebhookControllerApi.redrive_webhook_result"
  end
  # resource path
  local_var_path = '/webhooks/results/{webhookResultId}/redrive'.sub('{' + 'webhookResultId' + '}', CGI.escape(webhook_result_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(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookRedriveResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#send_test_data(webhook_id, opts = {}) ⇒ WebhookTestResult

Send webhook test data

Parameters:

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

    the optional parameters

Returns:



2145
2146
2147
2148
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2145

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

#send_test_data_with_http_info(webhook_id, opts = {}) ⇒ Array<(WebhookTestResult, Integer, Hash)>

Send webhook test data

Parameters:

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

    the optional parameters

Returns:

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

    WebhookTestResult data, response status code and response headers



2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2154

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

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookTestResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#update_webhook_headers(webhook_id, webhook_headers, opts = {}) ⇒ WebhookDto

Update a webhook request headers

Parameters:

  • webhook_id (String)
  • webhook_headers (WebhookHeaders)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2206
2207
2208
2209
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2206

def update_webhook_headers(webhook_id, webhook_headers, opts = {})
  data, _status_code, _headers = update_webhook_headers_with_http_info(webhook_id, webhook_headers, opts)
  data
end

#update_webhook_headers_with_http_info(webhook_id, webhook_headers, opts = {}) ⇒ Array<(WebhookDto, Integer, Hash)>

Update a webhook request headers

Parameters:

  • webhook_id (String)
  • webhook_headers (WebhookHeaders)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    WebhookDto data, response status code and response headers



2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2216

def update_webhook_headers_with_http_info(webhook_id, webhook_headers, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.update_webhook_headers ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.update_webhook_headers"
  end
  # verify the required parameter 'webhook_headers' is set
  if @api_client.config.client_side_validation && webhook_headers.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_headers' when calling WebhookControllerApi.update_webhook_headers"
  end
  # resource path
  local_var_path = '/webhooks/{webhookId}/headers'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_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(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'WebhookDto' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#verify_webhook_signature(verify_webhook_signature_options, opts = {}) ⇒ VerifyWebhookSignatureResults

Verify a webhook payload signature Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.

Parameters:

Returns:



2274
2275
2276
2277
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2274

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

#verify_webhook_signature_with_http_info(verify_webhook_signature_options, opts = {}) ⇒ Array<(VerifyWebhookSignatureResults, Integer, Hash)>

Verify a webhook payload signature Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.

Parameters:

Returns:



2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2284

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

  # 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(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'VerifyWebhookSignatureResults' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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

#wait_for_webhook_results(webhook_id, expected_count, timeout, opts = {}) ⇒ Array<WebhookResultDto>

Wait for webhook results for a webhook

Parameters:

  • webhook_id (String)

    ID of webhook to get results for

  • expected_count (Integer)

    Expected result count

  • timeout (Integer)

    Max time to wait in milliseconds

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

    the optional parameters

Returns:



2339
2340
2341
2342
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2339

def wait_for_webhook_results(webhook_id, expected_count, timeout, opts = {})
  data, _status_code, _headers = wait_for_webhook_results_with_http_info(webhook_id, expected_count, timeout, opts)
  data
end

#wait_for_webhook_results_with_http_info(webhook_id, expected_count, timeout, opts = {}) ⇒ Array<(Array<WebhookResultDto>, Integer, Hash)>

Wait for webhook results for a webhook

Parameters:

  • webhook_id (String)

    ID of webhook to get results for

  • expected_count (Integer)

    Expected result count

  • timeout (Integer)

    Max time to wait in milliseconds

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

    the optional parameters

Returns:

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

    Array<WebhookResultDto> data, response status code and response headers



2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
# File 'lib/mailslurp_client/api/webhook_controller_api.rb', line 2350

def wait_for_webhook_results_with_http_info(webhook_id, expected_count, timeout, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebhookControllerApi.wait_for_webhook_results ...'
  end
  # verify the required parameter 'webhook_id' is set
  if @api_client.config.client_side_validation && webhook_id.nil?
    fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhookControllerApi.wait_for_webhook_results"
  end
  # verify the required parameter 'expected_count' is set
  if @api_client.config.client_side_validation && expected_count.nil?
    fail ArgumentError, "Missing the required parameter 'expected_count' when calling WebhookControllerApi.wait_for_webhook_results"
  end
  if @api_client.config.client_side_validation && expected_count > 100
    fail ArgumentError, 'invalid value for "expected_count" when calling WebhookControllerApi.wait_for_webhook_results, must be smaller than or equal to 100.'
  end

  # verify the required parameter 'timeout' is set
  if @api_client.config.client_side_validation && timeout.nil?
    fail ArgumentError, "Missing the required parameter 'timeout' when calling WebhookControllerApi.wait_for_webhook_results"
  end
  if @api_client.config.client_side_validation && timeout > 300000
    fail ArgumentError, 'invalid value for "timeout" when calling WebhookControllerApi.wait_for_webhook_results, must be smaller than or equal to 300000.'
  end

  if @api_client.config.client_side_validation && timeout < 1000
    fail ArgumentError, 'invalid value for "timeout" when calling WebhookControllerApi.wait_for_webhook_results, must be greater than or equal to 1000.'
  end

  # resource path
  local_var_path = '/webhooks/{webhookId}/wait'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'expectedCount'] = expected_count
  query_params[:'timeout'] = timeout

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

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

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

  # return_type
  return_type = opts[:return_type] || 'Array<WebhookResultDto>' 

  # auth_names
  auth_names = opts[:auth_names] || ['API_KEY']

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