{-# 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 Plan
module RecurlyClient.Types.Plan 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.PlanHostedPages
import {-# SOURCE #-} RecurlyClient.Types.PlanPricing
import {-# SOURCE #-} RecurlyClient.Types.PlanRampInterval
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

{- | Defines the object schema located at @components.schemas.Plan@ in the specification.

Full plan details.
-}
data Plan = Plan
    { Plan -> Maybe Text
planAccounting_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ accounting_code: Accounting code for invoice line items for the plan. If no value is provided, it defaults to plan\'s code.
    --
    -- Constraints:
    --
    -- * Maximum length of 20
    -- * Must match pattern \'\/^[a-z0-9_+-]+\$\/\'
    , Plan -> Maybe Bool
planAllow_any_item_on_subscriptions :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ allow_any_item_on_subscriptions: Used to determine whether items can be assigned as add-ons to individual subscriptions.
    -- If \`true\`, items can be assigned as add-ons to individual subscription add-ons.
    -- If \`false\`, only plan add-ons can be used.
    , Plan -> Maybe Bool
planAuto_renew :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ auto_renew: Subscriptions will automatically inherit this value once they are active. If \`auto_renew\` is \`true\`, then a subscription will automatically renew its term at renewal. If \`auto_renew\` is \`false\`, then a subscription will expire at the end of its term. \`auto_renew\` can be overridden on the subscription record itself.
    , Plan -> Maybe Int
planAvalara_service_type :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ avalara_service_type: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https:\/\/help.avalara.com\/AvaTax_for_Communications\/Tax_Calculation\/AvaTax_for_Communications_Tax_Engine\/Mapping_Resources\/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t\/s types.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Plan -> Maybe Int
planAvalara_transaction_type :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ avalara_transaction_type: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the plan is taxed. Refer to [the documentation](https:\/\/help.avalara.com\/AvaTax_for_Communications\/Tax_Calculation\/AvaTax_for_Communications_Tax_Engine\/Mapping_Resources\/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t\/s types.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Plan -> Text
planCode :: Data.Text.Internal.Text
    -- ^ code: Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    -- * Must match pattern \'\/^[a-z0-9_+-]+\$\/i\'
    , Plan -> Maybe JsonDateTime
planCreated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ created_at
    , Plan -> Maybe (NonEmpty PlanPricing)
planCurrencies :: (GHC.Maybe.Maybe (GHC.Base.NonEmpty PlanPricing))
    -- ^ currencies
    --
    -- Constraints:
    --
    -- * Must have a minimum of 1 items
    , Plan -> Maybe CustomFields
planCustom_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.
    , Plan -> Maybe JsonDateTime
planDeleted_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ deleted_at
    , Plan -> Maybe Text
planDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ description: Optional description, not displayed.
    , Plan -> Maybe Text
planDunning_campaign_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ dunning_campaign_id: Unique ID to identify a dunning campaign. Used to specify if a non-default dunning campaign should be assigned to this plan. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    , Plan -> Maybe PlanHostedPages
planHosted_pages :: (GHC.Maybe.Maybe PlanHostedPages)
    -- ^ hosted_pages
    , Plan -> Maybe Text
planId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ id
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , Plan -> Maybe Int
planInterval_length :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ interval_length: Length of the plan\'s billing interval in \`interval_unit\`.
    --
    -- Constraints:
    --
    -- * Minimum  of 1.0
    , Plan -> Maybe PlanInterval_unit
planInterval_unit :: (GHC.Maybe.Maybe PlanInterval_unit)
    -- ^ interval_unit: Unit for the plan\'s billing interval.
    , Plan -> Text
planName :: Data.Text.Internal.Text
    -- ^ name: This name describes your plan and will appear on the Hosted Payment Page and the subscriber\'s invoice.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , Plan -> Maybe Text
planObject :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ object
    , Plan -> Maybe PlanPricing_model
planPricing_model :: (GHC.Maybe.Maybe PlanPricing_model)
    -- ^ pricing_model: A fixed pricing model has the same price for each billing period.
    -- A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on
    -- a specified cadence of billing periods. The price change could be an increase or decrease.
    , Plan -> Maybe [PlanRampInterval]
planRamp_intervals :: (GHC.Maybe.Maybe [PlanRampInterval])
    -- ^ ramp_intervals
    , Plan -> Maybe PlanRevenue_schedule_type
planRevenue_schedule_type :: (GHC.Maybe.Maybe PlanRevenue_schedule_type)
    -- ^ revenue_schedule_type
    , Plan -> Maybe Text
planSetup_fee_accounting_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ setup_fee_accounting_code: Accounting code for invoice line items for the plan\'s setup fee. If no value is provided, it defaults to plan\'s accounting code.
    --
    -- Constraints:
    --
    -- * Maximum length of 20
    -- * Must match pattern \'\/^[a-z0-9_+-]+\$\/\'
    , Plan -> Maybe PlanSetup_fee_revenue_schedule_type
planSetup_fee_revenue_schedule_type :: (GHC.Maybe.Maybe PlanSetup_fee_revenue_schedule_type)
    -- ^ setup_fee_revenue_schedule_type
    , Plan -> Maybe PlanState
planState :: (GHC.Maybe.Maybe PlanState)
    -- ^ state: The current state of the plan.
    , Plan -> Maybe Text
planTax_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ tax_code: Optional field used by Avalara, Vertex, and Recurly\'s In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly\'s In-the-Box tax offering you can also choose to instead use simple values of \`unknown\`, \`physical\`, or \`digital\` tax codes.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , Plan -> Maybe Bool
planTax_exempt :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ tax_exempt: \`true\` exempts tax on the plan, \`false\` applies tax on the plan.
    , Plan -> Maybe Int
planTotal_billing_cycles :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ total_billing_cycles: Automatically terminate subscriptions after a defined number of billing cycles. Number of billing cycles before the plan automatically stops renewing, defaults to \`null\` for continuous, automatic renewal.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Plan -> Maybe Int
planTrial_length :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ trial_length: Length of plan\'s trial period in \`trial_units\`. \`0\` means \`no trial\`.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Plan -> Maybe Bool
planTrial_requires_billing_info :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ trial_requires_billing_info: Allow free trial subscriptions to be created without billing info. Should not be used if billing info is needed for initial invoice due to existing uninvoiced charges or setup fee.
    , Plan -> Maybe PlanTrial_unit
planTrial_unit :: (GHC.Maybe.Maybe PlanTrial_unit)
    -- ^ trial_unit: Units for the plan\'s trial period.
    , Plan -> Maybe JsonDateTime
planUpdated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ updated_at
    , Plan -> Maybe Text
planVertex_transaction_type :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ vertex_transaction_type: Used by Vertex for tax calculations. Possible values are \`sale\`, \`rental\`, \`lease\`.
    }
    deriving
        ( Int -> Plan -> ShowS
[Plan] -> ShowS
Plan -> String
(Int -> Plan -> ShowS)
-> (Plan -> String) -> ([Plan] -> ShowS) -> Show Plan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Plan -> ShowS
showsPrec :: Int -> Plan -> ShowS
$cshow :: Plan -> String
show :: Plan -> String
$cshowList :: [Plan] -> ShowS
showList :: [Plan] -> ShowS
GHC.Show.Show
        , Plan -> Plan -> Bool
(Plan -> Plan -> Bool) -> (Plan -> Plan -> Bool) -> Eq Plan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Plan -> Plan -> Bool
== :: Plan -> Plan -> Bool
$c/= :: Plan -> Plan -> Bool
/= :: Plan -> Plan -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON Plan where
    toJSON :: Plan -> Value
toJSON Plan
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([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
"accounting_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..=)) (Plan -> Maybe Text
planAccounting_code Plan
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
"allow_any_item_on_subscriptions" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planAllow_any_item_on_subscriptions Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"auto_renew" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planAuto_renew Plan
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
"avalara_service_type" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planAvalara_service_type Plan
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
"avalara_transaction_type" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planAvalara_transaction_type Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Key
"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..= Plan -> Text
planCode Plan
obj] [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"created_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe JsonDateTime
planCreated_at Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (NonEmpty PlanPricing -> [Pair])
-> Maybe (NonEmpty PlanPricing)
-> [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])
-> (NonEmpty PlanPricing -> Pair) -> NonEmpty PlanPricing -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"currencies" Key -> NonEmpty PlanPricing -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe (NonEmpty PlanPricing)
planCurrencies Plan
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..=)) (Plan -> Maybe CustomFields
planCustom_fields Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"deleted_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe JsonDateTime
planDeleted_at Plan
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
"description" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planDescription Plan
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
"dunning_campaign_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..=)) (Plan -> Maybe Text
planDunning_campaign_id Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PlanHostedPages -> [Pair]) -> Maybe PlanHostedPages -> [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])
-> (PlanHostedPages -> Pair) -> PlanHostedPages -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"hosted_pages" Key -> PlanHostedPages -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanHostedPages
planHosted_pages Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planId Plan
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
"interval_length" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planInterval_length Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PlanInterval_unit -> [Pair])
-> Maybe PlanInterval_unit
-> [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])
-> (PlanInterval_unit -> Pair) -> PlanInterval_unit -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"interval_unit" Key -> PlanInterval_unit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanInterval_unit
planInterval_unit Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Key
"name" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..= Plan -> Text
planName Plan
obj] [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planObject Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PlanPricing_model -> [Pair])
-> Maybe PlanPricing_model
-> [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])
-> (PlanPricing_model -> Pair) -> PlanPricing_model -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"pricing_model" Key -> PlanPricing_model -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanPricing_model
planPricing_model Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([PlanRampInterval] -> [Pair])
-> Maybe [PlanRampInterval]
-> [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])
-> ([PlanRampInterval] -> Pair) -> [PlanRampInterval] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"ramp_intervals" Key -> [PlanRampInterval] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe [PlanRampInterval]
planRamp_intervals Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PlanRevenue_schedule_type -> [Pair])
-> Maybe PlanRevenue_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])
-> (PlanRevenue_schedule_type -> Pair)
-> PlanRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> PlanRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanRevenue_schedule_type
planRevenue_schedule_type Plan
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
"setup_fee_accounting_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..=)) (Plan -> Maybe Text
planSetup_fee_accounting_code Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PlanSetup_fee_revenue_schedule_type -> [Pair])
-> Maybe PlanSetup_fee_revenue_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])
-> (PlanSetup_fee_revenue_schedule_type -> Pair)
-> PlanSetup_fee_revenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"setup_fee_revenue_schedule_type" Key -> PlanSetup_fee_revenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanSetup_fee_revenue_schedule_type
planSetup_fee_revenue_schedule_type Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (PlanState -> [Pair]) -> Maybe PlanState -> [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]) -> (PlanState -> Pair) -> PlanState -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> PlanState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanState
planState Plan
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
"tax_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..=)) (Plan -> Maybe Text
planTax_code Plan
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_exempt" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planTax_exempt Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"total_billing_cycles" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planTotal_billing_cycles Plan
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
"trial_length" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planTrial_length Plan
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
"trial_requires_billing_info" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planTrial_requires_billing_info Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (PlanTrial_unit -> [Pair]) -> Maybe PlanTrial_unit -> [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])
-> (PlanTrial_unit -> Pair) -> PlanTrial_unit -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"trial_unit" Key -> PlanTrial_unit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanTrial_unit
planTrial_unit Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"updated_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe JsonDateTime
planUpdated_at Plan
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
"vertex_transaction_type" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planVertex_transaction_type Plan
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: Plan -> Encoding
toEncoding Plan
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] -> (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
"accounting_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..=)) (Plan -> Maybe Text
planAccounting_code Plan
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
"allow_any_item_on_subscriptions" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planAllow_any_item_on_subscriptions Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"auto_renew" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planAuto_renew Plan
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
"avalara_service_type" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planAvalara_service_type Plan
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
"avalara_transaction_type" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planAvalara_transaction_type Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Key
"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..= Plan -> Text
planCode Plan
obj] [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"created_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe JsonDateTime
planCreated_at Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (NonEmpty PlanPricing -> [Series])
-> Maybe (NonEmpty PlanPricing)
-> [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])
-> (NonEmpty PlanPricing -> Series)
-> NonEmpty PlanPricing
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"currencies" Key -> NonEmpty PlanPricing -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe (NonEmpty PlanPricing)
planCurrencies Plan
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..=)) (Plan -> Maybe CustomFields
planCustom_fields Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"deleted_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe JsonDateTime
planDeleted_at Plan
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
"description" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planDescription Plan
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
"dunning_campaign_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..=)) (Plan -> Maybe Text
planDunning_campaign_id Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PlanHostedPages -> [Series])
-> Maybe PlanHostedPages
-> [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])
-> (PlanHostedPages -> Series) -> PlanHostedPages -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"hosted_pages" Key -> PlanHostedPages -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanHostedPages
planHosted_pages Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planId Plan
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
"interval_length" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planInterval_length Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PlanInterval_unit -> [Series])
-> Maybe PlanInterval_unit
-> [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])
-> (PlanInterval_unit -> Series) -> PlanInterval_unit -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"interval_unit" Key -> PlanInterval_unit -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanInterval_unit
planInterval_unit Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Key
"name" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..= Plan -> Text
planName Plan
obj] [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"object" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planObject Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PlanPricing_model -> [Series])
-> Maybe PlanPricing_model
-> [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])
-> (PlanPricing_model -> Series) -> PlanPricing_model -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"pricing_model" Key -> PlanPricing_model -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanPricing_model
planPricing_model Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([PlanRampInterval] -> [Series])
-> Maybe [PlanRampInterval]
-> [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])
-> ([PlanRampInterval] -> Series) -> [PlanRampInterval] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"ramp_intervals" Key -> [PlanRampInterval] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe [PlanRampInterval]
planRamp_intervals Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PlanRevenue_schedule_type -> [Series])
-> Maybe PlanRevenue_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])
-> (PlanRevenue_schedule_type -> Series)
-> PlanRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> PlanRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanRevenue_schedule_type
planRevenue_schedule_type Plan
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
"setup_fee_accounting_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..=)) (Plan -> Maybe Text
planSetup_fee_accounting_code Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PlanSetup_fee_revenue_schedule_type -> [Series])
-> Maybe PlanSetup_fee_revenue_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])
-> (PlanSetup_fee_revenue_schedule_type -> Series)
-> PlanSetup_fee_revenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"setup_fee_revenue_schedule_type" Key -> PlanSetup_fee_revenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanSetup_fee_revenue_schedule_type
planSetup_fee_revenue_schedule_type Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (PlanState -> [Series]) -> Maybe PlanState -> [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])
-> (PlanState -> Series) -> PlanState -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> PlanState -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanState
planState Plan
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
"tax_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..=)) (Plan -> Maybe Text
planTax_code Plan
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_exempt" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planTax_exempt Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"total_billing_cycles" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planTotal_billing_cycles Plan
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
"trial_length" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Int
planTrial_length Plan
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
"trial_requires_billing_info" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Bool
planTrial_requires_billing_info Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (PlanTrial_unit -> [Series]) -> Maybe PlanTrial_unit -> [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])
-> (PlanTrial_unit -> Series) -> PlanTrial_unit -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"trial_unit" Key -> PlanTrial_unit -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe PlanTrial_unit
planTrial_unit Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"updated_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe JsonDateTime
planUpdated_at Plan
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
"vertex_transaction_type" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Plan -> Maybe Text
planVertex_transaction_type Plan
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON Plan where
    parseJSON :: Value -> Parser Plan
parseJSON = String -> (Object -> Parser Plan) -> Value -> Parser Plan
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Plan" (\Object
obj -> ((((((((((((((((((((((((((((((((Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Int
 -> Maybe Int
 -> Text
 -> Maybe JsonDateTime
 -> Maybe (NonEmpty PlanPricing)
 -> Maybe CustomFields
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe Text
 -> Maybe PlanHostedPages
 -> Maybe Text
 -> Maybe Int
 -> Maybe PlanInterval_unit
 -> Text
 -> Maybe Text
 -> Maybe PlanPricing_model
 -> Maybe [PlanRampInterval]
 -> Maybe PlanRevenue_schedule_type
 -> Maybe Text
 -> Maybe PlanSetup_fee_revenue_schedule_type
 -> Maybe PlanState
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Int
 -> Maybe Int
 -> Maybe Bool
 -> Maybe PlanTrial_unit
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Plan)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe JsonDateTime
-> Maybe (NonEmpty PlanPricing)
-> Maybe CustomFields
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe PlanHostedPages
-> Maybe Text
-> Maybe Int
-> Maybe PlanInterval_unit
-> Text
-> Maybe Text
-> Maybe PlanPricing_model
-> Maybe [PlanRampInterval]
-> Maybe PlanRevenue_schedule_type
-> Maybe Text
-> Maybe PlanSetup_fee_revenue_schedule_type
-> Maybe PlanState
-> Maybe Text
-> Maybe Bool
-> Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe PlanTrial_unit
-> Maybe JsonDateTime
-> Maybe Text
-> Plan
Plan Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"accounting_code")) Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"allow_any_item_on_subscriptions")) Parser
  (Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"auto_renew")) Parser
  (Maybe Int
   -> Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"avalara_service_type")) Parser
  (Maybe Int
   -> Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Int)
-> Parser
     (Text
      -> Maybe JsonDateTime
      -> Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"avalara_transaction_type")) Parser
  (Text
   -> Maybe JsonDateTime
   -> Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser Text
-> Parser
     (Maybe JsonDateTime
      -> Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 Text
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"code")) Parser
  (Maybe JsonDateTime
   -> Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe (NonEmpty PlanPricing)
      -> Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"created_at")) Parser
  (Maybe (NonEmpty PlanPricing)
   -> Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe (NonEmpty PlanPricing))
-> Parser
     (Maybe CustomFields
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 (NonEmpty PlanPricing))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"currencies")) Parser
  (Maybe CustomFields
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe CustomFields)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 JsonDateTime
   -> Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"deleted_at")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"description")) Parser
  (Maybe Text
   -> Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Text)
-> Parser
     (Maybe PlanHostedPages
      -> Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"dunning_campaign_id")) Parser
  (Maybe PlanHostedPages
   -> Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe PlanHostedPages)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 PlanHostedPages)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"hosted_pages")) Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"id")) Parser
  (Maybe Int
   -> Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Int)
-> Parser
     (Maybe PlanInterval_unit
      -> Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"interval_length")) Parser
  (Maybe PlanInterval_unit
   -> Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe PlanInterval_unit)
-> Parser
     (Text
      -> Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 PlanInterval_unit)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"interval_unit")) Parser
  (Text
   -> Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser Text
-> Parser
     (Maybe Text
      -> Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 Text
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"name")) Parser
  (Maybe Text
   -> Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Text)
-> Parser
     (Maybe PlanPricing_model
      -> Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"object")) Parser
  (Maybe PlanPricing_model
   -> Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe PlanPricing_model)
-> Parser
     (Maybe [PlanRampInterval]
      -> Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 PlanPricing_model)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"pricing_model")) Parser
  (Maybe [PlanRampInterval]
   -> Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe [PlanRampInterval])
-> Parser
     (Maybe PlanRevenue_schedule_type
      -> Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 [PlanRampInterval])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"ramp_intervals")) Parser
  (Maybe PlanRevenue_schedule_type
   -> Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe PlanRevenue_schedule_type)
-> Parser
     (Maybe Text
      -> Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 PlanRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
  (Maybe Text
   -> Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Text)
-> Parser
     (Maybe PlanSetup_fee_revenue_schedule_type
      -> Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"setup_fee_accounting_code")) Parser
  (Maybe PlanSetup_fee_revenue_schedule_type
   -> Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe PlanSetup_fee_revenue_schedule_type)
-> Parser
     (Maybe PlanState
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 PlanSetup_fee_revenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"setup_fee_revenue_schedule_type")) Parser
  (Maybe PlanState
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe PlanState)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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 PlanState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"state")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"tax_code")) Parser
  (Maybe Bool
   -> Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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_exempt")) Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"total_billing_cycles")) Parser
  (Maybe Int
   -> Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Int)
-> Parser
     (Maybe Bool
      -> Maybe PlanTrial_unit
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Plan)
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
"trial_length")) Parser
  (Maybe Bool
   -> Maybe PlanTrial_unit
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Plan)
-> Parser (Maybe Bool)
-> Parser
     (Maybe PlanTrial_unit -> Maybe JsonDateTime -> Maybe Text -> Plan)
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
"trial_requires_billing_info")) Parser
  (Maybe PlanTrial_unit -> Maybe JsonDateTime -> Maybe Text -> Plan)
-> Parser (Maybe PlanTrial_unit)
-> Parser (Maybe JsonDateTime -> Maybe Text -> Plan)
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 PlanTrial_unit)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"trial_unit")) Parser (Maybe JsonDateTime -> Maybe Text -> Plan)
-> Parser (Maybe JsonDateTime) -> Parser (Maybe Text -> Plan)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"updated_at")) Parser (Maybe Text -> Plan) -> Parser (Maybe Text) -> Parser Plan
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
"vertex_transaction_type"))

-- | Create a new 'Plan' with all required fields.
mkPlan ::
    -- | 'planCode'
    Data.Text.Internal.Text ->
    -- | 'planName'
    Data.Text.Internal.Text ->
    Plan
mkPlan :: Text -> Text -> Plan
mkPlan Text
planCode Text
planName =
    Plan
        { planAccounting_code :: Maybe Text
planAccounting_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , planAllow_any_item_on_subscriptions :: Maybe Bool
planAllow_any_item_on_subscriptions = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , planAuto_renew :: Maybe Bool
planAuto_renew = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , planAvalara_service_type :: Maybe Int
planAvalara_service_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , planAvalara_transaction_type :: Maybe Int
planAvalara_transaction_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , planCode :: Text
planCode = Text
planCode
        , planCreated_at :: Maybe JsonDateTime
planCreated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , planCurrencies :: Maybe (NonEmpty PlanPricing)
planCurrencies = Maybe (NonEmpty PlanPricing)
forall a. Maybe a
GHC.Maybe.Nothing
        , planCustom_fields :: Maybe CustomFields
planCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
        , planDeleted_at :: Maybe JsonDateTime
planDeleted_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , planDescription :: Maybe Text
planDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , planDunning_campaign_id :: Maybe Text
planDunning_campaign_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , planHosted_pages :: Maybe PlanHostedPages
planHosted_pages = Maybe PlanHostedPages
forall a. Maybe a
GHC.Maybe.Nothing
        , planId :: Maybe Text
planId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , planInterval_length :: Maybe Int
planInterval_length = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , planInterval_unit :: Maybe PlanInterval_unit
planInterval_unit = Maybe PlanInterval_unit
forall a. Maybe a
GHC.Maybe.Nothing
        , planName :: Text
planName = Text
planName
        , planObject :: Maybe Text
planObject = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , planPricing_model :: Maybe PlanPricing_model
planPricing_model = Maybe PlanPricing_model
forall a. Maybe a
GHC.Maybe.Nothing
        , planRamp_intervals :: Maybe [PlanRampInterval]
planRamp_intervals = Maybe [PlanRampInterval]
forall a. Maybe a
GHC.Maybe.Nothing
        , planRevenue_schedule_type :: Maybe PlanRevenue_schedule_type
planRevenue_schedule_type = Maybe PlanRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
        , planSetup_fee_accounting_code :: Maybe Text
planSetup_fee_accounting_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , planSetup_fee_revenue_schedule_type :: Maybe PlanSetup_fee_revenue_schedule_type
planSetup_fee_revenue_schedule_type = Maybe PlanSetup_fee_revenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
        , planState :: Maybe PlanState
planState = Maybe PlanState
forall a. Maybe a
GHC.Maybe.Nothing
        , planTax_code :: Maybe Text
planTax_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , planTax_exempt :: Maybe Bool
planTax_exempt = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , planTotal_billing_cycles :: Maybe Int
planTotal_billing_cycles = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , planTrial_length :: Maybe Int
planTrial_length = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , planTrial_requires_billing_info :: Maybe Bool
planTrial_requires_billing_info = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , planTrial_unit :: Maybe PlanTrial_unit
planTrial_unit = Maybe PlanTrial_unit
forall a. Maybe a
GHC.Maybe.Nothing
        , planUpdated_at :: Maybe JsonDateTime
planUpdated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , planVertex_transaction_type :: Maybe Text
planVertex_transaction_type = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        }

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

Unit for the plan\'s billing interval.
-}
data PlanInterval_unit
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      PlanInterval_unitOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      PlanInterval_unitTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"days"@
      PlanInterval_unitEnumDays
    | -- | Represents the JSON value @"months"@
      PlanInterval_unitEnumMonths
    deriving (Int -> PlanInterval_unit -> ShowS
[PlanInterval_unit] -> ShowS
PlanInterval_unit -> String
(Int -> PlanInterval_unit -> ShowS)
-> (PlanInterval_unit -> String)
-> ([PlanInterval_unit] -> ShowS)
-> Show PlanInterval_unit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PlanInterval_unit -> ShowS
showsPrec :: Int -> PlanInterval_unit -> ShowS
$cshow :: PlanInterval_unit -> String
show :: PlanInterval_unit -> String
$cshowList :: [PlanInterval_unit] -> ShowS
showList :: [PlanInterval_unit] -> ShowS
GHC.Show.Show, PlanInterval_unit -> PlanInterval_unit -> Bool
(PlanInterval_unit -> PlanInterval_unit -> Bool)
-> (PlanInterval_unit -> PlanInterval_unit -> Bool)
-> Eq PlanInterval_unit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PlanInterval_unit -> PlanInterval_unit -> Bool
== :: PlanInterval_unit -> PlanInterval_unit -> Bool
$c/= :: PlanInterval_unit -> PlanInterval_unit -> Bool
/= :: PlanInterval_unit -> PlanInterval_unit -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PlanInterval_unit where
    toJSON :: PlanInterval_unit -> Value
toJSON (PlanInterval_unitOther Value
val) = Value
val
    toJSON (PlanInterval_unitTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (PlanInterval_unit
PlanInterval_unitEnumDays) = Value
"days"
    toJSON (PlanInterval_unit
PlanInterval_unitEnumMonths) = Value
"months"
instance Data.Aeson.Types.FromJSON.FromJSON PlanInterval_unit where
    parseJSON :: Value -> Parser PlanInterval_unit
parseJSON Value
val =
        PlanInterval_unit -> Parser PlanInterval_unit
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
"days" -> PlanInterval_unit
PlanInterval_unitEnumDays
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"months" -> PlanInterval_unit
PlanInterval_unitEnumMonths
                | Bool
GHC.Base.otherwise -> Value -> PlanInterval_unit
PlanInterval_unitOther Value
val
            )

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

A fixed pricing model has the same price for each billing period.
A ramp pricing model defines a set of Ramp Intervals, where a subscription changes price on
a specified cadence of billing periods. The price change could be an increase or decrease.
-}
data PlanPricing_model
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      PlanPricing_modelOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      PlanPricing_modelTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"fixed"@
      PlanPricing_modelEnumFixed
    | -- | Represents the JSON value @"ramp"@
      PlanPricing_modelEnumRamp
    deriving (Int -> PlanPricing_model -> ShowS
[PlanPricing_model] -> ShowS
PlanPricing_model -> String
(Int -> PlanPricing_model -> ShowS)
-> (PlanPricing_model -> String)
-> ([PlanPricing_model] -> ShowS)
-> Show PlanPricing_model
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PlanPricing_model -> ShowS
showsPrec :: Int -> PlanPricing_model -> ShowS
$cshow :: PlanPricing_model -> String
show :: PlanPricing_model -> String
$cshowList :: [PlanPricing_model] -> ShowS
showList :: [PlanPricing_model] -> ShowS
GHC.Show.Show, PlanPricing_model -> PlanPricing_model -> Bool
(PlanPricing_model -> PlanPricing_model -> Bool)
-> (PlanPricing_model -> PlanPricing_model -> Bool)
-> Eq PlanPricing_model
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PlanPricing_model -> PlanPricing_model -> Bool
== :: PlanPricing_model -> PlanPricing_model -> Bool
$c/= :: PlanPricing_model -> PlanPricing_model -> Bool
/= :: PlanPricing_model -> PlanPricing_model -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PlanPricing_model where
    toJSON :: PlanPricing_model -> Value
toJSON (PlanPricing_modelOther Value
val) = Value
val
    toJSON (PlanPricing_modelTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (PlanPricing_model
PlanPricing_modelEnumFixed) = Value
"fixed"
    toJSON (PlanPricing_model
PlanPricing_modelEnumRamp) = Value
"ramp"
instance Data.Aeson.Types.FromJSON.FromJSON PlanPricing_model where
    parseJSON :: Value -> Parser PlanPricing_model
parseJSON Value
val =
        PlanPricing_model -> Parser PlanPricing_model
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
"fixed" -> PlanPricing_model
PlanPricing_modelEnumFixed
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ramp" -> PlanPricing_model
PlanPricing_modelEnumRamp
                | Bool
GHC.Base.otherwise -> Value -> PlanPricing_model
PlanPricing_modelOther Value
val
            )

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

instance Data.Aeson.Types.ToJSON.ToJSON PlanRevenue_schedule_type where
    toJSON :: PlanRevenue_schedule_type -> Value
toJSON (PlanRevenue_schedule_typeOther Value
val) = Value
val
    toJSON (PlanRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
    toJSON (PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
    toJSON (PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumEvenly) = Value
"evenly"
    toJSON (PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON PlanRevenue_schedule_type where
    parseJSON :: Value -> Parser PlanRevenue_schedule_type
parseJSON Value
val =
        PlanRevenue_schedule_type -> Parser PlanRevenue_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" -> PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumAt_range_end
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumAt_range_start
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumEvenly
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> PlanRevenue_schedule_type
PlanRevenue_schedule_typeEnumNever
                | Bool
GHC.Base.otherwise -> Value -> PlanRevenue_schedule_type
PlanRevenue_schedule_typeOther Value
val
            )

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

instance Data.Aeson.Types.ToJSON.ToJSON PlanSetup_fee_revenue_schedule_type where
    toJSON :: PlanSetup_fee_revenue_schedule_type -> Value
toJSON (PlanSetup_fee_revenue_schedule_typeOther Value
val) = Value
val
    toJSON (PlanSetup_fee_revenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
    toJSON (PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
    toJSON (PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumEvenly) = Value
"evenly"
    toJSON (PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON PlanSetup_fee_revenue_schedule_type where
    parseJSON :: Value -> Parser PlanSetup_fee_revenue_schedule_type
parseJSON Value
val =
        PlanSetup_fee_revenue_schedule_type
-> Parser PlanSetup_fee_revenue_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" -> PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumAt_range_end
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumAt_range_start
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumEvenly
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeEnumNever
                | Bool
GHC.Base.otherwise -> Value -> PlanSetup_fee_revenue_schedule_type
PlanSetup_fee_revenue_schedule_typeOther Value
val
            )

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

The current state of the plan.
-}
data PlanState
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      PlanStateOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      PlanStateTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"active"@
      PlanStateEnumActive
    | -- | Represents the JSON value @"inactive"@
      PlanStateEnumInactive
    deriving (Int -> PlanState -> ShowS
[PlanState] -> ShowS
PlanState -> String
(Int -> PlanState -> ShowS)
-> (PlanState -> String)
-> ([PlanState] -> ShowS)
-> Show PlanState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PlanState -> ShowS
showsPrec :: Int -> PlanState -> ShowS
$cshow :: PlanState -> String
show :: PlanState -> String
$cshowList :: [PlanState] -> ShowS
showList :: [PlanState] -> ShowS
GHC.Show.Show, PlanState -> PlanState -> Bool
(PlanState -> PlanState -> Bool)
-> (PlanState -> PlanState -> Bool) -> Eq PlanState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PlanState -> PlanState -> Bool
== :: PlanState -> PlanState -> Bool
$c/= :: PlanState -> PlanState -> Bool
/= :: PlanState -> PlanState -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PlanState where
    toJSON :: PlanState -> Value
toJSON (PlanStateOther Value
val) = Value
val
    toJSON (PlanStateTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (PlanState
PlanStateEnumActive) = Value
"active"
    toJSON (PlanState
PlanStateEnumInactive) = Value
"inactive"
instance Data.Aeson.Types.FromJSON.FromJSON PlanState where
    parseJSON :: Value -> Parser PlanState
parseJSON Value
val =
        PlanState -> Parser PlanState
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"active" -> PlanState
PlanStateEnumActive
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"inactive" -> PlanState
PlanStateEnumInactive
                | Bool
GHC.Base.otherwise -> Value -> PlanState
PlanStateOther Value
val
            )

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

Units for the plan\'s trial period.
-}
data PlanTrial_unit
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      PlanTrial_unitOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      PlanTrial_unitTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"days"@
      PlanTrial_unitEnumDays
    | -- | Represents the JSON value @"months"@
      PlanTrial_unitEnumMonths
    deriving (Int -> PlanTrial_unit -> ShowS
[PlanTrial_unit] -> ShowS
PlanTrial_unit -> String
(Int -> PlanTrial_unit -> ShowS)
-> (PlanTrial_unit -> String)
-> ([PlanTrial_unit] -> ShowS)
-> Show PlanTrial_unit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PlanTrial_unit -> ShowS
showsPrec :: Int -> PlanTrial_unit -> ShowS
$cshow :: PlanTrial_unit -> String
show :: PlanTrial_unit -> String
$cshowList :: [PlanTrial_unit] -> ShowS
showList :: [PlanTrial_unit] -> ShowS
GHC.Show.Show, PlanTrial_unit -> PlanTrial_unit -> Bool
(PlanTrial_unit -> PlanTrial_unit -> Bool)
-> (PlanTrial_unit -> PlanTrial_unit -> Bool) -> Eq PlanTrial_unit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PlanTrial_unit -> PlanTrial_unit -> Bool
== :: PlanTrial_unit -> PlanTrial_unit -> Bool
$c/= :: PlanTrial_unit -> PlanTrial_unit -> Bool
/= :: PlanTrial_unit -> PlanTrial_unit -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PlanTrial_unit where
    toJSON :: PlanTrial_unit -> Value
toJSON (PlanTrial_unitOther Value
val) = Value
val
    toJSON (PlanTrial_unitTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (PlanTrial_unit
PlanTrial_unitEnumDays) = Value
"days"
    toJSON (PlanTrial_unit
PlanTrial_unitEnumMonths) = Value
"months"
instance Data.Aeson.Types.FromJSON.FromJSON PlanTrial_unit where
    parseJSON :: Value -> Parser PlanTrial_unit
parseJSON Value
val =
        PlanTrial_unit -> Parser PlanTrial_unit
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
"days" -> PlanTrial_unit
PlanTrial_unitEnumDays
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"months" -> PlanTrial_unit
PlanTrial_unitEnumMonths
                | Bool
GHC.Base.otherwise -> Value -> PlanTrial_unit
PlanTrial_unitOther Value
val
            )