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

defmodule Ory.Model.Message do
  @moduledoc """
  
  """

  @derive Jason.Encoder
  defstruct [
    :body,
    :channel,
    :created_at,
    :dispatches,
    :id,
    :recipient,
    :send_count,
    :status,
    :subject,
    :template_type,
    :type,
    :updated_at
  ]

  @type t :: %__MODULE__{
    :body => String.t,
    :channel => String.t | nil,
    :created_at => DateTime.t,
    :dispatches => [Ory.Model.MessageDispatch.t] | nil,
    :id => String.t,
    :recipient => String.t,
    :send_count => integer(),
    :status => Ory.Model.CourierMessageStatus.t,
    :subject => String.t,
    :template_type => String.t,
    :type => Ory.Model.CourierMessageType.t,
    :updated_at => DateTime.t
  }

  alias Ory.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:created_at, :datetime, nil)
     |> Deserializer.deserialize(:dispatches, :list, Ory.Model.MessageDispatch)
     |> Deserializer.deserialize(:status, :struct, Ory.Model.CourierMessageStatus)
     |> Deserializer.deserialize(:type, :struct, Ory.Model.CourierMessageType)
     |> Deserializer.deserialize(:updated_at, :datetime, nil)
  end
end

