lib/mail_slurp_api/model/create_webhook_options.ex

# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.

defmodule MailSlurpAPI.Model.CreateWebhookOptions do
  @moduledoc """
  Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale.
  """

  @derive [Poison.Encoder]
  defstruct [
    :"url",
    :"basicAuth",
    :"name",
    :"eventName",
    :"includeHeaders"
  ]

  @type t :: %__MODULE__{
    :"url" => String.t,
    :"basicAuth" => BasicAuthOptions | nil,
    :"name" => String.t | nil,
    :"eventName" => String.t | nil,
    :"includeHeaders" => WebhookHeaders | nil
  }
end

defimpl Poison.Decoder, for: MailSlurpAPI.Model.CreateWebhookOptions do
  import MailSlurpAPI.Deserializer
  def decode(value, options) do
    value
    |> deserialize(:"basicAuth", :struct, MailSlurpAPI.Model.BasicAuthOptions, options)
    |> deserialize(:"includeHeaders", :struct, MailSlurpAPI.Model.WebhookHeaders, options)
  end
end