{-# 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 Subscription
module RecurlyClient.Types.Subscription 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.AccountMini
import {-# SOURCE #-} RecurlyClient.Types.CouponRedemptionMini
import {-# SOURCE #-} RecurlyClient.Types.PlanMini
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionAddOn
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionChange
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionRampIntervalResponse
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionShipping
import {-# SOURCE #-} RecurlyClient.Types.TaxInfo
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.Subscription@ in the specification.
data Subscription = Subscription
    { Subscription -> Maybe AccountMini
subscriptionAccount :: (GHC.Maybe.Maybe AccountMini)
    -- ^ account
    , Subscription -> Maybe Object
subscriptionAction_result :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object)
    -- ^ action_result: Action result params to be used in Recurly-JS to complete a payment when using asynchronous payment methods, e.g., Boleto, iDEAL and Sofort.
    , Subscription -> Maybe JsonDateTime
subscriptionActivated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ activated_at
    , Subscription -> Maybe Text
subscriptionActive_invoice_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ active_invoice_id: The invoice ID of the latest invoice created for an active subscription.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , Subscription -> Maybe [SubscriptionAddOn]
subscriptionAdd_ons :: (GHC.Maybe.Maybe [SubscriptionAddOn])
    -- ^ add_ons
    , Subscription -> Maybe Float
subscriptionAdd_ons_total :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ add_ons_total
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Subscription -> Maybe Bool
subscriptionAuto_renew :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ auto_renew: Whether the subscription renews at the end of its term.
    , Subscription -> Maybe JsonDateTime
subscriptionBank_account_authorized_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ bank_account_authorized_at: Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.
    , Subscription -> Maybe Text
subscriptionBilling_info_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ billing_info_id: Billing Info ID.
    , Subscription -> Maybe Text
subscriptionBusiness_entity_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ business_entity_id: The ID of the business entity associated with the subscription. This will be \`null\` if the subscription relies on resolving the business entity during renewal.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , Subscription -> Maybe JsonDateTime
subscriptionCanceled_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ canceled_at
    , Subscription -> Maybe SubscriptionCollection_method
subscriptionCollection_method :: (GHC.Maybe.Maybe SubscriptionCollection_method)
    -- ^ collection_method
    , Subscription -> Maybe JsonDateTime
subscriptionConverted_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ converted_at: When the subscription was converted from a gift card.
    , Subscription -> Maybe [CouponRedemptionMini]
subscriptionCoupon_redemptions :: (GHC.Maybe.Maybe [CouponRedemptionMini])
    -- ^ coupon_redemptions: Returns subscription level coupon redemptions that are tied to this subscription.
    , Subscription -> Maybe JsonDateTime
subscriptionCreated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ created_at
    , Subscription -> Maybe Text
subscriptionCurrency :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ currency: 3-letter ISO 4217 currency code.
    --
    -- Constraints:
    --
    -- * Maximum length of 3
    , Subscription -> Maybe JsonDateTime
subscriptionCurrent_period_ends_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ current_period_ends_at
    , Subscription -> Maybe JsonDateTime
subscriptionCurrent_period_started_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ current_period_started_at
    , Subscription -> Maybe JsonDateTime
subscriptionCurrent_term_ends_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ current_term_ends_at: When the term ends. This is calculated by a plan\'s interval and \`total_billing_cycles\` in a term. Subscription changes with a \`timeframe=renewal\` will be applied on this date.
    , Subscription -> Maybe JsonDateTime
subscriptionCurrent_term_started_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ current_term_started_at: The start date of the term when the first billing period starts. The subscription term is the length of time that a customer will be committed to a subscription. A term can span multiple billing periods.
    , Subscription -> Maybe CustomFields
subscriptionCustom_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.
    , Subscription -> Maybe Text
subscriptionCustomer_notes :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ customer_notes
    , Subscription -> Maybe Text
subscriptionExpiration_reason :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ expiration_reason
    , Subscription -> Maybe JsonDateTime
subscriptionExpires_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ expires_at
    , Subscription -> Maybe Text
subscriptionGateway_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
    , Subscription -> Maybe Text
subscriptionId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ id
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , Subscription -> Maybe Int
subscriptionNet_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
    , Subscription -> Maybe SubscriptionNet_terms_type
subscriptionNet_terms_type :: (GHC.Maybe.Maybe SubscriptionNet_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.
    , Subscription -> Maybe Text
subscriptionObject :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ object
    , Subscription -> Maybe JsonDateTime
subscriptionPaused_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ paused_at: Null unless subscription is paused or will pause at the end of the current billing period.
    , Subscription -> Maybe SubscriptionChange
subscriptionPending_change :: (GHC.Maybe.Maybe SubscriptionChange)
    -- ^ pending_change
    , Subscription -> Maybe PlanMini
subscriptionPlan :: (GHC.Maybe.Maybe PlanMini)
    -- ^ plan: Just the important parts.
    , Subscription -> Maybe Text
subscriptionPo_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
    , Subscription -> Maybe Int
subscriptionQuantity :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ quantity
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Subscription -> Maybe [SubscriptionRampIntervalResponse]
subscriptionRamp_intervals :: (GHC.Maybe.Maybe [SubscriptionRampIntervalResponse])
    -- ^ ramp_intervals: The ramp intervals representing the pricing schedule for the subscription.
    , Subscription -> Maybe Int
subscriptionRemaining_billing_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ remaining_billing_cycles: The remaining billing cycles in the current term.
    , Subscription -> Maybe Int
subscriptionRemaining_pause_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ remaining_pause_cycles: Null unless subscription is paused or will pause at the end of the current billing period.
    , Subscription -> Maybe Int
subscriptionRenewal_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\`.
    , Subscription -> Maybe SubscriptionRevenue_schedule_type
subscriptionRevenue_schedule_type :: (GHC.Maybe.Maybe SubscriptionRevenue_schedule_type)
    -- ^ revenue_schedule_type
    , Subscription -> Maybe SubscriptionShipping
subscriptionShipping :: (GHC.Maybe.Maybe SubscriptionShipping)
    -- ^ shipping
    , Subscription -> Maybe Bool
subscriptionStarted_with_gift :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ started_with_gift: Whether the subscription was started with a gift certificate.
    , Subscription -> Maybe SubscriptionState
subscriptionState :: (GHC.Maybe.Maybe SubscriptionState)
    -- ^ state
    , Subscription -> Maybe Float
subscriptionSubtotal :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ subtotal
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Subscription -> Maybe Float
subscriptionTax :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ tax: Only for merchants using Recurly\'s In-The-Box taxes.
    , Subscription -> Maybe Bool
subscriptionTax_inclusive :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ tax_inclusive: Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
    , Subscription -> Maybe TaxInfo
subscriptionTax_info :: (GHC.Maybe.Maybe TaxInfo)
    -- ^ tax_info: Only for merchants using Recurly\'s In-The-Box taxes.
    , Subscription -> Maybe Text
subscriptionTerms_and_conditions :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ terms_and_conditions
    , Subscription -> Maybe Float
subscriptionTotal :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ total
    , Subscription -> Maybe Int
subscriptionTotal_billing_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ total_billing_cycles: The number of cycles\/billing periods in a term. When \`remaining_billing_cycles=0\`, if \`auto_renew=true\` the subscription will renew and a new term will begin, otherwise the subscription will expire.
    , Subscription -> Maybe JsonDateTime
subscriptionTrial_ends_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ trial_ends_at
    , Subscription -> Maybe JsonDateTime
subscriptionTrial_started_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ trial_started_at
    , Subscription -> Maybe Float
subscriptionUnit_amount :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ unit_amount
    , Subscription -> Maybe JsonDateTime
subscriptionUpdated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ updated_at
    , Subscription -> Maybe Text
subscriptionUuid :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ uuid: The UUID is useful for matching data with the CSV exports and building URLs into Recurly\'s UI.
    --
    -- Constraints:
    --
    -- * Maximum length of 32
    }
    deriving
        ( Int -> Subscription -> ShowS
[Subscription] -> ShowS
Subscription -> String
(Int -> Subscription -> ShowS)
-> (Subscription -> String)
-> ([Subscription] -> ShowS)
-> Show Subscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Subscription -> ShowS
showsPrec :: Int -> Subscription -> ShowS
$cshow :: Subscription -> String
show :: Subscription -> String
$cshowList :: [Subscription] -> ShowS
showList :: [Subscription] -> ShowS
GHC.Show.Show
        , Subscription -> Subscription -> Bool
(Subscription -> Subscription -> Bool)
-> (Subscription -> Subscription -> Bool) -> Eq Subscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Subscription -> Subscription -> Bool
== :: Subscription -> Subscription -> Bool
$c/= :: Subscription -> Subscription -> Bool
/= :: Subscription -> Subscription -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON Subscription where
    toJSON :: Subscription -> Value
toJSON Subscription
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (AccountMini -> [Pair]) -> Maybe AccountMini -> [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]) -> (AccountMini -> Pair) -> AccountMini -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account" Key -> AccountMini -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe AccountMini
subscriptionAccount Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Object -> [Pair]) -> Maybe Object -> [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]) -> (Object -> Pair) -> Object -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"action_result" Key -> Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Object
subscriptionAction_result Subscription
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
"activated_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionActivated_at Subscription
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
"active_invoice_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..=)) (Subscription -> Maybe Text
subscriptionActive_invoice_id Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([SubscriptionAddOn] -> [Pair])
-> Maybe [SubscriptionAddOn]
-> [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])
-> ([SubscriptionAddOn] -> Pair) -> [SubscriptionAddOn] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_ons" Key -> [SubscriptionAddOn] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe [SubscriptionAddOn]
subscriptionAdd_ons Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_ons_total" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionAdd_ons_total Subscription
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
"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..=)) (Subscription -> Maybe Bool
subscriptionAuto_renew Subscription
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
"bank_account_authorized_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionBank_account_authorized_at Subscription
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..=)) (Subscription -> Maybe Text
subscriptionBilling_info_id Subscription
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
"business_entity_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..=)) (Subscription -> Maybe Text
subscriptionBusiness_entity_id Subscription
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
"canceled_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCanceled_at Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionCollection_method -> [Pair])
-> Maybe SubscriptionCollection_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])
-> (SubscriptionCollection_method -> Pair)
-> SubscriptionCollection_method
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionCollection_method -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionCollection_method
subscriptionCollection_method Subscription
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
"converted_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionConverted_at Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([CouponRedemptionMini] -> [Pair])
-> Maybe [CouponRedemptionMini]
-> [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])
-> ([CouponRedemptionMini] -> Pair)
-> [CouponRedemptionMini]
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"coupon_redemptions" Key -> [CouponRedemptionMini] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe [CouponRedemptionMini]
subscriptionCoupon_redemptions Subscription
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
"created_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCreated_at Subscription
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
"currency" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionCurrency Subscription
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
"current_period_ends_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_period_ends_at Subscription
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
"current_period_started_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_period_started_at Subscription
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
"current_term_ends_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_term_ends_at Subscription
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
"current_term_started_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_term_started_at Subscription
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..=)) (Subscription -> Maybe CustomFields
subscriptionCustom_fields Subscription
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..=)) (Subscription -> Maybe Text
subscriptionCustomer_notes Subscription
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
"expiration_reason" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionExpiration_reason Subscription
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
"expires_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionExpires_at Subscription
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..=)) (Subscription -> Maybe Text
subscriptionGateway_code Subscription
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
"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..=)) (Subscription -> Maybe Text
subscriptionId Subscription
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..=)) (Subscription -> Maybe Int
subscriptionNet_terms Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionNet_terms_type -> [Pair])
-> Maybe SubscriptionNet_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])
-> (SubscriptionNet_terms_type -> Pair)
-> SubscriptionNet_terms_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionNet_terms_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionNet_terms_type
subscriptionNet_terms_type Subscription
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
"object" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionObject Subscription
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
"paused_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionPaused_at Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChange -> [Pair])
-> Maybe SubscriptionChange
-> [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])
-> (SubscriptionChange -> Pair) -> SubscriptionChange -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"pending_change" Key -> SubscriptionChange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionChange
subscriptionPending_change Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (PlanMini -> [Pair]) -> Maybe PlanMini -> [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]) -> (PlanMini -> Pair) -> PlanMini -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"plan" Key -> PlanMini -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe PlanMini
subscriptionPlan Subscription
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..=)) (Subscription -> Maybe Text
subscriptionPo_number Subscription
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
"quantity" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Int
subscriptionQuantity Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([SubscriptionRampIntervalResponse] -> [Pair])
-> Maybe [SubscriptionRampIntervalResponse]
-> [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])
-> ([SubscriptionRampIntervalResponse] -> Pair)
-> [SubscriptionRampIntervalResponse]
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"ramp_intervals" Key -> [SubscriptionRampIntervalResponse] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe [SubscriptionRampIntervalResponse]
subscriptionRamp_intervals Subscription
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..=)) (Subscription -> Maybe Int
subscriptionRemaining_billing_cycles Subscription
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_pause_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..=)) (Subscription -> Maybe Int
subscriptionRemaining_pause_cycles Subscription
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..=)) (Subscription -> Maybe Int
subscriptionRenewal_billing_cycles Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionRevenue_schedule_type -> [Pair])
-> Maybe SubscriptionRevenue_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])
-> (SubscriptionRevenue_schedule_type -> Pair)
-> SubscriptionRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionRevenue_schedule_type
subscriptionRevenue_schedule_type Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionShipping -> [Pair])
-> Maybe SubscriptionShipping
-> [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])
-> (SubscriptionShipping -> Pair) -> SubscriptionShipping -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionShipping -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionShipping
subscriptionShipping Subscription
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
"started_with_gift" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Bool
subscriptionStarted_with_gift Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionState -> [Pair])
-> Maybe SubscriptionState
-> [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])
-> (SubscriptionState -> Pair) -> SubscriptionState -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> SubscriptionState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionState
subscriptionState Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"subtotal" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionSubtotal Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionTax Subscription
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..=)) (Subscription -> Maybe Bool
subscriptionTax_inclusive Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (TaxInfo -> [Pair]) -> Maybe TaxInfo -> [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]) -> (TaxInfo -> Pair) -> TaxInfo -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_info" Key -> TaxInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe TaxInfo
subscriptionTax_info Subscription
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..=)) (Subscription -> Maybe Text
subscriptionTerms_and_conditions Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"total" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionTotal Subscription
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
"total_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..=)) (Subscription -> Maybe Int
subscriptionTotal_billing_cycles Subscription
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
"trial_ends_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionTrial_ends_at Subscription
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
"trial_started_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionTrial_started_at Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"unit_amount" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionUnit_amount Subscription
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
"updated_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionUpdated_at Subscription
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
"uuid" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionUuid Subscription
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: Subscription -> Encoding
toEncoding Subscription
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]
-> (AccountMini -> [Series]) -> Maybe AccountMini -> [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])
-> (AccountMini -> Series) -> AccountMini -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account" Key -> AccountMini -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe AccountMini
subscriptionAccount Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Object -> [Series]) -> Maybe Object -> [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]) -> (Object -> Series) -> Object -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"action_result" Key -> Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Object
subscriptionAction_result Subscription
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
"activated_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionActivated_at Subscription
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
"active_invoice_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..=)) (Subscription -> Maybe Text
subscriptionActive_invoice_id Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([SubscriptionAddOn] -> [Series])
-> Maybe [SubscriptionAddOn]
-> [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])
-> ([SubscriptionAddOn] -> Series)
-> [SubscriptionAddOn]
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_ons" Key -> [SubscriptionAddOn] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe [SubscriptionAddOn]
subscriptionAdd_ons Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_ons_total" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionAdd_ons_total Subscription
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
"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..=)) (Subscription -> Maybe Bool
subscriptionAuto_renew Subscription
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
"bank_account_authorized_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionBank_account_authorized_at Subscription
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..=)) (Subscription -> Maybe Text
subscriptionBilling_info_id Subscription
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
"business_entity_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..=)) (Subscription -> Maybe Text
subscriptionBusiness_entity_id Subscription
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
"canceled_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCanceled_at Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionCollection_method -> [Series])
-> Maybe SubscriptionCollection_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])
-> (SubscriptionCollection_method -> Series)
-> SubscriptionCollection_method
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionCollection_method -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionCollection_method
subscriptionCollection_method Subscription
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
"converted_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionConverted_at Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([CouponRedemptionMini] -> [Series])
-> Maybe [CouponRedemptionMini]
-> [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])
-> ([CouponRedemptionMini] -> Series)
-> [CouponRedemptionMini]
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"coupon_redemptions" Key -> [CouponRedemptionMini] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe [CouponRedemptionMini]
subscriptionCoupon_redemptions Subscription
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
"created_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCreated_at Subscription
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
"currency" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionCurrency Subscription
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
"current_period_ends_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_period_ends_at Subscription
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
"current_period_started_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_period_started_at Subscription
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
"current_term_ends_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_term_ends_at Subscription
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
"current_term_started_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionCurrent_term_started_at Subscription
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..=)) (Subscription -> Maybe CustomFields
subscriptionCustom_fields Subscription
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..=)) (Subscription -> Maybe Text
subscriptionCustomer_notes Subscription
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
"expiration_reason" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionExpiration_reason Subscription
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
"expires_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionExpires_at Subscription
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..=)) (Subscription -> Maybe Text
subscriptionGateway_code Subscription
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
"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..=)) (Subscription -> Maybe Text
subscriptionId Subscription
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..=)) (Subscription -> Maybe Int
subscriptionNet_terms Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionNet_terms_type -> [Series])
-> Maybe SubscriptionNet_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])
-> (SubscriptionNet_terms_type -> Series)
-> SubscriptionNet_terms_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionNet_terms_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionNet_terms_type
subscriptionNet_terms_type Subscription
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
"object" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionObject Subscription
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
"paused_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionPaused_at Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChange -> [Series])
-> Maybe SubscriptionChange
-> [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])
-> (SubscriptionChange -> Series) -> SubscriptionChange -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"pending_change" Key -> SubscriptionChange -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionChange
subscriptionPending_change Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (PlanMini -> [Series]) -> Maybe PlanMini -> [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])
-> (PlanMini -> Series) -> PlanMini -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"plan" Key -> PlanMini -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe PlanMini
subscriptionPlan Subscription
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..=)) (Subscription -> Maybe Text
subscriptionPo_number Subscription
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
"quantity" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Int
subscriptionQuantity Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([SubscriptionRampIntervalResponse] -> [Series])
-> Maybe [SubscriptionRampIntervalResponse]
-> [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])
-> ([SubscriptionRampIntervalResponse] -> Series)
-> [SubscriptionRampIntervalResponse]
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"ramp_intervals" Key -> [SubscriptionRampIntervalResponse] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe [SubscriptionRampIntervalResponse]
subscriptionRamp_intervals Subscription
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..=)) (Subscription -> Maybe Int
subscriptionRemaining_billing_cycles Subscription
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_pause_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..=)) (Subscription -> Maybe Int
subscriptionRemaining_pause_cycles Subscription
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..=)) (Subscription -> Maybe Int
subscriptionRenewal_billing_cycles Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionRevenue_schedule_type -> [Series])
-> Maybe SubscriptionRevenue_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])
-> (SubscriptionRevenue_schedule_type -> Series)
-> SubscriptionRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionRevenue_schedule_type
subscriptionRevenue_schedule_type Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionShipping -> [Series])
-> Maybe SubscriptionShipping
-> [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])
-> (SubscriptionShipping -> Series)
-> SubscriptionShipping
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionShipping -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionShipping
subscriptionShipping Subscription
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
"started_with_gift" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Bool
subscriptionStarted_with_gift Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionState -> [Series])
-> Maybe SubscriptionState
-> [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])
-> (SubscriptionState -> Series) -> SubscriptionState -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> SubscriptionState -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe SubscriptionState
subscriptionState Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"subtotal" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionSubtotal Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionTax Subscription
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..=)) (Subscription -> Maybe Bool
subscriptionTax_inclusive Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (TaxInfo -> [Series]) -> Maybe TaxInfo -> [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]) -> (TaxInfo -> Series) -> TaxInfo -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_info" Key -> TaxInfo -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe TaxInfo
subscriptionTax_info Subscription
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..=)) (Subscription -> Maybe Text
subscriptionTerms_and_conditions Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"total" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionTotal Subscription
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
"total_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..=)) (Subscription -> Maybe Int
subscriptionTotal_billing_cycles Subscription
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
"trial_ends_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionTrial_ends_at Subscription
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
"trial_started_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionTrial_started_at Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"unit_amount" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Float
subscriptionUnit_amount Subscription
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
"updated_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe JsonDateTime
subscriptionUpdated_at Subscription
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
"uuid" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Subscription -> Maybe Text
subscriptionUuid Subscription
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON Subscription where
    parseJSON :: Value -> Parser Subscription
parseJSON = String
-> (Object -> Parser Subscription) -> Value -> Parser Subscription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Subscription" (\Object
obj -> ((((((((((((((((((((((((((((((((((((((((((((((((((((((Maybe AccountMini
 -> Maybe Object
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe [SubscriptionAddOn]
 -> Maybe Float
 -> Maybe Bool
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe Text
 -> Maybe JsonDateTime
 -> Maybe SubscriptionCollection_method
 -> Maybe JsonDateTime
 -> Maybe [CouponRedemptionMini]
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe JsonDateTime
 -> Maybe JsonDateTime
 -> Maybe JsonDateTime
 -> Maybe JsonDateTime
 -> Maybe CustomFields
 -> Maybe Text
 -> Maybe Text
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe SubscriptionNet_terms_type
 -> Maybe Text
 -> Maybe JsonDateTime
 -> Maybe SubscriptionChange
 -> Maybe PlanMini
 -> Maybe Text
 -> Maybe Int
 -> Maybe [SubscriptionRampIntervalResponse]
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe SubscriptionRevenue_schedule_type
 -> Maybe SubscriptionShipping
 -> Maybe Bool
 -> Maybe SubscriptionState
 -> Maybe Float
 -> Maybe Float
 -> Maybe Bool
 -> Maybe TaxInfo
 -> Maybe Text
 -> Maybe Float
 -> Maybe Int
 -> Maybe JsonDateTime
 -> Maybe JsonDateTime
 -> Maybe Float
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Subscription)
-> Parser
     (Maybe AccountMini
      -> Maybe Object
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe [SubscriptionAddOn]
      -> Maybe Float
      -> Maybe Bool
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe AccountMini
-> Maybe Object
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe [SubscriptionAddOn]
-> Maybe Float
-> Maybe Bool
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe JsonDateTime
-> Maybe SubscriptionCollection_method
-> Maybe JsonDateTime
-> Maybe [CouponRedemptionMini]
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe SubscriptionNet_terms_type
-> Maybe Text
-> Maybe JsonDateTime
-> Maybe SubscriptionChange
-> Maybe PlanMini
-> Maybe Text
-> Maybe Int
-> Maybe [SubscriptionRampIntervalResponse]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe SubscriptionRevenue_schedule_type
-> Maybe SubscriptionShipping
-> Maybe Bool
-> Maybe SubscriptionState
-> Maybe Float
-> Maybe Float
-> Maybe Bool
-> Maybe TaxInfo
-> Maybe Text
-> Maybe Float
-> Maybe Int
-> Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe Float
-> Maybe JsonDateTime
-> Maybe Text
-> Subscription
Subscription Parser
  (Maybe AccountMini
   -> Maybe Object
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe [SubscriptionAddOn]
   -> Maybe Float
   -> Maybe Bool
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe AccountMini)
-> Parser
     (Maybe Object
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe [SubscriptionAddOn]
      -> Maybe Float
      -> Maybe Bool
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 AccountMini)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"account")) Parser
  (Maybe Object
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe [SubscriptionAddOn]
   -> Maybe Float
   -> Maybe Bool
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Object)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe [SubscriptionAddOn]
      -> Maybe Float
      -> Maybe Bool
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Object)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"action_result")) Parser
  (Maybe JsonDateTime
   -> Maybe Text
   -> Maybe [SubscriptionAddOn]
   -> Maybe Float
   -> Maybe Bool
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe [SubscriptionAddOn]
      -> Maybe Float
      -> Maybe Bool
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"activated_at")) Parser
  (Maybe Text
   -> Maybe [SubscriptionAddOn]
   -> Maybe Float
   -> Maybe Bool
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe [SubscriptionAddOn]
      -> Maybe Float
      -> Maybe Bool
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"active_invoice_id")) Parser
  (Maybe [SubscriptionAddOn]
   -> Maybe Float
   -> Maybe Bool
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe [SubscriptionAddOn])
-> Parser
     (Maybe Float
      -> Maybe Bool
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 [SubscriptionAddOn])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"add_ons")) Parser
  (Maybe Float
   -> Maybe Bool
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Float)
-> Parser
     (Maybe Bool
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"add_ons_total")) Parser
  (Maybe Bool
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Bool)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"bank_account_authorized_at")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe JsonDateTime
      -> Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"business_entity_id")) Parser
  (Maybe JsonDateTime
   -> Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe SubscriptionCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"canceled_at")) Parser
  (Maybe SubscriptionCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe SubscriptionCollection_method)
-> Parser
     (Maybe JsonDateTime
      -> Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionCollection_method)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"collection_method")) Parser
  (Maybe JsonDateTime
   -> Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe [CouponRedemptionMini]
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"converted_at")) Parser
  (Maybe [CouponRedemptionMini]
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe [CouponRedemptionMini])
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 [CouponRedemptionMini])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"coupon_redemptions")) Parser
  (Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"created_at")) Parser
  (Maybe Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"currency")) Parser
  (Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"current_period_ends_at")) Parser
  (Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"current_period_started_at")) Parser
  (Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe JsonDateTime
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"current_term_ends_at")) Parser
  (Maybe JsonDateTime
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"current_term_started_at")) Parser
  (Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe CustomFields)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"expiration_reason")) Parser
  (Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"expires_at")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Text
   -> Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"id")) Parser
  (Maybe Int
   -> Maybe SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Int)
-> Parser
     (Maybe SubscriptionNet_terms_type
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionNet_terms_type
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe SubscriptionNet_terms_type)
-> Parser
     (Maybe Text
      -> Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionNet_terms_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"net_terms_type")) Parser
  (Maybe Text
   -> Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe JsonDateTime
      -> Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"object")) Parser
  (Maybe JsonDateTime
   -> Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe SubscriptionChange
      -> Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"paused_at")) Parser
  (Maybe SubscriptionChange
   -> Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe SubscriptionChange)
-> Parser
     (Maybe PlanMini
      -> Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionChange)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"pending_change")) Parser
  (Maybe PlanMini
   -> Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe PlanMini)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 PlanMini)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"plan")) Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Int)
-> Parser
     (Maybe [SubscriptionRampIntervalResponse]
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"quantity")) Parser
  (Maybe [SubscriptionRampIntervalResponse]
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe [SubscriptionRampIntervalResponse])
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 [SubscriptionRampIntervalResponse])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"ramp_intervals")) Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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_pause_cycles")) Parser
  (Maybe Int
   -> Maybe SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Int)
-> Parser
     (Maybe SubscriptionRevenue_schedule_type
      -> Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionRevenue_schedule_type
   -> Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe SubscriptionRevenue_schedule_type)
-> Parser
     (Maybe SubscriptionShipping
      -> Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
  (Maybe SubscriptionShipping
   -> Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe SubscriptionShipping)
-> Parser
     (Maybe Bool
      -> Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionShipping)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"shipping")) Parser
  (Maybe Bool
   -> Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Bool)
-> Parser
     (Maybe SubscriptionState
      -> Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"started_with_gift")) Parser
  (Maybe SubscriptionState
   -> Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe SubscriptionState)
-> Parser
     (Maybe Float
      -> Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 SubscriptionState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"state")) Parser
  (Maybe Float
   -> Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Float)
-> Parser
     (Maybe Float
      -> Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"subtotal")) Parser
  (Maybe Float
   -> Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Float)
-> Parser
     (Maybe Bool
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax")) Parser
  (Maybe Bool
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Bool)
-> Parser
     (Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe TaxInfo)
-> Parser
     (Maybe Text
      -> Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 TaxInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_info")) Parser
  (Maybe Text
   -> Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Float
      -> Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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")) Parser
  (Maybe Float
   -> Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Float)
-> Parser
     (Maybe Int
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"total")) Parser
  (Maybe Int
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe Int)
-> Parser
     (Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Subscription)
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
"total_billing_cycles")) Parser
  (Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Float -> Maybe JsonDateTime -> Maybe Text -> Subscription)
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
"trial_ends_at")) Parser
  (Maybe JsonDateTime
   -> Maybe Float -> Maybe JsonDateTime -> Maybe Text -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Float -> Maybe JsonDateTime -> Maybe Text -> Subscription)
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
"trial_started_at")) Parser
  (Maybe Float -> Maybe JsonDateTime -> Maybe Text -> Subscription)
-> Parser (Maybe Float)
-> Parser (Maybe JsonDateTime -> Maybe Text -> Subscription)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"unit_amount")) Parser (Maybe JsonDateTime -> Maybe Text -> Subscription)
-> Parser (Maybe JsonDateTime)
-> Parser (Maybe Text -> Subscription)
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
"updated_at")) Parser (Maybe Text -> Subscription)
-> Parser (Maybe Text) -> Parser Subscription
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
"uuid"))

-- | Create a new 'Subscription' with all required fields.
mkSubscription :: Subscription
mkSubscription :: Subscription
mkSubscription =
    Subscription
        { subscriptionAccount :: Maybe AccountMini
subscriptionAccount = Maybe AccountMini
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionAction_result :: Maybe Object
subscriptionAction_result = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionActivated_at :: Maybe JsonDateTime
subscriptionActivated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionActive_invoice_id :: Maybe Text
subscriptionActive_invoice_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionAdd_ons :: Maybe [SubscriptionAddOn]
subscriptionAdd_ons = Maybe [SubscriptionAddOn]
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionAdd_ons_total :: Maybe Float
subscriptionAdd_ons_total = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionAuto_renew :: Maybe Bool
subscriptionAuto_renew = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionBank_account_authorized_at :: Maybe JsonDateTime
subscriptionBank_account_authorized_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionBilling_info_id :: Maybe Text
subscriptionBilling_info_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionBusiness_entity_id :: Maybe Text
subscriptionBusiness_entity_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCanceled_at :: Maybe JsonDateTime
subscriptionCanceled_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCollection_method :: Maybe SubscriptionCollection_method
subscriptionCollection_method = Maybe SubscriptionCollection_method
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionConverted_at :: Maybe JsonDateTime
subscriptionConverted_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCoupon_redemptions :: Maybe [CouponRedemptionMini]
subscriptionCoupon_redemptions = Maybe [CouponRedemptionMini]
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCreated_at :: Maybe JsonDateTime
subscriptionCreated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCurrency :: Maybe Text
subscriptionCurrency = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCurrent_period_ends_at :: Maybe JsonDateTime
subscriptionCurrent_period_ends_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCurrent_period_started_at :: Maybe JsonDateTime
subscriptionCurrent_period_started_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCurrent_term_ends_at :: Maybe JsonDateTime
subscriptionCurrent_term_ends_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCurrent_term_started_at :: Maybe JsonDateTime
subscriptionCurrent_term_started_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCustom_fields :: Maybe CustomFields
subscriptionCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionCustomer_notes :: Maybe Text
subscriptionCustomer_notes = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionExpiration_reason :: Maybe Text
subscriptionExpiration_reason = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionExpires_at :: Maybe JsonDateTime
subscriptionExpires_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionGateway_code :: Maybe Text
subscriptionGateway_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionId :: Maybe Text
subscriptionId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionNet_terms :: Maybe Int
subscriptionNet_terms = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionNet_terms_type :: Maybe SubscriptionNet_terms_type
subscriptionNet_terms_type = Maybe SubscriptionNet_terms_type
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionObject :: Maybe Text
subscriptionObject = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionPaused_at :: Maybe JsonDateTime
subscriptionPaused_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionPending_change :: Maybe SubscriptionChange
subscriptionPending_change = Maybe SubscriptionChange
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionPlan :: Maybe PlanMini
subscriptionPlan = Maybe PlanMini
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionPo_number :: Maybe Text
subscriptionPo_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionQuantity :: Maybe Int
subscriptionQuantity = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionRamp_intervals :: Maybe [SubscriptionRampIntervalResponse]
subscriptionRamp_intervals = Maybe [SubscriptionRampIntervalResponse]
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionRemaining_billing_cycles :: Maybe Int
subscriptionRemaining_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionRemaining_pause_cycles :: Maybe Int
subscriptionRemaining_pause_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionRenewal_billing_cycles :: Maybe Int
subscriptionRenewal_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionRevenue_schedule_type :: Maybe SubscriptionRevenue_schedule_type
subscriptionRevenue_schedule_type = Maybe SubscriptionRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionShipping :: Maybe SubscriptionShipping
subscriptionShipping = Maybe SubscriptionShipping
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionStarted_with_gift :: Maybe Bool
subscriptionStarted_with_gift = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionState :: Maybe SubscriptionState
subscriptionState = Maybe SubscriptionState
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionSubtotal :: Maybe Float
subscriptionSubtotal = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTax :: Maybe Float
subscriptionTax = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTax_inclusive :: Maybe Bool
subscriptionTax_inclusive = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTax_info :: Maybe TaxInfo
subscriptionTax_info = Maybe TaxInfo
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTerms_and_conditions :: Maybe Text
subscriptionTerms_and_conditions = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTotal :: Maybe Float
subscriptionTotal = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTotal_billing_cycles :: Maybe Int
subscriptionTotal_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTrial_ends_at :: Maybe JsonDateTime
subscriptionTrial_ends_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionTrial_started_at :: Maybe JsonDateTime
subscriptionTrial_started_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUnit_amount :: Maybe Float
subscriptionUnit_amount = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUpdated_at :: Maybe JsonDateTime
subscriptionUpdated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionUuid :: Maybe Text
subscriptionUuid = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        }

-- | Defines the enum schema located at @components.schemas.Subscription.properties.collection_method@ in the specification.
data SubscriptionCollection_method
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionCollection_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.
      SubscriptionCollection_methodTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"automatic"@
      SubscriptionCollection_methodEnumAutomatic
    | -- | Represents the JSON value @"manual"@
      SubscriptionCollection_methodEnumManual
    deriving (Int -> SubscriptionCollection_method -> ShowS
[SubscriptionCollection_method] -> ShowS
SubscriptionCollection_method -> String
(Int -> SubscriptionCollection_method -> ShowS)
-> (SubscriptionCollection_method -> String)
-> ([SubscriptionCollection_method] -> ShowS)
-> Show SubscriptionCollection_method
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionCollection_method -> ShowS
showsPrec :: Int -> SubscriptionCollection_method -> ShowS
$cshow :: SubscriptionCollection_method -> String
show :: SubscriptionCollection_method -> String
$cshowList :: [SubscriptionCollection_method] -> ShowS
showList :: [SubscriptionCollection_method] -> ShowS
GHC.Show.Show, SubscriptionCollection_method
-> SubscriptionCollection_method -> Bool
(SubscriptionCollection_method
 -> SubscriptionCollection_method -> Bool)
-> (SubscriptionCollection_method
    -> SubscriptionCollection_method -> Bool)
-> Eq SubscriptionCollection_method
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionCollection_method
-> SubscriptionCollection_method -> Bool
== :: SubscriptionCollection_method
-> SubscriptionCollection_method -> Bool
$c/= :: SubscriptionCollection_method
-> SubscriptionCollection_method -> Bool
/= :: SubscriptionCollection_method
-> SubscriptionCollection_method -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionCollection_method where
    toJSON :: SubscriptionCollection_method -> Value
toJSON (SubscriptionCollection_methodOther Value
val) = Value
val
    toJSON (SubscriptionCollection_methodTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionCollection_method
SubscriptionCollection_methodEnumAutomatic) = Value
"automatic"
    toJSON (SubscriptionCollection_method
SubscriptionCollection_methodEnumManual) = Value
"manual"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionCollection_method where
    parseJSON :: Value -> Parser SubscriptionCollection_method
parseJSON Value
val =
        SubscriptionCollection_method
-> Parser SubscriptionCollection_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" -> SubscriptionCollection_method
SubscriptionCollection_methodEnumAutomatic
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"manual" -> SubscriptionCollection_method
SubscriptionCollection_methodEnumManual
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionCollection_method
SubscriptionCollection_methodOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.Subscription.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 SubscriptionNet_terms_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionNet_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.
      SubscriptionNet_terms_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"net"@
      SubscriptionNet_terms_typeEnumNet
    | -- | Represents the JSON value @"eom"@
      SubscriptionNet_terms_typeEnumEom
    deriving (Int -> SubscriptionNet_terms_type -> ShowS
[SubscriptionNet_terms_type] -> ShowS
SubscriptionNet_terms_type -> String
(Int -> SubscriptionNet_terms_type -> ShowS)
-> (SubscriptionNet_terms_type -> String)
-> ([SubscriptionNet_terms_type] -> ShowS)
-> Show SubscriptionNet_terms_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionNet_terms_type -> ShowS
showsPrec :: Int -> SubscriptionNet_terms_type -> ShowS
$cshow :: SubscriptionNet_terms_type -> String
show :: SubscriptionNet_terms_type -> String
$cshowList :: [SubscriptionNet_terms_type] -> ShowS
showList :: [SubscriptionNet_terms_type] -> ShowS
GHC.Show.Show, SubscriptionNet_terms_type -> SubscriptionNet_terms_type -> Bool
(SubscriptionNet_terms_type -> SubscriptionNet_terms_type -> Bool)
-> (SubscriptionNet_terms_type
    -> SubscriptionNet_terms_type -> Bool)
-> Eq SubscriptionNet_terms_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionNet_terms_type -> SubscriptionNet_terms_type -> Bool
== :: SubscriptionNet_terms_type -> SubscriptionNet_terms_type -> Bool
$c/= :: SubscriptionNet_terms_type -> SubscriptionNet_terms_type -> Bool
/= :: SubscriptionNet_terms_type -> SubscriptionNet_terms_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionNet_terms_type where
    toJSON :: SubscriptionNet_terms_type -> Value
toJSON (SubscriptionNet_terms_typeOther Value
val) = Value
val
    toJSON (SubscriptionNet_terms_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionNet_terms_type
SubscriptionNet_terms_typeEnumNet) = Value
"net"
    toJSON (SubscriptionNet_terms_type
SubscriptionNet_terms_typeEnumEom) = Value
"eom"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionNet_terms_type where
    parseJSON :: Value -> Parser SubscriptionNet_terms_type
parseJSON Value
val =
        SubscriptionNet_terms_type -> Parser SubscriptionNet_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" -> SubscriptionNet_terms_type
SubscriptionNet_terms_typeEnumNet
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"eom" -> SubscriptionNet_terms_type
SubscriptionNet_terms_typeEnumEom
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionNet_terms_type
SubscriptionNet_terms_typeOther Value
val
            )

-- | Defines the enum schema located at @components.schemas.Subscription.properties.revenue_schedule_type@ in the specification.
data SubscriptionRevenue_schedule_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionRevenue_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.
      SubscriptionRevenue_schedule_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"at_range_end"@
      SubscriptionRevenue_schedule_typeEnumAt_range_end
    | -- | Represents the JSON value @"at_range_start"@
      SubscriptionRevenue_schedule_typeEnumAt_range_start
    | -- | Represents the JSON value @"evenly"@
      SubscriptionRevenue_schedule_typeEnumEvenly
    | -- | Represents the JSON value @"never"@
      SubscriptionRevenue_schedule_typeEnumNever
    deriving (Int -> SubscriptionRevenue_schedule_type -> ShowS
[SubscriptionRevenue_schedule_type] -> ShowS
SubscriptionRevenue_schedule_type -> String
(Int -> SubscriptionRevenue_schedule_type -> ShowS)
-> (SubscriptionRevenue_schedule_type -> String)
-> ([SubscriptionRevenue_schedule_type] -> ShowS)
-> Show SubscriptionRevenue_schedule_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionRevenue_schedule_type -> ShowS
showsPrec :: Int -> SubscriptionRevenue_schedule_type -> ShowS
$cshow :: SubscriptionRevenue_schedule_type -> String
show :: SubscriptionRevenue_schedule_type -> String
$cshowList :: [SubscriptionRevenue_schedule_type] -> ShowS
showList :: [SubscriptionRevenue_schedule_type] -> ShowS
GHC.Show.Show, SubscriptionRevenue_schedule_type
-> SubscriptionRevenue_schedule_type -> Bool
(SubscriptionRevenue_schedule_type
 -> SubscriptionRevenue_schedule_type -> Bool)
-> (SubscriptionRevenue_schedule_type
    -> SubscriptionRevenue_schedule_type -> Bool)
-> Eq SubscriptionRevenue_schedule_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionRevenue_schedule_type
-> SubscriptionRevenue_schedule_type -> Bool
== :: SubscriptionRevenue_schedule_type
-> SubscriptionRevenue_schedule_type -> Bool
$c/= :: SubscriptionRevenue_schedule_type
-> SubscriptionRevenue_schedule_type -> Bool
/= :: SubscriptionRevenue_schedule_type
-> SubscriptionRevenue_schedule_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionRevenue_schedule_type where
    toJSON :: SubscriptionRevenue_schedule_type -> Value
toJSON (SubscriptionRevenue_schedule_typeOther Value
val) = Value
val
    toJSON (SubscriptionRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
    toJSON (SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
    toJSON (SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumEvenly) = Value
"evenly"
    toJSON (SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionRevenue_schedule_type where
    parseJSON :: Value -> Parser SubscriptionRevenue_schedule_type
parseJSON Value
val =
        SubscriptionRevenue_schedule_type
-> Parser SubscriptionRevenue_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" -> SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumAt_range_end
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumAt_range_start
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumEvenly
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeEnumNever
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionRevenue_schedule_type
SubscriptionRevenue_schedule_typeOther Value
val
            )

-- | Defines the enum schema located at @components.schemas.Subscription.properties.state@ in the specification.
data SubscriptionState
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionStateOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      SubscriptionStateTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"active"@
      SubscriptionStateEnumActive
    | -- | Represents the JSON value @"canceled"@
      SubscriptionStateEnumCanceled
    | -- | Represents the JSON value @"expired"@
      SubscriptionStateEnumExpired
    | -- | Represents the JSON value @"failed"@
      SubscriptionStateEnumFailed
    | -- | Represents the JSON value @"future"@
      SubscriptionStateEnumFuture
    | -- | Represents the JSON value @"paused"@
      SubscriptionStateEnumPaused
    deriving (Int -> SubscriptionState -> ShowS
[SubscriptionState] -> ShowS
SubscriptionState -> String
(Int -> SubscriptionState -> ShowS)
-> (SubscriptionState -> String)
-> ([SubscriptionState] -> ShowS)
-> Show SubscriptionState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionState -> ShowS
showsPrec :: Int -> SubscriptionState -> ShowS
$cshow :: SubscriptionState -> String
show :: SubscriptionState -> String
$cshowList :: [SubscriptionState] -> ShowS
showList :: [SubscriptionState] -> ShowS
GHC.Show.Show, SubscriptionState -> SubscriptionState -> Bool
(SubscriptionState -> SubscriptionState -> Bool)
-> (SubscriptionState -> SubscriptionState -> Bool)
-> Eq SubscriptionState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionState -> SubscriptionState -> Bool
== :: SubscriptionState -> SubscriptionState -> Bool
$c/= :: SubscriptionState -> SubscriptionState -> Bool
/= :: SubscriptionState -> SubscriptionState -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionState where
    toJSON :: SubscriptionState -> Value
toJSON (SubscriptionStateOther Value
val) = Value
val
    toJSON (SubscriptionStateTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionState
SubscriptionStateEnumActive) = Value
"active"
    toJSON (SubscriptionState
SubscriptionStateEnumCanceled) = Value
"canceled"
    toJSON (SubscriptionState
SubscriptionStateEnumExpired) = Value
"expired"
    toJSON (SubscriptionState
SubscriptionStateEnumFailed) = Value
"failed"
    toJSON (SubscriptionState
SubscriptionStateEnumFuture) = Value
"future"
    toJSON (SubscriptionState
SubscriptionStateEnumPaused) = Value
"paused"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionState where
    parseJSON :: Value -> Parser SubscriptionState
parseJSON Value
val =
        SubscriptionState -> Parser SubscriptionState
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
"active" -> SubscriptionState
SubscriptionStateEnumActive
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"canceled" -> SubscriptionState
SubscriptionStateEnumCanceled
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"expired" -> SubscriptionState
SubscriptionStateEnumExpired
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"failed" -> SubscriptionState
SubscriptionStateEnumFailed
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"future" -> SubscriptionState
SubscriptionStateEnumFuture
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"paused" -> SubscriptionState
SubscriptionStateEnumPaused
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionState
SubscriptionStateOther Value
val
            )