{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the types generated from the schema SubscriptionUpdate
module RecurlyClient.Types.SubscriptionUpdate where

import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified RecurlyClient.Common
import RecurlyClient.TypeAlias
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionShippingUpdate
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.SubscriptionUpdate@ in the specification.
data SubscriptionUpdate = SubscriptionUpdate
    { SubscriptionUpdate -> Maybe Bool
subscriptionUpdateAuto_renew :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ auto_renew: Whether the subscription renews at the end of its term.
    , SubscriptionUpdate -> Maybe Text
subscriptionUpdateBilling_info_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ billing_info_id: The \`billing_info_id\` is the value that represents a specific billing info for an end customer. When \`billing_info_id\` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. \`billing_info_id\` can ONLY be used for sites utilizing the Wallet feature.
    , SubscriptionUpdate -> Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method :: (GHC.Maybe.Maybe SubscriptionUpdateCollection_method)
    -- ^ collection_method
    , SubscriptionUpdate -> Maybe CustomFields
subscriptionUpdateCustom_fields :: (GHC.Maybe.Maybe CustomFields)
    -- ^ custom_fields: The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    , SubscriptionUpdate -> Maybe Text
subscriptionUpdateCustomer_notes :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ customer_notes: Specify custom notes to add or override Customer Notes. Custom notes will stay with a subscription on all renewals.
    , SubscriptionUpdate -> Maybe Text
subscriptionUpdateGateway_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ gateway_code: If present, this subscription\'s transactions will use the payment gateway with this code.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , SubscriptionUpdate -> Maybe Int
subscriptionUpdateNet_terms :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ net_terms: Integer paired with \`Net Terms Type\` and representing the number
    -- of days past the current date (for \`net\` Net Terms Type) or days after
    -- the last day of the current month (for \`eom\` Net Terms Type) that the
    -- invoice will become past due. For \`manual\` collection method, an additional 24 hours is
    -- added to ensure the customer has the entire last day to make payment before
    -- becoming past due. For example:
    --
    -- If an invoice is due \`net 0\`, it is due \'On Receipt\' and will become past due 24 hours after it\'s created.
    -- If an invoice is due \`net 30\`, it will become past due at 31 days exactly.
    -- If an invoice is due \`eom 30\`, it will become past due 31 days from the last day of the current month.
    --
    -- For \`automatic\` collection method, the additional 24 hours is not added. For example, On-Receipt is due immediately, and \`net 30\` will become due exactly 30 days from invoice generation, at which point Recurly will attempt collection.
    -- When \`eom\` Net Terms Type is passed, the value for \`Net Terms\` is restricted to \`0, 15, 30, 45, 60, or 90\`.
    --
    -- For more information on how net terms work with \`manual\` collection visit our docs page (https:\/\/docs.recurly.com\/docs\/manual-payments\#section-collection-terms)
    -- or visit (https:\/\/docs.recurly.com\/docs\/automatic-invoicing-terms\#section-collection-terms) for information about net terms using \`automatic\` collection.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , SubscriptionUpdate -> Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type :: (GHC.Maybe.Maybe SubscriptionUpdateNet_terms_type)
    -- ^ net_terms_type: Optionally supplied string that may be either \`net\` or \`eom\` (end-of-month).
    -- When \`net\`, an invoice becomes past due the specified number of \`Net Terms\` days from the current date.
    -- When \`eom\` an invoice becomes past due the specified number of \`Net Terms\` days from the last day of the current month.
    , SubscriptionUpdate -> Maybe JsonDateTime
subscriptionUpdateNext_bill_date :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ next_bill_date: If present, this sets the date the subscription\'s next billing period will start (\`current_period_ends_at\`). This can be used to align the subscription’s billing to a specific day of the month. For a subscription in a trial period, this will change when the trial expires. This parameter is useful for postponement of a subscription to change its billing date without proration.
    , SubscriptionUpdate -> Maybe Text
subscriptionUpdatePo_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ po_number: For manual invoicing, this identifies the PO number associated with the subscription.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , SubscriptionUpdate -> Maybe Int
subscriptionUpdateRemaining_billing_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ remaining_billing_cycles: The remaining billing cycles in the current term.
    , SubscriptionUpdate -> Maybe Int
subscriptionUpdateRenewal_billing_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ renewal_billing_cycles: If \`auto_renew=true\`, when a term completes, \`total_billing_cycles\` takes this value as the length of subsequent terms. Defaults to the plan\'s \`total_billing_cycles\`.
    , SubscriptionUpdate -> Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type :: (GHC.Maybe.Maybe SubscriptionUpdateRevenue_schedule_type)
    -- ^ revenue_schedule_type
    , SubscriptionUpdate -> Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping :: (GHC.Maybe.Maybe SubscriptionShippingUpdate)
    -- ^ shipping
    , SubscriptionUpdate -> Maybe Bool
subscriptionUpdateTax_inclusive :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ tax_inclusive: This field is deprecated. Please do not use it.
    , SubscriptionUpdate -> Maybe Text
subscriptionUpdateTerms_and_conditions :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ terms_and_conditions: Specify custom notes to add or override Terms and Conditions. Custom notes will stay with a subscription on all renewals.
    }
    deriving
        ( Int -> SubscriptionUpdate -> ShowS
[SubscriptionUpdate] -> ShowS
SubscriptionUpdate -> String
(Int -> SubscriptionUpdate -> ShowS)
-> (SubscriptionUpdate -> String)
-> ([SubscriptionUpdate] -> ShowS)
-> Show SubscriptionUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdate -> ShowS
showsPrec :: Int -> SubscriptionUpdate -> ShowS
$cshow :: SubscriptionUpdate -> String
show :: SubscriptionUpdate -> String
$cshowList :: [SubscriptionUpdate] -> ShowS
showList :: [SubscriptionUpdate] -> ShowS
GHC.Show.Show
        , SubscriptionUpdate -> SubscriptionUpdate -> Bool
(SubscriptionUpdate -> SubscriptionUpdate -> Bool)
-> (SubscriptionUpdate -> SubscriptionUpdate -> Bool)
-> Eq SubscriptionUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
== :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
$c/= :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
/= :: SubscriptionUpdate -> SubscriptionUpdate -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdate where
    toJSON :: SubscriptionUpdate -> Value
toJSON SubscriptionUpdate
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"auto_renew" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateAuto_renew SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateBilling_info_id SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionUpdateCollection_method -> [Pair])
-> Maybe SubscriptionUpdateCollection_method
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionUpdateCollection_method -> Pair)
-> SubscriptionUpdateCollection_method
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionUpdateCollection_method -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (CustomFields -> [Pair]) -> Maybe CustomFields -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (CustomFields -> Pair) -> CustomFields -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"custom_fields" Key -> CustomFields -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe CustomFields
subscriptionUpdateCustom_fields SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"customer_notes" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateCustomer_notes SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateGateway_code SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateNet_terms SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionUpdateNet_terms_type -> [Pair])
-> Maybe SubscriptionUpdateNet_terms_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionUpdateNet_terms_type -> Pair)
-> SubscriptionUpdateNet_terms_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionUpdateNet_terms_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"next_bill_date" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe JsonDateTime
subscriptionUpdateNext_bill_date SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"po_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdatePo_number SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"remaining_billing_cycles" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRemaining_billing_cycles SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"renewal_billing_cycles" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRenewal_billing_cycles SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionUpdateRevenue_schedule_type -> [Pair])
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionUpdateRevenue_schedule_type -> Pair)
-> SubscriptionUpdateRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionUpdateRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionShippingUpdate -> [Pair])
-> Maybe SubscriptionShippingUpdate
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (SubscriptionShippingUpdate -> Pair)
-> SubscriptionShippingUpdate
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionShippingUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_inclusive" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateTax_inclusive SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"terms_and_conditions" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateTerms_and_conditions SubscriptionUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: SubscriptionUpdate -> Encoding
toEncoding SubscriptionUpdate
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"auto_renew" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateAuto_renew SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateBilling_info_id SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionUpdateCollection_method -> [Series])
-> Maybe SubscriptionUpdateCollection_method
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionUpdateCollection_method -> Series)
-> SubscriptionUpdateCollection_method
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionUpdateCollection_method -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (CustomFields -> [Series]) -> Maybe CustomFields -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (CustomFields -> Series) -> CustomFields -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"custom_fields" Key -> CustomFields -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe CustomFields
subscriptionUpdateCustom_fields SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"customer_notes" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateCustomer_notes SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"gateway_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateGateway_code SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateNet_terms SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionUpdateNet_terms_type -> [Series])
-> Maybe SubscriptionUpdateNet_terms_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionUpdateNet_terms_type -> Series)
-> SubscriptionUpdateNet_terms_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionUpdateNet_terms_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"next_bill_date" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe JsonDateTime
subscriptionUpdateNext_bill_date SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"po_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdatePo_number SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"remaining_billing_cycles" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRemaining_billing_cycles SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"renewal_billing_cycles" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Int
subscriptionUpdateRenewal_billing_cycles SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionUpdateRevenue_schedule_type -> [Series])
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionUpdateRevenue_schedule_type -> Series)
-> SubscriptionUpdateRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionUpdateRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionShippingUpdate -> [Series])
-> Maybe SubscriptionShippingUpdate
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (SubscriptionShippingUpdate -> Series)
-> SubscriptionShippingUpdate
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionShippingUpdate -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_inclusive" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Bool
subscriptionUpdateTax_inclusive SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"terms_and_conditions" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionUpdate -> Maybe Text
subscriptionUpdateTerms_and_conditions SubscriptionUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdate where
    parseJSON :: Value -> Parser SubscriptionUpdate
parseJSON = String
-> (Object -> Parser SubscriptionUpdate)
-> Value
-> Parser SubscriptionUpdate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SubscriptionUpdate" (\Object
obj -> ((((((((((((((((Maybe Bool
 -> Maybe Text
 -> Maybe SubscriptionUpdateCollection_method
 -> Maybe CustomFields
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe SubscriptionUpdateNet_terms_type
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe SubscriptionUpdateRevenue_schedule_type
 -> Maybe SubscriptionShippingUpdate
 -> Maybe Bool
 -> Maybe Text
 -> SubscriptionUpdate)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe SubscriptionUpdateCollection_method
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Bool
-> Maybe Text
-> Maybe SubscriptionUpdateCollection_method
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionUpdateNet_terms_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionUpdateRevenue_schedule_type
-> Maybe SubscriptionShippingUpdate
-> Maybe Bool
-> Maybe Text
-> SubscriptionUpdate
SubscriptionUpdate Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe SubscriptionUpdateCollection_method
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe SubscriptionUpdateCollection_method
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"auto_renew")) Parser
  (Maybe Text
   -> Maybe SubscriptionUpdateCollection_method
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe SubscriptionUpdateCollection_method
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"billing_info_id")) Parser
  (Maybe SubscriptionUpdateCollection_method
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe SubscriptionUpdateCollection_method)
-> Parser
     (Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe SubscriptionUpdateCollection_method)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"collection_method")) Parser
  (Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe CustomFields)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe CustomFields)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"custom_fields")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"customer_notes")) Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"gateway_code")) Parser
  (Maybe Int
   -> Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Int)
-> Parser
     (Maybe SubscriptionUpdateNet_terms_type
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"net_terms")) Parser
  (Maybe SubscriptionUpdateNet_terms_type
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe SubscriptionUpdateNet_terms_type)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe SubscriptionUpdateNet_terms_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"net_terms_type")) Parser
  (Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"next_bill_date")) Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"po_number")) Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"remaining_billing_cycles")) Parser
  (Maybe Int
   -> Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe Int)
-> Parser
     (Maybe SubscriptionUpdateRevenue_schedule_type
      -> Maybe SubscriptionShippingUpdate
      -> Maybe Bool
      -> Maybe Text
      -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"renewal_billing_cycles")) Parser
  (Maybe SubscriptionUpdateRevenue_schedule_type
   -> Maybe SubscriptionShippingUpdate
   -> Maybe Bool
   -> Maybe Text
   -> SubscriptionUpdate)
-> Parser (Maybe SubscriptionUpdateRevenue_schedule_type)
-> Parser
     (Maybe SubscriptionShippingUpdate
      -> Maybe Bool -> Maybe Text -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe SubscriptionUpdateRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
  (Maybe SubscriptionShippingUpdate
   -> Maybe Bool -> Maybe Text -> SubscriptionUpdate)
-> Parser (Maybe SubscriptionShippingUpdate)
-> Parser (Maybe Bool -> Maybe Text -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe SubscriptionShippingUpdate)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"shipping")) Parser (Maybe Bool -> Maybe Text -> SubscriptionUpdate)
-> Parser (Maybe Bool) -> Parser (Maybe Text -> SubscriptionUpdate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_inclusive")) Parser (Maybe Text -> SubscriptionUpdate)
-> Parser (Maybe Text) -> Parser SubscriptionUpdate
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"terms_and_conditions"))

-- | Create a new 'SubscriptionUpdate' with all required fields.
mkSubscriptionUpdate :: SubscriptionUpdate
mkSubscriptionUpdate :: SubscriptionUpdate
mkSubscriptionUpdate =
    SubscriptionUpdate
        { subscriptionUpdateAuto_renew :: Maybe Bool
subscriptionUpdateAuto_renew = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateBilling_info_id :: Maybe Text
subscriptionUpdateBilling_info_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateCollection_method :: Maybe SubscriptionUpdateCollection_method
subscriptionUpdateCollection_method = Maybe SubscriptionUpdateCollection_method
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateCustom_fields :: Maybe CustomFields
subscriptionUpdateCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateCustomer_notes :: Maybe Text
subscriptionUpdateCustomer_notes = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateGateway_code :: Maybe Text
subscriptionUpdateGateway_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateNet_terms :: Maybe Int
subscriptionUpdateNet_terms = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateNet_terms_type :: Maybe SubscriptionUpdateNet_terms_type
subscriptionUpdateNet_terms_type = Maybe SubscriptionUpdateNet_terms_type
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateNext_bill_date :: Maybe JsonDateTime
subscriptionUpdateNext_bill_date = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdatePo_number :: Maybe Text
subscriptionUpdatePo_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateRemaining_billing_cycles :: Maybe Int
subscriptionUpdateRemaining_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateRenewal_billing_cycles :: Maybe Int
subscriptionUpdateRenewal_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateRevenue_schedule_type :: Maybe SubscriptionUpdateRevenue_schedule_type
subscriptionUpdateRevenue_schedule_type = Maybe SubscriptionUpdateRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateShipping :: Maybe SubscriptionShippingUpdate
subscriptionUpdateShipping = Maybe SubscriptionShippingUpdate
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateTax_inclusive :: Maybe Bool
subscriptionUpdateTax_inclusive = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdateTerms_and_conditions :: Maybe Text
subscriptionUpdateTerms_and_conditions = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        }

-- | Defines the enum schema located at @components.schemas.SubscriptionUpdate.properties.collection_method@ in the specification.
data SubscriptionUpdateCollection_method
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionUpdateCollection_methodOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      SubscriptionUpdateCollection_methodTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"automatic"@
      SubscriptionUpdateCollection_methodEnumAutomatic
    | -- | Represents the JSON value @"manual"@
      SubscriptionUpdateCollection_methodEnumManual
    deriving (Int -> SubscriptionUpdateCollection_method -> ShowS
[SubscriptionUpdateCollection_method] -> ShowS
SubscriptionUpdateCollection_method -> String
(Int -> SubscriptionUpdateCollection_method -> ShowS)
-> (SubscriptionUpdateCollection_method -> String)
-> ([SubscriptionUpdateCollection_method] -> ShowS)
-> Show SubscriptionUpdateCollection_method
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdateCollection_method -> ShowS
showsPrec :: Int -> SubscriptionUpdateCollection_method -> ShowS
$cshow :: SubscriptionUpdateCollection_method -> String
show :: SubscriptionUpdateCollection_method -> String
$cshowList :: [SubscriptionUpdateCollection_method] -> ShowS
showList :: [SubscriptionUpdateCollection_method] -> ShowS
GHC.Show.Show, SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
(SubscriptionUpdateCollection_method
 -> SubscriptionUpdateCollection_method -> Bool)
-> (SubscriptionUpdateCollection_method
    -> SubscriptionUpdateCollection_method -> Bool)
-> Eq SubscriptionUpdateCollection_method
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
== :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
$c/= :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
/= :: SubscriptionUpdateCollection_method
-> SubscriptionUpdateCollection_method -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdateCollection_method where
    toJSON :: SubscriptionUpdateCollection_method -> Value
toJSON (SubscriptionUpdateCollection_methodOther Value
val) = Value
val
    toJSON (SubscriptionUpdateCollection_methodTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumAutomatic) = Value
"automatic"
    toJSON (SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumManual) = Value
"manual"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdateCollection_method where
    parseJSON :: Value -> Parser SubscriptionUpdateCollection_method
parseJSON Value
val =
        SubscriptionUpdateCollection_method
-> Parser SubscriptionUpdateCollection_method
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"automatic" -> SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumAutomatic
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"manual" -> SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodEnumManual
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionUpdateCollection_method
SubscriptionUpdateCollection_methodOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.SubscriptionUpdate.properties.net_terms_type@ in the specification.

Optionally supplied string that may be either \`net\` or \`eom\` (end-of-month).
When \`net\`, an invoice becomes past due the specified number of \`Net Terms\` days from the current date.
When \`eom\` an invoice becomes past due the specified number of \`Net Terms\` days from the last day of the current month.
-}
data SubscriptionUpdateNet_terms_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionUpdateNet_terms_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      SubscriptionUpdateNet_terms_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"net"@
      SubscriptionUpdateNet_terms_typeEnumNet
    | -- | Represents the JSON value @"eom"@
      SubscriptionUpdateNet_terms_typeEnumEom
    deriving (Int -> SubscriptionUpdateNet_terms_type -> ShowS
[SubscriptionUpdateNet_terms_type] -> ShowS
SubscriptionUpdateNet_terms_type -> String
(Int -> SubscriptionUpdateNet_terms_type -> ShowS)
-> (SubscriptionUpdateNet_terms_type -> String)
-> ([SubscriptionUpdateNet_terms_type] -> ShowS)
-> Show SubscriptionUpdateNet_terms_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdateNet_terms_type -> ShowS
showsPrec :: Int -> SubscriptionUpdateNet_terms_type -> ShowS
$cshow :: SubscriptionUpdateNet_terms_type -> String
show :: SubscriptionUpdateNet_terms_type -> String
$cshowList :: [SubscriptionUpdateNet_terms_type] -> ShowS
showList :: [SubscriptionUpdateNet_terms_type] -> ShowS
GHC.Show.Show, SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
(SubscriptionUpdateNet_terms_type
 -> SubscriptionUpdateNet_terms_type -> Bool)
-> (SubscriptionUpdateNet_terms_type
    -> SubscriptionUpdateNet_terms_type -> Bool)
-> Eq SubscriptionUpdateNet_terms_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
== :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
$c/= :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
/= :: SubscriptionUpdateNet_terms_type
-> SubscriptionUpdateNet_terms_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdateNet_terms_type where
    toJSON :: SubscriptionUpdateNet_terms_type -> Value
toJSON (SubscriptionUpdateNet_terms_typeOther Value
val) = Value
val
    toJSON (SubscriptionUpdateNet_terms_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumNet) = Value
"net"
    toJSON (SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumEom) = Value
"eom"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdateNet_terms_type where
    parseJSON :: Value -> Parser SubscriptionUpdateNet_terms_type
parseJSON Value
val =
        SubscriptionUpdateNet_terms_type
-> Parser SubscriptionUpdateNet_terms_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"net" -> SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumNet
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"eom" -> SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeEnumEom
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionUpdateNet_terms_type
SubscriptionUpdateNet_terms_typeOther Value
val
            )

-- | Defines the enum schema located at @components.schemas.SubscriptionUpdate.properties.revenue_schedule_type@ in the specification.
data SubscriptionUpdateRevenue_schedule_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionUpdateRevenue_schedule_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      SubscriptionUpdateRevenue_schedule_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"at_range_end"@
      SubscriptionUpdateRevenue_schedule_typeEnumAt_range_end
    | -- | Represents the JSON value @"at_range_start"@
      SubscriptionUpdateRevenue_schedule_typeEnumAt_range_start
    | -- | Represents the JSON value @"evenly"@
      SubscriptionUpdateRevenue_schedule_typeEnumEvenly
    | -- | Represents the JSON value @"never"@
      SubscriptionUpdateRevenue_schedule_typeEnumNever
    deriving (Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS
[SubscriptionUpdateRevenue_schedule_type] -> ShowS
SubscriptionUpdateRevenue_schedule_type -> String
(Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS)
-> (SubscriptionUpdateRevenue_schedule_type -> String)
-> ([SubscriptionUpdateRevenue_schedule_type] -> ShowS)
-> Show SubscriptionUpdateRevenue_schedule_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS
showsPrec :: Int -> SubscriptionUpdateRevenue_schedule_type -> ShowS
$cshow :: SubscriptionUpdateRevenue_schedule_type -> String
show :: SubscriptionUpdateRevenue_schedule_type -> String
$cshowList :: [SubscriptionUpdateRevenue_schedule_type] -> ShowS
showList :: [SubscriptionUpdateRevenue_schedule_type] -> ShowS
GHC.Show.Show, SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
(SubscriptionUpdateRevenue_schedule_type
 -> SubscriptionUpdateRevenue_schedule_type -> Bool)
-> (SubscriptionUpdateRevenue_schedule_type
    -> SubscriptionUpdateRevenue_schedule_type -> Bool)
-> Eq SubscriptionUpdateRevenue_schedule_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
== :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
$c/= :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
/= :: SubscriptionUpdateRevenue_schedule_type
-> SubscriptionUpdateRevenue_schedule_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionUpdateRevenue_schedule_type where
    toJSON :: SubscriptionUpdateRevenue_schedule_type -> Value
toJSON (SubscriptionUpdateRevenue_schedule_typeOther Value
val) = Value
val
    toJSON (SubscriptionUpdateRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
    toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
    toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumEvenly) = Value
"evenly"
    toJSON (SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionUpdateRevenue_schedule_type where
    parseJSON :: Value -> Parser SubscriptionUpdateRevenue_schedule_type
parseJSON Value
val =
        SubscriptionUpdateRevenue_schedule_type
-> Parser SubscriptionUpdateRevenue_schedule_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_end" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_end
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumAt_range_start
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumEvenly
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeEnumNever
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionUpdateRevenue_schedule_type
SubscriptionUpdateRevenue_schedule_typeOther Value
val
            )