# 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.Subscription do
  @moduledoc """
  
  """

  @derive Jason.Encoder
  defstruct [
    :created_at,
    :currency,
    :current_interval,
    :current_plan,
    :current_plan_details,
    :customer_id,
    :id,
    :interval_changes_to,
    :ongoing_stripe_checkout_id,
    :payed_until,
    :plan_changes_at,
    :plan_changes_to,
    :status,
    :stripe_checkout_expires_at,
    :updated_at
  ]

  @type t :: %__MODULE__{
    :created_at => DateTime.t,
    :currency => String.t,
    :current_interval => String.t,
    :current_plan => String.t,
    :current_plan_details => Ory.Model.PlanDetails.t | nil,
    :customer_id => String.t,
    :id => String.t,
    :interval_changes_to => String.t | nil,
    :ongoing_stripe_checkout_id => String.t | nil,
    :payed_until => DateTime.t,
    :plan_changes_at => DateTime.t | nil,
    :plan_changes_to => String.t | nil,
    :status => String.t,
    :stripe_checkout_expires_at => DateTime.t | nil,
    :updated_at => DateTime.t
  }

  alias Ory.Deserializer

  def decode(value) do
    value
     |> Deserializer.deserialize(:created_at, :datetime, nil)
     |> Deserializer.deserialize(:current_plan_details, :struct, Ory.Model.PlanDetails)
     |> Deserializer.deserialize(:payed_until, :datetime, nil)
     |> Deserializer.deserialize(:plan_changes_at, :datetime, nil)
     |> Deserializer.deserialize(:stripe_checkout_expires_at, :datetime, nil)
     |> Deserializer.deserialize(:updated_at, :datetime, nil)
  end
end

