lib/mail_slurp_api/model/match_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.MatchOptions do
  @moduledoc """
  Optional filter for matching emails based on fields. For instance filter results to only include emails whose `SUBJECT` value does `CONTAIN` given match value. An example payload would be `{ matches: [{ field: 'SUBJECT', should: 'CONTAIN', value: 'Welcome' }] }`. You can also pass conditions such as `HAS_ATTACHMENT`. If you wish to extract regex matches inside the email content see the `getEmailContentMatch` method in the EmailController.
  """

  @derive [Poison.Encoder]
  defstruct [
    :"matches",
    :"conditions"
  ]

  @type t :: %__MODULE__{
    :"matches" => [MatchOption] | nil,
    :"conditions" => [ConditionOption] | nil
  }
end

defimpl Poison.Decoder, for: MailSlurpAPI.Model.MatchOptions do
  import MailSlurpAPI.Deserializer
  def decode(value, options) do
    value
    |> deserialize(:"matches", :list, MailSlurpAPI.Model.MatchOption, options)
    |> deserialize(:"conditions", :list, MailSlurpAPI.Model.ConditionOption, options)
  end
end