lib/ory/model/generic_error.ex

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

defmodule Ory.Model.GenericError do
  @moduledoc """
  Error responses are sent when an error (e.g. unauthorized, bad request, ...) occurred.
  """

  @derive [Poison.Encoder]
  defstruct [
    :code,
    :debug,
    :details,
    :error,
    :id,
    :message,
    :reason,
    :request,
    :status
  ]

  @type t :: %__MODULE__{
    :code => integer() | nil,
    :debug => String.t | nil,
    :details => AnyType | nil,
    :error => Ory.Model.GenericErrorContent.t | nil,
    :id => String.t | nil,
    :message => String.t,
    :reason => String.t | nil,
    :request => String.t | nil,
    :status => String.t | nil
  }
end

defimpl Poison.Decoder, for: Ory.Model.GenericError do
  import Ory.Deserializer
  def decode(value, options) do
    value
    |> deserialize(:details, :struct, Ory.Model.AnyType, options)
    |> deserialize(:error, :struct, Ory.Model.GenericErrorContent, options)
  end
end