lib/docusign/model/billing_plans.ex

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

defmodule DocuSign.Model.BillingPlans do
  @moduledoc """
  Billing plans
  """

  alias DocuSign.Deserializer
  alias DocuSign.Model.AccountAddress
  alias DocuSign.Model.AccountBillingPlan
  alias DocuSign.Model.BillingEntityInformationResponse
  alias DocuSign.Model.BillingPlan
  alias DocuSign.Model.CreditCardInformation
  alias DocuSign.Model.DirectDebitProcessorInformation
  alias DocuSign.Model.DowngradePlanUpdateResponse
  alias DocuSign.Model.DowngradeRequestInformation
  alias DocuSign.Model.PaymentProcessorInformation
  alias DocuSign.Model.ReferralInformation

  @derive Jason.Encoder
  defstruct [
    :billingAddress,
    :billingAddressIsCreditCardAddress,
    :billingPlan,
    :creditCardInformation,
    :directDebitProcessorInformation,
    :downgradePlanInformation,
    :downgradeRequestInformation,
    :entityInformation,
    :paymentMethod,
    :paymentProcessorInformation,
    :referralInformation,
    :successorPlans,
    :taxExemptId
  ]

  @type t :: %__MODULE__{
          :billingAddress => AccountAddress.t() | nil,
          :billingAddressIsCreditCardAddress => String.t() | nil,
          :billingPlan => AccountBillingPlan.t() | nil,
          :creditCardInformation => CreditCardInformation.t() | nil,
          :directDebitProcessorInformation => DirectDebitProcessorInformation.t() | nil,
          :downgradePlanInformation => DowngradePlanUpdateResponse.t() | nil,
          :downgradeRequestInformation => DowngradeRequestInformation.t() | nil,
          :entityInformation => BillingEntityInformationResponse.t() | nil,
          :paymentMethod => String.t() | nil,
          :paymentProcessorInformation => PaymentProcessorInformation.t() | nil,
          :referralInformation => ReferralInformation.t() | nil,
          :successorPlans => [BillingPlan.t()] | nil,
          :taxExemptId => String.t() | nil
        }

  def decode(value) do
    value
    |> Deserializer.deserialize(:billingAddress, :struct, AccountAddress)
    |> Deserializer.deserialize(:billingPlan, :struct, AccountBillingPlan)
    |> Deserializer.deserialize(
      :creditCardInformation,
      :struct,
      CreditCardInformation
    )
    |> Deserializer.deserialize(
      :directDebitProcessorInformation,
      :struct,
      DirectDebitProcessorInformation
    )
    |> Deserializer.deserialize(
      :downgradePlanInformation,
      :struct,
      DowngradePlanUpdateResponse
    )
    |> Deserializer.deserialize(
      :downgradeRequestInformation,
      :struct,
      DowngradeRequestInformation
    )
    |> Deserializer.deserialize(
      :entityInformation,
      :struct,
      BillingEntityInformationResponse
    )
    |> Deserializer.deserialize(
      :paymentProcessorInformation,
      :struct,
      PaymentProcessorInformation
    )
    |> Deserializer.deserialize(:referralInformation, :struct, ReferralInformation)
    |> Deserializer.deserialize(:successorPlans, :list, BillingPlan)
  end
end