{-# 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 SubscriptionChangeCreate
module RecurlyClient.Types.SubscriptionChangeCreate 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.ProrationSettings
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionAddOnUpdate
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionChangeBillingInfoCreate
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionChangeShippingCreate
import {-# SOURCE #-} RecurlyClient.Types.SubscriptionRampInterval
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.SubscriptionChangeCreate@ in the specification.
data SubscriptionChangeCreate = SubscriptionChangeCreate
    { SubscriptionChangeCreate -> Maybe [SubscriptionAddOnUpdate]
subscriptionChangeCreateAdd_ons :: (GHC.Maybe.Maybe [SubscriptionAddOnUpdate])
    -- ^ add_ons: If you provide a value for this field it will replace any
    -- existing add-ons. So, when adding or modifying an add-on, you need to
    -- include the existing subscription add-ons. Unchanged add-ons can be included
    -- just using the subscription add-on\'\'s ID: \`{\"id\": \"abc123\"}\`. If this
    -- value is omitted your existing add-ons will be unaffected. To remove all
    -- existing add-ons, this value should be an empty array.\'
    --
    -- If a subscription add-on\'s \`code\` is supplied without the \`id\`,
    -- \`{\"code\": \"def456\"}\`, the subscription add-on attributes will be set to the
    -- current values of the plan add-on unless provided in the request.
    --
    -- - If an \`id\` is passed, any attributes not passed in will pull from the
    --   existing subscription add-on
    -- - If a \`code\` is passed, any attributes not passed in will pull from the
    --   current values of the plan add-on
    -- - Attributes passed in as part of the request will override either of the
    --   above scenarios
    , SubscriptionChangeCreate
-> Maybe SubscriptionChangeBillingInfoCreate
subscriptionChangeCreateBilling_info :: (GHC.Maybe.Maybe SubscriptionChangeBillingInfoCreate)
    -- ^ billing_info
    , SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreateBusiness_entity_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ business_entity_code: The \`business_entity_code\` is the value that represents a specific business entity for an end customer. When \`business_entity_code\` is used to assign a business entity to the subscription, all future billing events for the subscription will bill to the specified business entity. Available when the \`Multiple Business Entities\` feature is enabled. If both \`business_entity_id\` and \`business_entity_code\` are present, \`business_entity_id\` will be used. Only allowed if the \`timeframe\` is not \`now\`.
    , SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreateBusiness_entity_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ business_entity_id: The \`business_entity_id\` is the value that represents a specific business entity for an end customer. When \`business_entity_id\` is used to assign a business entity to the subscription, all future billing events for the subscription will bill to the specified business entity. Available when the \`Multiple Business Entities\` feature is enabled. If both \`business_entity_id\` and \`business_entity_code\` are present, \`business_entity_id\` will be used. Only allowed if the \`timeframe\` is not \`now\`.
    , SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateCollection_method
subscriptionChangeCreateCollection_method :: (GHC.Maybe.Maybe SubscriptionChangeCreateCollection_method)
    -- ^ collection_method
    , SubscriptionChangeCreate -> Maybe [Text]
subscriptionChangeCreateCoupon_codes :: (GHC.Maybe.Maybe [Data.Text.Internal.Text])
    -- ^ coupon_codes: A list of coupon_codes to be redeemed on the subscription during the change. Only allowed if timeframe is now and you change something about the subscription that creates an invoice.
    , SubscriptionChangeCreate -> Maybe CustomFields
subscriptionChangeCreateCustom_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.
    , SubscriptionChangeCreate -> Maybe Int
subscriptionChangeCreateNet_terms :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ net_terms: Integer normally 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. During a subscription
    -- change, it\'s not necessary to provide both the \`Net Terms Type\` and \`Net Terms\` parameters.
    --
    -- 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
    , SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateNet_terms_type
subscriptionChangeCreateNet_terms_type :: (GHC.Maybe.Maybe SubscriptionChangeCreateNet_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.
    , SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePlan_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ plan_code: If you want to change to a new plan, you can provide the plan\'s code or id. If both are provided the \`plan_id\` will be used.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePlan_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ plan_id: If you want to change to a new plan, you can provide the plan\'s code or id. If both are provided the \`plan_id\` will be used.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePo_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
    , SubscriptionChangeCreate -> Maybe ProrationSettings
subscriptionChangeCreateProration_settings :: (GHC.Maybe.Maybe ProrationSettings)
    -- ^ proration_settings: Allows you to control how any resulting charges and credits will be calculated and prorated.
    , SubscriptionChangeCreate -> Maybe Int
subscriptionChangeCreateQuantity :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ quantity: Optionally override the default quantity of 1.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , SubscriptionChangeCreate -> Maybe [SubscriptionRampInterval]
subscriptionChangeCreateRamp_intervals :: (GHC.Maybe.Maybe [SubscriptionRampInterval])
    -- ^ ramp_intervals: The new set of ramp intervals for the subscription.
    , SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateRevenue_schedule_type
subscriptionChangeCreateRevenue_schedule_type :: (GHC.Maybe.Maybe SubscriptionChangeCreateRevenue_schedule_type)
    -- ^ revenue_schedule_type
    , SubscriptionChangeCreate -> Maybe SubscriptionChangeShippingCreate
subscriptionChangeCreateShipping :: (GHC.Maybe.Maybe SubscriptionChangeShippingCreate)
    -- ^ shipping: Shipping addresses are tied to a customer\'s account. Each account can have up to 20 different shipping addresses, and if you have enabled multiple subscriptions per account, you can associate different shipping addresses to each subscription.
    , SubscriptionChangeCreate -> Maybe Bool
subscriptionChangeCreateTax_inclusive :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ tax_inclusive: This field is deprecated. Please do not use it.
    , SubscriptionChangeCreate -> Maybe SubscriptionChangeCreateTimeframe
subscriptionChangeCreateTimeframe :: (GHC.Maybe.Maybe SubscriptionChangeCreateTimeframe)
    -- ^ timeframe: The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you\'re performing an upgrade, you will want the change to occur immediately (now). If you\'re performing a downgrade, you should set the timeframe to \`term_end\` or \`bill_date\` so the change takes effect at a scheduled billing date. The \`renewal\` timeframe option is accepted as an alias for \`term_end\`.
    , SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateTransaction_type
subscriptionChangeCreateTransaction_type :: (GHC.Maybe.Maybe SubscriptionChangeCreateTransaction_type)
    -- ^ transaction_type: An optional type designation for the payment gateway transaction created by this request. Supports \'moto\' value, which is the acronym for mail order and telephone transactions.
    , SubscriptionChangeCreate -> Maybe Float
subscriptionChangeCreateUnit_amount :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ unit_amount: Optionally, sets custom pricing for the subscription, overriding the plan\'s default unit amount. The subscription\'s current currency will be used.
    --
    -- Constraints:
    --
    -- * Maxium  of 1000000.0
    -- * Minimum  of 0.0
    }
    deriving
        ( Int -> SubscriptionChangeCreate -> ShowS
[SubscriptionChangeCreate] -> ShowS
SubscriptionChangeCreate -> String
(Int -> SubscriptionChangeCreate -> ShowS)
-> (SubscriptionChangeCreate -> String)
-> ([SubscriptionChangeCreate] -> ShowS)
-> Show SubscriptionChangeCreate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionChangeCreate -> ShowS
showsPrec :: Int -> SubscriptionChangeCreate -> ShowS
$cshow :: SubscriptionChangeCreate -> String
show :: SubscriptionChangeCreate -> String
$cshowList :: [SubscriptionChangeCreate] -> ShowS
showList :: [SubscriptionChangeCreate] -> ShowS
GHC.Show.Show
        , SubscriptionChangeCreate -> SubscriptionChangeCreate -> Bool
(SubscriptionChangeCreate -> SubscriptionChangeCreate -> Bool)
-> (SubscriptionChangeCreate -> SubscriptionChangeCreate -> Bool)
-> Eq SubscriptionChangeCreate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionChangeCreate -> SubscriptionChangeCreate -> Bool
== :: SubscriptionChangeCreate -> SubscriptionChangeCreate -> Bool
$c/= :: SubscriptionChangeCreate -> SubscriptionChangeCreate -> Bool
/= :: SubscriptionChangeCreate -> SubscriptionChangeCreate -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionChangeCreate where
    toJSON :: SubscriptionChangeCreate -> Value
toJSON SubscriptionChangeCreate
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair]
-> ([SubscriptionAddOnUpdate] -> [Pair])
-> Maybe [SubscriptionAddOnUpdate]
-> [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])
-> ([SubscriptionAddOnUpdate] -> Pair)
-> [SubscriptionAddOnUpdate]
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_ons" Key -> [SubscriptionAddOnUpdate] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe [SubscriptionAddOnUpdate]
subscriptionChangeCreateAdd_ons SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChangeBillingInfoCreate -> [Pair])
-> Maybe SubscriptionChangeBillingInfoCreate
-> [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])
-> (SubscriptionChangeBillingInfoCreate -> Pair)
-> SubscriptionChangeBillingInfoCreate
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info" Key -> SubscriptionChangeBillingInfoCreate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeBillingInfoCreate
subscriptionChangeCreateBilling_info SubscriptionChangeCreate
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_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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreateBusiness_entity_code SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreateBusiness_entity_id SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChangeCreateCollection_method -> [Pair])
-> Maybe SubscriptionChangeCreateCollection_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])
-> (SubscriptionChangeCreateCollection_method -> Pair)
-> SubscriptionChangeCreateCollection_method
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionChangeCreateCollection_method -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateCollection_method
subscriptionChangeCreateCollection_method SubscriptionChangeCreate
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
"coupon_codes" Key -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe [Text]
subscriptionChangeCreateCoupon_codes SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe CustomFields
subscriptionChangeCreateCustom_fields SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Int
subscriptionChangeCreateNet_terms SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChangeCreateNet_terms_type -> [Pair])
-> Maybe SubscriptionChangeCreateNet_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])
-> (SubscriptionChangeCreateNet_terms_type -> Pair)
-> SubscriptionChangeCreateNet_terms_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionChangeCreateNet_terms_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateNet_terms_type
subscriptionChangeCreateNet_terms_type SubscriptionChangeCreate
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
"plan_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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePlan_code SubscriptionChangeCreate
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
"plan_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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePlan_id SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePo_number SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (ProrationSettings -> [Pair])
-> Maybe ProrationSettings
-> [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])
-> (ProrationSettings -> Pair) -> ProrationSettings -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"proration_settings" Key -> ProrationSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe ProrationSettings
subscriptionChangeCreateProration_settings SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Int
subscriptionChangeCreateQuantity SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([SubscriptionRampInterval] -> [Pair])
-> Maybe [SubscriptionRampInterval]
-> [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])
-> ([SubscriptionRampInterval] -> Pair)
-> [SubscriptionRampInterval]
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"ramp_intervals" Key -> [SubscriptionRampInterval] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe [SubscriptionRampInterval]
subscriptionChangeCreateRamp_intervals SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChangeCreateRevenue_schedule_type -> [Pair])
-> Maybe SubscriptionChangeCreateRevenue_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])
-> (SubscriptionChangeCreateRevenue_schedule_type -> Pair)
-> SubscriptionChangeCreateRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionChangeCreateRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateRevenue_schedule_type
subscriptionChangeCreateRevenue_schedule_type SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChangeShippingCreate -> [Pair])
-> Maybe SubscriptionChangeShippingCreate
-> [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])
-> (SubscriptionChangeShippingCreate -> Pair)
-> SubscriptionChangeShippingCreate
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionChangeShippingCreate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe SubscriptionChangeShippingCreate
subscriptionChangeCreateShipping SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Bool
subscriptionChangeCreateTax_inclusive SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChangeCreateTimeframe -> [Pair])
-> Maybe SubscriptionChangeCreateTimeframe
-> [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])
-> (SubscriptionChangeCreateTimeframe -> Pair)
-> SubscriptionChangeCreateTimeframe
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"timeframe" Key -> SubscriptionChangeCreateTimeframe -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe SubscriptionChangeCreateTimeframe
subscriptionChangeCreateTimeframe SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (SubscriptionChangeCreateTransaction_type -> [Pair])
-> Maybe SubscriptionChangeCreateTransaction_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])
-> (SubscriptionChangeCreateTransaction_type -> Pair)
-> SubscriptionChangeCreateTransaction_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transaction_type" Key -> SubscriptionChangeCreateTransaction_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateTransaction_type
subscriptionChangeCreateTransaction_type SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Float
subscriptionChangeCreateUnit_amount SubscriptionChangeCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: SubscriptionChangeCreate -> Encoding
toEncoding SubscriptionChangeCreate
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]
-> ([SubscriptionAddOnUpdate] -> [Series])
-> Maybe [SubscriptionAddOnUpdate]
-> [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])
-> ([SubscriptionAddOnUpdate] -> Series)
-> [SubscriptionAddOnUpdate]
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"add_ons" Key -> [SubscriptionAddOnUpdate] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe [SubscriptionAddOnUpdate]
subscriptionChangeCreateAdd_ons SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChangeBillingInfoCreate -> [Series])
-> Maybe SubscriptionChangeBillingInfoCreate
-> [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])
-> (SubscriptionChangeBillingInfoCreate -> Series)
-> SubscriptionChangeBillingInfoCreate
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info" Key -> SubscriptionChangeBillingInfoCreate -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeBillingInfoCreate
subscriptionChangeCreateBilling_info SubscriptionChangeCreate
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_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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreateBusiness_entity_code SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreateBusiness_entity_id SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChangeCreateCollection_method -> [Series])
-> Maybe SubscriptionChangeCreateCollection_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])
-> (SubscriptionChangeCreateCollection_method -> Series)
-> SubscriptionChangeCreateCollection_method
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> SubscriptionChangeCreateCollection_method -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateCollection_method
subscriptionChangeCreateCollection_method SubscriptionChangeCreate
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
"coupon_codes" Key -> [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe [Text]
subscriptionChangeCreateCoupon_codes SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe CustomFields
subscriptionChangeCreateCustom_fields SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Int
subscriptionChangeCreateNet_terms SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChangeCreateNet_terms_type -> [Series])
-> Maybe SubscriptionChangeCreateNet_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])
-> (SubscriptionChangeCreateNet_terms_type -> Series)
-> SubscriptionChangeCreateNet_terms_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> SubscriptionChangeCreateNet_terms_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateNet_terms_type
subscriptionChangeCreateNet_terms_type SubscriptionChangeCreate
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
"plan_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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePlan_code SubscriptionChangeCreate
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
"plan_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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePlan_id SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Text
subscriptionChangeCreatePo_number SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (ProrationSettings -> [Series])
-> Maybe ProrationSettings
-> [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])
-> (ProrationSettings -> Series) -> ProrationSettings -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"proration_settings" Key -> ProrationSettings -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe ProrationSettings
subscriptionChangeCreateProration_settings SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Int
subscriptionChangeCreateQuantity SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([SubscriptionRampInterval] -> [Series])
-> Maybe [SubscriptionRampInterval]
-> [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])
-> ([SubscriptionRampInterval] -> Series)
-> [SubscriptionRampInterval]
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"ramp_intervals" Key -> [SubscriptionRampInterval] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe [SubscriptionRampInterval]
subscriptionChangeCreateRamp_intervals SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChangeCreateRevenue_schedule_type -> [Series])
-> Maybe SubscriptionChangeCreateRevenue_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])
-> (SubscriptionChangeCreateRevenue_schedule_type -> Series)
-> SubscriptionChangeCreateRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> SubscriptionChangeCreateRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateRevenue_schedule_type
subscriptionChangeCreateRevenue_schedule_type SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChangeShippingCreate -> [Series])
-> Maybe SubscriptionChangeShippingCreate
-> [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])
-> (SubscriptionChangeShippingCreate -> Series)
-> SubscriptionChangeShippingCreate
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping" Key -> SubscriptionChangeShippingCreate -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe SubscriptionChangeShippingCreate
subscriptionChangeCreateShipping SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Bool
subscriptionChangeCreateTax_inclusive SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChangeCreateTimeframe -> [Series])
-> Maybe SubscriptionChangeCreateTimeframe
-> [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])
-> (SubscriptionChangeCreateTimeframe -> Series)
-> SubscriptionChangeCreateTimeframe
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"timeframe" Key -> SubscriptionChangeCreateTimeframe -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate -> Maybe SubscriptionChangeCreateTimeframe
subscriptionChangeCreateTimeframe SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (SubscriptionChangeCreateTransaction_type -> [Series])
-> Maybe SubscriptionChangeCreateTransaction_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])
-> (SubscriptionChangeCreateTransaction_type -> Series)
-> SubscriptionChangeCreateTransaction_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transaction_type" Key -> SubscriptionChangeCreateTransaction_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (SubscriptionChangeCreate
-> Maybe SubscriptionChangeCreateTransaction_type
subscriptionChangeCreateTransaction_type SubscriptionChangeCreate
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..=)) (SubscriptionChangeCreate -> Maybe Float
subscriptionChangeCreateUnit_amount SubscriptionChangeCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionChangeCreate where
    parseJSON :: Value -> Parser SubscriptionChangeCreate
parseJSON = String
-> (Object -> Parser SubscriptionChangeCreate)
-> Value
-> Parser SubscriptionChangeCreate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SubscriptionChangeCreate" (\Object
obj -> (((((((((((((((((((((Maybe [SubscriptionAddOnUpdate]
 -> Maybe SubscriptionChangeBillingInfoCreate
 -> Maybe Text
 -> Maybe Text
 -> Maybe SubscriptionChangeCreateCollection_method
 -> Maybe [Text]
 -> Maybe CustomFields
 -> Maybe Int
 -> Maybe SubscriptionChangeCreateNet_terms_type
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ProrationSettings
 -> Maybe Int
 -> Maybe [SubscriptionRampInterval]
 -> Maybe SubscriptionChangeCreateRevenue_schedule_type
 -> Maybe SubscriptionChangeShippingCreate
 -> Maybe Bool
 -> Maybe SubscriptionChangeCreateTimeframe
 -> Maybe SubscriptionChangeCreateTransaction_type
 -> Maybe Float
 -> SubscriptionChangeCreate)
-> Parser
     (Maybe [SubscriptionAddOnUpdate]
      -> Maybe SubscriptionChangeBillingInfoCreate
      -> Maybe Text
      -> Maybe Text
      -> Maybe SubscriptionChangeCreateCollection_method
      -> Maybe [Text]
      -> Maybe CustomFields
      -> Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe [SubscriptionAddOnUpdate]
-> Maybe SubscriptionChangeBillingInfoCreate
-> Maybe Text
-> Maybe Text
-> Maybe SubscriptionChangeCreateCollection_method
-> Maybe [Text]
-> Maybe CustomFields
-> Maybe Int
-> Maybe SubscriptionChangeCreateNet_terms_type
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ProrationSettings
-> Maybe Int
-> Maybe [SubscriptionRampInterval]
-> Maybe SubscriptionChangeCreateRevenue_schedule_type
-> Maybe SubscriptionChangeShippingCreate
-> Maybe Bool
-> Maybe SubscriptionChangeCreateTimeframe
-> Maybe SubscriptionChangeCreateTransaction_type
-> Maybe Float
-> SubscriptionChangeCreate
SubscriptionChangeCreate Parser
  (Maybe [SubscriptionAddOnUpdate]
   -> Maybe SubscriptionChangeBillingInfoCreate
   -> Maybe Text
   -> Maybe Text
   -> Maybe SubscriptionChangeCreateCollection_method
   -> Maybe [Text]
   -> Maybe CustomFields
   -> Maybe Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe [SubscriptionAddOnUpdate])
-> Parser
     (Maybe SubscriptionChangeBillingInfoCreate
      -> Maybe Text
      -> Maybe Text
      -> Maybe SubscriptionChangeCreateCollection_method
      -> Maybe [Text]
      -> Maybe CustomFields
      -> Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 [SubscriptionAddOnUpdate])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"add_ons")) Parser
  (Maybe SubscriptionChangeBillingInfoCreate
   -> Maybe Text
   -> Maybe Text
   -> Maybe SubscriptionChangeCreateCollection_method
   -> Maybe [Text]
   -> Maybe CustomFields
   -> Maybe Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe SubscriptionChangeBillingInfoCreate)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe SubscriptionChangeCreateCollection_method
      -> Maybe [Text]
      -> Maybe CustomFields
      -> Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeBillingInfoCreate)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"billing_info")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe SubscriptionChangeCreateCollection_method
   -> Maybe [Text]
   -> Maybe CustomFields
   -> Maybe Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe SubscriptionChangeCreateCollection_method
      -> Maybe [Text]
      -> Maybe CustomFields
      -> Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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_code")) Parser
  (Maybe Text
   -> Maybe SubscriptionChangeCreateCollection_method
   -> Maybe [Text]
   -> Maybe CustomFields
   -> Maybe Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Text)
-> Parser
     (Maybe SubscriptionChangeCreateCollection_method
      -> Maybe [Text]
      -> Maybe CustomFields
      -> Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateCollection_method
   -> Maybe [Text]
   -> Maybe CustomFields
   -> Maybe Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe SubscriptionChangeCreateCollection_method)
-> Parser
     (Maybe [Text]
      -> Maybe CustomFields
      -> Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateCollection_method)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"collection_method")) Parser
  (Maybe [Text]
   -> Maybe CustomFields
   -> Maybe Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe [Text])
-> Parser
     (Maybe CustomFields
      -> Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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
"coupon_codes")) Parser
  (Maybe CustomFields
   -> Maybe Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe CustomFields)
-> Parser
     (Maybe Int
      -> Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 Int
   -> Maybe SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Int)
-> Parser
     (Maybe SubscriptionChangeCreateNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe SubscriptionChangeCreateNet_terms_type)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateNet_terms_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"net_terms_type")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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
"plan_code")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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
"plan_id")) Parser
  (Maybe Text
   -> Maybe ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Text)
-> Parser
     (Maybe ProrationSettings
      -> Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 ProrationSettings
   -> Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe ProrationSettings)
-> Parser
     (Maybe Int
      -> Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 ProrationSettings)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"proration_settings")) Parser
  (Maybe Int
   -> Maybe [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Int)
-> Parser
     (Maybe [SubscriptionRampInterval]
      -> Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 [SubscriptionRampInterval]
   -> Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe [SubscriptionRampInterval])
-> Parser
     (Maybe SubscriptionChangeCreateRevenue_schedule_type
      -> Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 [SubscriptionRampInterval])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"ramp_intervals")) Parser
  (Maybe SubscriptionChangeCreateRevenue_schedule_type
   -> Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe SubscriptionChangeCreateRevenue_schedule_type)
-> Parser
     (Maybe SubscriptionChangeShippingCreate
      -> Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
  (Maybe SubscriptionChangeShippingCreate
   -> Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe SubscriptionChangeShippingCreate)
-> Parser
     (Maybe Bool
      -> Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeShippingCreate)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"shipping")) Parser
  (Maybe Bool
   -> Maybe SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe Bool)
-> Parser
     (Maybe SubscriptionChangeCreateTimeframe
      -> Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float
      -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateTimeframe
   -> Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float
   -> SubscriptionChangeCreate)
-> Parser (Maybe SubscriptionChangeCreateTimeframe)
-> Parser
     (Maybe SubscriptionChangeCreateTransaction_type
      -> Maybe Float -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateTimeframe)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"timeframe")) Parser
  (Maybe SubscriptionChangeCreateTransaction_type
   -> Maybe Float -> SubscriptionChangeCreate)
-> Parser (Maybe SubscriptionChangeCreateTransaction_type)
-> Parser (Maybe Float -> SubscriptionChangeCreate)
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 SubscriptionChangeCreateTransaction_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"transaction_type")) Parser (Maybe Float -> SubscriptionChangeCreate)
-> Parser (Maybe Float) -> Parser SubscriptionChangeCreate
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"))

-- | Create a new 'SubscriptionChangeCreate' with all required fields.
mkSubscriptionChangeCreate :: SubscriptionChangeCreate
mkSubscriptionChangeCreate :: SubscriptionChangeCreate
mkSubscriptionChangeCreate =
    SubscriptionChangeCreate
        { subscriptionChangeCreateAdd_ons :: Maybe [SubscriptionAddOnUpdate]
subscriptionChangeCreateAdd_ons = Maybe [SubscriptionAddOnUpdate]
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateBilling_info :: Maybe SubscriptionChangeBillingInfoCreate
subscriptionChangeCreateBilling_info = Maybe SubscriptionChangeBillingInfoCreate
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateBusiness_entity_code :: Maybe Text
subscriptionChangeCreateBusiness_entity_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateBusiness_entity_id :: Maybe Text
subscriptionChangeCreateBusiness_entity_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateCollection_method :: Maybe SubscriptionChangeCreateCollection_method
subscriptionChangeCreateCollection_method = Maybe SubscriptionChangeCreateCollection_method
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateCoupon_codes :: Maybe [Text]
subscriptionChangeCreateCoupon_codes = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateCustom_fields :: Maybe CustomFields
subscriptionChangeCreateCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateNet_terms :: Maybe Int
subscriptionChangeCreateNet_terms = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateNet_terms_type :: Maybe SubscriptionChangeCreateNet_terms_type
subscriptionChangeCreateNet_terms_type = Maybe SubscriptionChangeCreateNet_terms_type
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreatePlan_code :: Maybe Text
subscriptionChangeCreatePlan_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreatePlan_id :: Maybe Text
subscriptionChangeCreatePlan_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreatePo_number :: Maybe Text
subscriptionChangeCreatePo_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateProration_settings :: Maybe ProrationSettings
subscriptionChangeCreateProration_settings = Maybe ProrationSettings
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateQuantity :: Maybe Int
subscriptionChangeCreateQuantity = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateRamp_intervals :: Maybe [SubscriptionRampInterval]
subscriptionChangeCreateRamp_intervals = Maybe [SubscriptionRampInterval]
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateRevenue_schedule_type :: Maybe SubscriptionChangeCreateRevenue_schedule_type
subscriptionChangeCreateRevenue_schedule_type = Maybe SubscriptionChangeCreateRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateShipping :: Maybe SubscriptionChangeShippingCreate
subscriptionChangeCreateShipping = Maybe SubscriptionChangeShippingCreate
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateTax_inclusive :: Maybe Bool
subscriptionChangeCreateTax_inclusive = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateTimeframe :: Maybe SubscriptionChangeCreateTimeframe
subscriptionChangeCreateTimeframe = Maybe SubscriptionChangeCreateTimeframe
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateTransaction_type :: Maybe SubscriptionChangeCreateTransaction_type
subscriptionChangeCreateTransaction_type = Maybe SubscriptionChangeCreateTransaction_type
forall a. Maybe a
GHC.Maybe.Nothing
        , subscriptionChangeCreateUnit_amount :: Maybe Float
subscriptionChangeCreateUnit_amount = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        }

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

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionChangeCreateCollection_method where
    toJSON :: SubscriptionChangeCreateCollection_method -> Value
toJSON (SubscriptionChangeCreateCollection_methodOther Value
val) = Value
val
    toJSON (SubscriptionChangeCreateCollection_methodTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionChangeCreateCollection_method
SubscriptionChangeCreateCollection_methodEnumAutomatic) = Value
"automatic"
    toJSON (SubscriptionChangeCreateCollection_method
SubscriptionChangeCreateCollection_methodEnumManual) = Value
"manual"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionChangeCreateCollection_method where
    parseJSON :: Value -> Parser SubscriptionChangeCreateCollection_method
parseJSON Value
val =
        SubscriptionChangeCreateCollection_method
-> Parser SubscriptionChangeCreateCollection_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" -> SubscriptionChangeCreateCollection_method
SubscriptionChangeCreateCollection_methodEnumAutomatic
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"manual" -> SubscriptionChangeCreateCollection_method
SubscriptionChangeCreateCollection_methodEnumManual
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionChangeCreateCollection_method
SubscriptionChangeCreateCollection_methodOther Value
val
            )

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

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionChangeCreateNet_terms_type where
    toJSON :: SubscriptionChangeCreateNet_terms_type -> Value
toJSON (SubscriptionChangeCreateNet_terms_typeOther Value
val) = Value
val
    toJSON (SubscriptionChangeCreateNet_terms_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionChangeCreateNet_terms_type
SubscriptionChangeCreateNet_terms_typeEnumNet) = Value
"net"
    toJSON (SubscriptionChangeCreateNet_terms_type
SubscriptionChangeCreateNet_terms_typeEnumEom) = Value
"eom"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionChangeCreateNet_terms_type where
    parseJSON :: Value -> Parser SubscriptionChangeCreateNet_terms_type
parseJSON Value
val =
        SubscriptionChangeCreateNet_terms_type
-> Parser SubscriptionChangeCreateNet_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" -> SubscriptionChangeCreateNet_terms_type
SubscriptionChangeCreateNet_terms_typeEnumNet
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"eom" -> SubscriptionChangeCreateNet_terms_type
SubscriptionChangeCreateNet_terms_typeEnumEom
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionChangeCreateNet_terms_type
SubscriptionChangeCreateNet_terms_typeOther Value
val
            )

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

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionChangeCreateRevenue_schedule_type where
    toJSON :: SubscriptionChangeCreateRevenue_schedule_type -> Value
toJSON (SubscriptionChangeCreateRevenue_schedule_typeOther Value
val) = Value
val
    toJSON (SubscriptionChangeCreateRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
    toJSON (SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
    toJSON (SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumEvenly) = Value
"evenly"
    toJSON (SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionChangeCreateRevenue_schedule_type where
    parseJSON :: Value -> Parser SubscriptionChangeCreateRevenue_schedule_type
parseJSON Value
val =
        SubscriptionChangeCreateRevenue_schedule_type
-> Parser SubscriptionChangeCreateRevenue_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" -> SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumAt_range_end
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumAt_range_start
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumEvenly
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeEnumNever
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionChangeCreateRevenue_schedule_type
SubscriptionChangeCreateRevenue_schedule_typeOther Value
val
            )

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

The timeframe parameter controls when the upgrade or downgrade takes place. The subscription change can occur now, when the subscription is next billed, or when the subscription term ends. Generally, if you\'re performing an upgrade, you will want the change to occur immediately (now). If you\'re performing a downgrade, you should set the timeframe to \`term_end\` or \`bill_date\` so the change takes effect at a scheduled billing date. The \`renewal\` timeframe option is accepted as an alias for \`term_end\`.
-}
data SubscriptionChangeCreateTimeframe
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionChangeCreateTimeframeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      SubscriptionChangeCreateTimeframeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"bill_date"@
      SubscriptionChangeCreateTimeframeEnumBill_date
    | -- | Represents the JSON value @"now"@
      SubscriptionChangeCreateTimeframeEnumNow
    | -- | Represents the JSON value @"renewal"@
      SubscriptionChangeCreateTimeframeEnumRenewal
    | -- | Represents the JSON value @"term_end"@
      SubscriptionChangeCreateTimeframeEnumTerm_end
    deriving (Int -> SubscriptionChangeCreateTimeframe -> ShowS
[SubscriptionChangeCreateTimeframe] -> ShowS
SubscriptionChangeCreateTimeframe -> String
(Int -> SubscriptionChangeCreateTimeframe -> ShowS)
-> (SubscriptionChangeCreateTimeframe -> String)
-> ([SubscriptionChangeCreateTimeframe] -> ShowS)
-> Show SubscriptionChangeCreateTimeframe
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionChangeCreateTimeframe -> ShowS
showsPrec :: Int -> SubscriptionChangeCreateTimeframe -> ShowS
$cshow :: SubscriptionChangeCreateTimeframe -> String
show :: SubscriptionChangeCreateTimeframe -> String
$cshowList :: [SubscriptionChangeCreateTimeframe] -> ShowS
showList :: [SubscriptionChangeCreateTimeframe] -> ShowS
GHC.Show.Show, SubscriptionChangeCreateTimeframe
-> SubscriptionChangeCreateTimeframe -> Bool
(SubscriptionChangeCreateTimeframe
 -> SubscriptionChangeCreateTimeframe -> Bool)
-> (SubscriptionChangeCreateTimeframe
    -> SubscriptionChangeCreateTimeframe -> Bool)
-> Eq SubscriptionChangeCreateTimeframe
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionChangeCreateTimeframe
-> SubscriptionChangeCreateTimeframe -> Bool
== :: SubscriptionChangeCreateTimeframe
-> SubscriptionChangeCreateTimeframe -> Bool
$c/= :: SubscriptionChangeCreateTimeframe
-> SubscriptionChangeCreateTimeframe -> Bool
/= :: SubscriptionChangeCreateTimeframe
-> SubscriptionChangeCreateTimeframe -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionChangeCreateTimeframe where
    toJSON :: SubscriptionChangeCreateTimeframe -> Value
toJSON (SubscriptionChangeCreateTimeframeOther Value
val) = Value
val
    toJSON (SubscriptionChangeCreateTimeframeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumBill_date) = Value
"bill_date"
    toJSON (SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumNow) = Value
"now"
    toJSON (SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumRenewal) = Value
"renewal"
    toJSON (SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumTerm_end) = Value
"term_end"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionChangeCreateTimeframe where
    parseJSON :: Value -> Parser SubscriptionChangeCreateTimeframe
parseJSON Value
val =
        SubscriptionChangeCreateTimeframe
-> Parser SubscriptionChangeCreateTimeframe
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
"bill_date" -> SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumBill_date
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"now" -> SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumNow
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"renewal" -> SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumRenewal
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"term_end" -> SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeEnumTerm_end
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionChangeCreateTimeframe
SubscriptionChangeCreateTimeframeOther Value
val
            )

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

An optional type designation for the payment gateway transaction created by this request. Supports \'moto\' value, which is the acronym for mail order and telephone transactions.
-}
data SubscriptionChangeCreateTransaction_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      SubscriptionChangeCreateTransaction_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.
      SubscriptionChangeCreateTransaction_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"moto"@
      SubscriptionChangeCreateTransaction_typeEnumMoto
    deriving (Int -> SubscriptionChangeCreateTransaction_type -> ShowS
[SubscriptionChangeCreateTransaction_type] -> ShowS
SubscriptionChangeCreateTransaction_type -> String
(Int -> SubscriptionChangeCreateTransaction_type -> ShowS)
-> (SubscriptionChangeCreateTransaction_type -> String)
-> ([SubscriptionChangeCreateTransaction_type] -> ShowS)
-> Show SubscriptionChangeCreateTransaction_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubscriptionChangeCreateTransaction_type -> ShowS
showsPrec :: Int -> SubscriptionChangeCreateTransaction_type -> ShowS
$cshow :: SubscriptionChangeCreateTransaction_type -> String
show :: SubscriptionChangeCreateTransaction_type -> String
$cshowList :: [SubscriptionChangeCreateTransaction_type] -> ShowS
showList :: [SubscriptionChangeCreateTransaction_type] -> ShowS
GHC.Show.Show, SubscriptionChangeCreateTransaction_type
-> SubscriptionChangeCreateTransaction_type -> Bool
(SubscriptionChangeCreateTransaction_type
 -> SubscriptionChangeCreateTransaction_type -> Bool)
-> (SubscriptionChangeCreateTransaction_type
    -> SubscriptionChangeCreateTransaction_type -> Bool)
-> Eq SubscriptionChangeCreateTransaction_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubscriptionChangeCreateTransaction_type
-> SubscriptionChangeCreateTransaction_type -> Bool
== :: SubscriptionChangeCreateTransaction_type
-> SubscriptionChangeCreateTransaction_type -> Bool
$c/= :: SubscriptionChangeCreateTransaction_type
-> SubscriptionChangeCreateTransaction_type -> Bool
/= :: SubscriptionChangeCreateTransaction_type
-> SubscriptionChangeCreateTransaction_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON SubscriptionChangeCreateTransaction_type where
    toJSON :: SubscriptionChangeCreateTransaction_type -> Value
toJSON (SubscriptionChangeCreateTransaction_typeOther Value
val) = Value
val
    toJSON (SubscriptionChangeCreateTransaction_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (SubscriptionChangeCreateTransaction_type
SubscriptionChangeCreateTransaction_typeEnumMoto) = Value
"moto"
instance Data.Aeson.Types.FromJSON.FromJSON SubscriptionChangeCreateTransaction_type where
    parseJSON :: Value -> Parser SubscriptionChangeCreateTransaction_type
parseJSON Value
val =
        SubscriptionChangeCreateTransaction_type
-> Parser SubscriptionChangeCreateTransaction_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
"moto" -> SubscriptionChangeCreateTransaction_type
SubscriptionChangeCreateTransaction_typeEnumMoto
                | Bool
GHC.Base.otherwise -> Value -> SubscriptionChangeCreateTransaction_type
SubscriptionChangeCreateTransaction_typeOther Value
val
            )