# 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.LoginFlow do
  @moduledoc """
  This object represents a login flow. A login flow is initiated at the \"Initiate Login API / Browser Flow\" endpoint by a client.  Once a login flow is completed successfully, a session cookie or session token will be issued.
  """

  @derive Jason.Encoder
  defstruct [
    :active,
    :created_at,
    :expires_at,
    :id,
    :identity_schema,
    :issued_at,
    :oauth2_login_challenge,
    :oauth2_login_request,
    :organization_id,
    :refresh,
    :request_url,
    :requested_aal,
    :return_to,
    :session_token_exchange_code,
    :state,
    :transient_payload,
    :type,
    :ui,
    :updated_at
  ]

  @type t :: %__MODULE__{
    :active => String.t | nil,
    :created_at => DateTime.t | nil,
    :expires_at => DateTime.t,
    :id => String.t,
    :identity_schema => String.t | nil,
    :issued_at => DateTime.t,
    :oauth2_login_challenge => String.t | nil,
    :oauth2_login_request => Ory.Model.OAuth2LoginRequest.t | nil,
    :organization_id => String.t | nil,
    :refresh => boolean() | nil,
    :request_url => String.t,
    :requested_aal => Ory.Model.AuthenticatorAssuranceLevel.t | nil,
    :return_to => String.t | nil,
    :session_token_exchange_code => String.t | nil,
    :state => any() | nil,
    :transient_payload => map() | nil,
    :type => String.t,
    :ui => Ory.Model.UiContainer.t,
    :updated_at => DateTime.t | nil
  }

  alias Ory.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:created_at, :datetime, nil)
     |> Deserializer.deserialize(:expires_at, :datetime, nil)
     |> Deserializer.deserialize(:issued_at, :datetime, nil)
     |> Deserializer.deserialize(:oauth2_login_request, :struct, Ory.Model.OAuth2LoginRequest)
     |> Deserializer.deserialize(:requested_aal, :struct, Ory.Model.AuthenticatorAssuranceLevel)
     |> Deserializer.deserialize(:ui, :struct, Ory.Model.UiContainer)
     |> Deserializer.deserialize(:updated_at, :datetime, nil)
  end
end

