class MailSlurpClient::WebhookControllerApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/mailslurp_client/api/webhook_controller_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_webhook(inbox_id, webhook_options, opts = {}) click to toggle source

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. @param inbox_id [String] inboxId @param webhook_options [CreateWebhookOptions] webhookOptions @param [Hash] opts the optional parameters @return [WebhookDto]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 28
def create_webhook(inbox_id, webhook_options, opts = {})
  data, _status_code, _headers = create_webhook_with_http_info(inbox_id, webhook_options, opts)
  data
end
create_webhook_with_http_info(inbox_id, webhook_options, opts = {}) click to toggle source

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. @param inbox_id [String] inboxId @param webhook_options [CreateWebhookOptions] webhookOptions @param [Hash] opts the optional parameters @return [Array<(WebhookDto, Integer, Hash)>] WebhookDto data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 39
def create_webhook_with_http_info(inbox_id, 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 'webhook_options' is set
  if @api_client.config.client_side_validation && webhook_options.nil?
    fail ArgumentError, "Missing the required parameter '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(['application/json'])
  # 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_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_webhook(inbox_id, webhook_id, opts = {}) click to toggle source

Delete and disable a Webhook for an Inbox @param inbox_id [String] inboxId @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [nil]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 97
def delete_webhook(inbox_id, webhook_id, opts = {})
  delete_webhook_with_http_info(inbox_id, webhook_id, opts)
  nil
end
delete_webhook_with_http_info(inbox_id, webhook_id, opts = {}) click to toggle source

Delete and disable a Webhook for an Inbox @param inbox_id [String] inboxId @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 107
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_webhook_results(opts = {}) click to toggle source

Get results for all webhooks @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination (default to 0) @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageWebhookResult]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 165
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 = {}) click to toggle source

Get results for all webhooks @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageWebhookResult, Integer, Hash)>] PageWebhookResult data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 179
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
  # resource path
  local_var_path = '/webhooks/results'

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

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

  # 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 = {}) click to toggle source

List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction. @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination (default to 0) @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size for paginated result list. (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'DESC') @return [PageWebhookProjection]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 242
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 = {}) click to toggle source

List Webhooks Paginated List webhooks in paginated form. Allows for page index, page size, and sort direction. @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size for paginated result list. @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageWebhookProjection, Integer, Hash)>] PageWebhookProjection data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 257
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
  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[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

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

  # 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 = {}) click to toggle source

Get paginated webhooks for an Inbox @param inbox_id [String] inboxId @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination (default to 0) @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageWebhookProjection]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 320
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 = {}) click to toggle source

Get paginated webhooks for an Inbox @param inbox_id [String] inboxId @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageWebhookProjection, Integer, Hash)>] PageWebhookProjection data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 335
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[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

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

  # 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_payload(webhook_id, opts = {}) click to toggle source

Get JSON Schema definition for webhook payload @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [JSONSchemaDto]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 396
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 = {}) click to toggle source

Get JSON Schema definition for webhook payload @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [Array<(JSONSchemaDto, Integer, Hash)>] JSONSchemaDto data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 405
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(['application/json'])

  # 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_test_webhook_payload(opts = {}) click to toggle source

Get test webhook payload example. Response content depends on eventName passed. Uses `EMAIL_RECEIVED` as default. @param [Hash] opts the optional parameters @option opts [String] :event_name eventName @return [AbstractWebhookPayload]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 456
def get_test_webhook_payload(opts = {})
  data, _status_code, _headers = get_test_webhook_payload_with_http_info(opts)
  data
end
get_test_webhook_payload_email_opened(opts = {}) click to toggle source

Get webhook test payload for email opened event @param [Hash] opts the optional parameters @return [WebhookEmailOpenedPayload]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 516
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 = {}) click to toggle source

Get webhook test payload for email opened event @param [Hash] opts the optional parameters @return [Array<(WebhookEmailOpenedPayload, Integer, Hash)>] WebhookEmailOpenedPayload data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 524
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(['application/json'])

  # 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 = {}) click to toggle source

Get webhook test payload for email opened event @param [Hash] opts the optional parameters @return [WebhookEmailReadPayload]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 570
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 = {}) click to toggle source

Get webhook test payload for email opened event @param [Hash] opts the optional parameters @return [Array<(WebhookEmailReadPayload, Integer, Hash)>] WebhookEmailReadPayload data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 578
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(['application/json'])

  # 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 = {}) click to toggle source

Get example payload for webhook @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [AbstractWebhookPayload]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 625
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 = {}) click to toggle source

Get example payload for webhook @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [Array<(AbstractWebhookPayload, Integer, Hash)>] AbstractWebhookPayload data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 634
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(['application/json'])

  # 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 = {}) click to toggle source

Get webhook test payload for new attachment event @param [Hash] opts the optional parameters @return [WebhookNewAttachmentPayload]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 684
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 = {}) click to toggle source

Get webhook test payload for new attachment event @param [Hash] opts the optional parameters @return [Array<(WebhookNewAttachmentPayload, Integer, Hash)>] WebhookNewAttachmentPayload data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 692
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(['application/json'])

  # 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 = {}) click to toggle source

Get webhook test payload for new contact event @param [Hash] opts the optional parameters @return [WebhookNewContactPayload]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 738
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 = {}) click to toggle source

Get webhook test payload for new contact event @param [Hash] opts the optional parameters @return [Array<(WebhookNewContactPayload, Integer, Hash)>] WebhookNewContactPayload data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 746
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(['application/json'])

  # 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 = {}) click to toggle source

Get webhook test payload for new email event @param [Hash] opts the optional parameters @return [WebhookNewEmailPayload]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 792
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 = {}) click to toggle source

Get webhook test payload for new email event @param [Hash] opts the optional parameters @return [Array<(WebhookNewEmailPayload, Integer, Hash)>] WebhookNewEmailPayload data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 800
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(['application/json'])

  # 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_with_http_info(opts = {}) click to toggle source

Get test webhook payload example. Response content depends on eventName passed. Uses &#x60;EMAIL_RECEIVED&#x60; as default. @param [Hash] opts the optional parameters @option opts [String] :event_name eventName @return [Array<(AbstractWebhookPayload, Integer, Hash)>] AbstractWebhookPayload data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 465
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"]
  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(['application/json'])

  # 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 = {}) click to toggle source

Get a webhook for an Inbox @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [WebhookDto]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 847
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 = {}) click to toggle source

Get a webhook result for a webhook @param webhook_result_id [String] Webhook Result ID @param [Hash] opts the optional parameters @return [WebhookResultDto]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 907
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 = {}) click to toggle source

Get a webhook result for a webhook @param webhook_result_id [String] Webhook Result ID @param [Hash] opts the optional parameters @return [Array<(WebhookResultDto, Integer, Hash)>] WebhookResultDto data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 916
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(['application/json'])

  # 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 = {}) click to toggle source

Get a webhook results for a webhook @param webhook_id [String] ID of webhook to get results for @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination (default to 0) @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination (default to 20) @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC') @return [PageWebhookResult]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 973
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_with_http_info(webhook_id, opts = {}) click to toggle source

Get a webhook results for a webhook @param webhook_id [String] ID of webhook to get results for @param [Hash] opts the optional parameters @option opts [DateTime] :before Filter by created at before the given timestamp @option opts [Integer] :page Optional page index in list pagination @option opts [String] :search_filter Optional search filter @option opts [DateTime] :since Filter by created at after the given timestamp @option opts [Integer] :size Optional page size in list pagination @option opts [String] :sort Optional createdAt sort direction ASC or DESC @return [Array<(PageWebhookResult, Integer, Hash)>] PageWebhookResult data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 988
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
  # 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[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
  query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

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

  # 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 = {}) click to toggle source

Get a webhook for an Inbox @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [Array<(WebhookDto, Integer, Hash)>] WebhookDto data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 856
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(['application/json'])

  # 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 = {}) click to toggle source

Get all webhooks for an Inbox @param inbox_id [String] inboxId @param [Hash] opts the optional parameters @return [Array<WebhookDto>]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 1049
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 = {}) click to toggle source

Get all webhooks for an Inbox @param inbox_id [String] inboxId @param [Hash] opts the optional parameters @return [Array<(Array<WebhookDto>, Integer, Hash)>] Array<WebhookDto> data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 1058
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(['application/json'])

  # 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_webhook_result(webhook_result_id, opts = {}) click to toggle source

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. @param webhook_result_id [String] Webhook Result ID @param [Hash] opts the optional parameters @return [WebhookRedriveResult]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 1110
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 = {}) click to toggle source

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. @param webhook_result_id [String] Webhook Result ID @param [Hash] opts the optional parameters @return [Array<(WebhookRedriveResult, Integer, Hash)>] WebhookRedriveResult data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 1120
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(['application/json'])

  # 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 = {}) click to toggle source

Send webhook test data @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [WebhookTestResult]

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 1171
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 = {}) click to toggle source

Send webhook test data @param webhook_id [String] webhookId @param [Hash] opts the optional parameters @return [Array<(WebhookTestResult, Integer, Hash)>] WebhookTestResult data, response status code and response headers

# File lib/mailslurp_client/api/webhook_controller_api.rb, line 1180
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(['application/json'])

  # 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