{-# 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 AccountPurchase
module RecurlyClient.Types.AccountPurchase 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.AccountAcquisitionUpdate
import {-# SOURCE #-} RecurlyClient.Types.AccountUpdate
import {-# SOURCE #-} RecurlyClient.Types.Address
import {-# SOURCE #-} RecurlyClient.Types.BillingInfoCreate
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.AccountPurchase.allOf@ in the specification.
data AccountPurchase = AccountPurchase
    { AccountPurchase -> Maybe AccountAcquisitionUpdate
accountPurchaseAcquisition :: (GHC.Maybe.Maybe AccountAcquisitionUpdate)
    -- ^ acquisition
    , AccountPurchase -> Maybe Address
accountPurchaseAddress :: (GHC.Maybe.Maybe Address)
    -- ^ address
    , AccountPurchase -> Maybe AccountPurchaseBill_to
accountPurchaseBill_to :: (GHC.Maybe.Maybe AccountPurchaseBill_to)
    -- ^ bill_to: An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
    --
    -- Constraints:
    --
    -- * Maximum length of 6
    , AccountPurchase -> Maybe BillingInfoCreate
accountPurchaseBilling_info :: (GHC.Maybe.Maybe BillingInfoCreate)
    -- ^ billing_info
    , AccountPurchase -> Maybe Text
accountPurchaseCc_emails :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ cc_emails: Additional email address that should receive account correspondence. These should be separated only by commas. These CC emails will receive all emails that the \`email\` field also receives.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountPurchase -> Text
accountPurchaseCode :: Data.Text.Internal.Text
    -- ^ code: The unique identifier of the account. This cannot be changed once the account is created.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , AccountPurchase -> Maybe Text
accountPurchaseCompany :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ company
    --
    -- Constraints:
    --
    -- * Maximum length of 100
    , AccountPurchase -> Maybe CustomFields
accountPurchaseCustom_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.
    , AccountPurchase -> Maybe Text
accountPurchaseDunning_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 account. For sites without multiple dunning campaigns enabled, the default dunning campaign will always be used.
    , AccountPurchase -> Maybe Text
accountPurchaseEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ email: The email address used for communicating with this customer. The customer will also use this email address to log into your hosted account management pages. This value does not need to be unique.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountPurchase -> Maybe Text
accountPurchaseEntity_use_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ entity_use_code: The Avalara AvaTax value that can be passed to identify the customer type for tax purposes. The range of values can be A - R (more info at Avalara). Value is case-sensitive.
    , AccountPurchase -> Maybe Text
accountPurchaseExemption_certificate :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ exemption_certificate: The tax exemption certificate number for the account. If the merchant has an integration for the Vertex tax provider, this optional value will be sent in any tax calculation requests for the account.
    --
    -- Constraints:
    --
    -- * Maximum length of 30
    , AccountPurchase -> Maybe Text
accountPurchaseFirst_name :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ first_name
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountPurchase -> Maybe Text
accountPurchaseId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ id: Optional, but if present allows an existing account to be used and updated as part of the purchase.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AccountPurchase -> Maybe Text
accountPurchaseInvoice_template_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ invoice_template_id: Unique ID to identify an invoice template.  Available when the site is on a Pro or Elite plan.  Used to specify which invoice template, if any, should be used to generate invoices for the account.
    , AccountPurchase -> Maybe Text
accountPurchaseLast_name :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ last_name
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountPurchase -> Maybe Text
accountPurchaseOverride_business_entity_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ override_business_entity_id: Unique ID to identify the business entity assigned to the account. Available when the \`Multiple Business Entities\` feature is enabled.
    , AccountPurchase -> Maybe Text
accountPurchaseParent_account_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ parent_account_code: The account code of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both \`parent_account_code\` and \`parent_account_id\` are passed, the non-blank value in \`parent_account_id\` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , AccountPurchase -> Maybe Text
accountPurchaseParent_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ parent_account_id: The UUID of the parent account to be associated with this account. Passing an empty value removes any existing parent association from this account. If both \`parent_account_code\` and \`parent_account_id\` are passed, the non-blank value in \`parent_account_id\` will be used. Only one level of parent child relationship is allowed. You cannot assign a parent account that itself has a parent account.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , AccountPurchase -> Maybe AccountPurchasePreferred_locale
accountPurchasePreferred_locale :: (GHC.Maybe.Maybe AccountPurchasePreferred_locale)
    -- ^ preferred_locale: Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
    , AccountPurchase -> Maybe Text
accountPurchasePreferred_time_zone :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ preferred_time_zone: Used to determine the time zone of emails sent on behalf of the merchant to the customer. Must be a [supported IANA time zone name](https:\/\/docs.recurly.com\/docs\/email-time-zones-and-time-stamps\#supported-api-iana-time-zone-names)
    , AccountPurchase -> Maybe Bool
accountPurchaseTax_exempt :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ tax_exempt: The tax status of the account. \`true\` exempts tax on the account, \`false\` applies tax on the account.
    , AccountPurchase -> Maybe AccountPurchaseTransaction_type
accountPurchaseTransaction_type :: (GHC.Maybe.Maybe AccountPurchaseTransaction_type)
    -- ^ transaction_type: An optional type designation for the payment gateway transaction created by this request. Supports \'moto\' value, which is the acronym for mail order and telephone transactions.
    , AccountPurchase -> Maybe Text
accountPurchaseUsername :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ username: A secondary value for the account.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountPurchase -> Maybe Text
accountPurchaseVat_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ vat_number: The VAT number of the account (to avoid having the VAT applied). This is only used for manually collected invoices.
    --
    -- Constraints:
    --
    -- * Maximum length of 20
    }
    deriving
        ( Int -> AccountPurchase -> ShowS
[AccountPurchase] -> ShowS
AccountPurchase -> String
(Int -> AccountPurchase -> ShowS)
-> (AccountPurchase -> String)
-> ([AccountPurchase] -> ShowS)
-> Show AccountPurchase
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountPurchase -> ShowS
showsPrec :: Int -> AccountPurchase -> ShowS
$cshow :: AccountPurchase -> String
show :: AccountPurchase -> String
$cshowList :: [AccountPurchase] -> ShowS
showList :: [AccountPurchase] -> ShowS
GHC.Show.Show
        , AccountPurchase -> AccountPurchase -> Bool
(AccountPurchase -> AccountPurchase -> Bool)
-> (AccountPurchase -> AccountPurchase -> Bool)
-> Eq AccountPurchase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AccountPurchase -> AccountPurchase -> Bool
== :: AccountPurchase -> AccountPurchase -> Bool
$c/= :: AccountPurchase -> AccountPurchase -> Bool
/= :: AccountPurchase -> AccountPurchase -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON AccountPurchase where
    toJSON :: AccountPurchase -> Value
toJSON AccountPurchase
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair]
-> (AccountAcquisitionUpdate -> [Pair])
-> Maybe AccountAcquisitionUpdate
-> [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])
-> (AccountAcquisitionUpdate -> Pair)
-> AccountAcquisitionUpdate
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"acquisition" Key -> AccountAcquisitionUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountAcquisitionUpdate
accountPurchaseAcquisition AccountPurchase
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Address -> [Pair]) -> Maybe Address -> [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]) -> (Address -> Pair) -> Address -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"address" Key -> Address -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Address
accountPurchaseAddress AccountPurchase
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AccountPurchaseBill_to -> [Pair])
-> Maybe AccountPurchaseBill_to
-> [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])
-> (AccountPurchaseBill_to -> Pair)
-> AccountPurchaseBill_to
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"bill_to" Key -> AccountPurchaseBill_to -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountPurchaseBill_to
accountPurchaseBill_to AccountPurchase
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (BillingInfoCreate -> [Pair])
-> Maybe BillingInfoCreate
-> [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])
-> (BillingInfoCreate -> Pair) -> BillingInfoCreate -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info" Key -> BillingInfoCreate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe BillingInfoCreate
accountPurchaseBilling_info AccountPurchase
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
"cc_emails" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseCc_emails AccountPurchase
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..= AccountPurchase -> Text
accountPurchaseCode AccountPurchase
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
"company" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseCompany AccountPurchase
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..=)) (AccountPurchase -> Maybe CustomFields
accountPurchaseCustom_fields AccountPurchase
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..=)) (AccountPurchase -> Maybe Text
accountPurchaseDunning_campaign_id AccountPurchase
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
"email" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseEmail AccountPurchase
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
"entity_use_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseEntity_use_code AccountPurchase
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
"exemption_certificate" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseExemption_certificate AccountPurchase
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
"first_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseFirst_name AccountPurchase
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..=)) (AccountPurchase -> Maybe Text
accountPurchaseId AccountPurchase
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
"invoice_template_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseInvoice_template_id AccountPurchase
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
"last_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseLast_name AccountPurchase
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
"override_business_entity_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseOverride_business_entity_id AccountPurchase
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
"parent_account_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseParent_account_code AccountPurchase
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
"parent_account_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseParent_account_id AccountPurchase
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AccountPurchasePreferred_locale -> [Pair])
-> Maybe AccountPurchasePreferred_locale
-> [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])
-> (AccountPurchasePreferred_locale -> Pair)
-> AccountPurchasePreferred_locale
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"preferred_locale" Key -> AccountPurchasePreferred_locale -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountPurchasePreferred_locale
accountPurchasePreferred_locale AccountPurchase
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
"preferred_time_zone" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchasePreferred_time_zone AccountPurchase
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..=)) (AccountPurchase -> Maybe Bool
accountPurchaseTax_exempt AccountPurchase
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AccountPurchaseTransaction_type -> [Pair])
-> Maybe AccountPurchaseTransaction_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])
-> (AccountPurchaseTransaction_type -> Pair)
-> AccountPurchaseTransaction_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transaction_type" Key -> AccountPurchaseTransaction_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountPurchaseTransaction_type
accountPurchaseTransaction_type AccountPurchase
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
"username" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseUsername AccountPurchase
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
"vat_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseVat_number AccountPurchase
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: AccountPurchase -> Encoding
toEncoding AccountPurchase
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]
-> (AccountAcquisitionUpdate -> [Series])
-> Maybe AccountAcquisitionUpdate
-> [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])
-> (AccountAcquisitionUpdate -> Series)
-> AccountAcquisitionUpdate
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"acquisition" Key -> AccountAcquisitionUpdate -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountAcquisitionUpdate
accountPurchaseAcquisition AccountPurchase
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Address -> [Series]) -> Maybe Address -> [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]) -> (Address -> Series) -> Address -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"address" Key -> Address -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Address
accountPurchaseAddress AccountPurchase
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AccountPurchaseBill_to -> [Series])
-> Maybe AccountPurchaseBill_to
-> [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])
-> (AccountPurchaseBill_to -> Series)
-> AccountPurchaseBill_to
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"bill_to" Key -> AccountPurchaseBill_to -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountPurchaseBill_to
accountPurchaseBill_to AccountPurchase
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (BillingInfoCreate -> [Series])
-> Maybe BillingInfoCreate
-> [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])
-> (BillingInfoCreate -> Series) -> BillingInfoCreate -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"billing_info" Key -> BillingInfoCreate -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe BillingInfoCreate
accountPurchaseBilling_info AccountPurchase
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
"cc_emails" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseCc_emails AccountPurchase
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..= AccountPurchase -> Text
accountPurchaseCode AccountPurchase
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
"company" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseCompany AccountPurchase
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..=)) (AccountPurchase -> Maybe CustomFields
accountPurchaseCustom_fields AccountPurchase
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..=)) (AccountPurchase -> Maybe Text
accountPurchaseDunning_campaign_id AccountPurchase
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
"email" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseEmail AccountPurchase
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
"entity_use_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseEntity_use_code AccountPurchase
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
"exemption_certificate" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseExemption_certificate AccountPurchase
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
"first_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseFirst_name AccountPurchase
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..=)) (AccountPurchase -> Maybe Text
accountPurchaseId AccountPurchase
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
"invoice_template_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseInvoice_template_id AccountPurchase
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
"last_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseLast_name AccountPurchase
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
"override_business_entity_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseOverride_business_entity_id AccountPurchase
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
"parent_account_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseParent_account_code AccountPurchase
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
"parent_account_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..=)) (AccountPurchase -> Maybe Text
accountPurchaseParent_account_id AccountPurchase
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AccountPurchasePreferred_locale -> [Series])
-> Maybe AccountPurchasePreferred_locale
-> [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])
-> (AccountPurchasePreferred_locale -> Series)
-> AccountPurchasePreferred_locale
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"preferred_locale" Key -> AccountPurchasePreferred_locale -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountPurchasePreferred_locale
accountPurchasePreferred_locale AccountPurchase
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
"preferred_time_zone" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchasePreferred_time_zone AccountPurchase
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..=)) (AccountPurchase -> Maybe Bool
accountPurchaseTax_exempt AccountPurchase
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AccountPurchaseTransaction_type -> [Series])
-> Maybe AccountPurchaseTransaction_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])
-> (AccountPurchaseTransaction_type -> Series)
-> AccountPurchaseTransaction_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transaction_type" Key -> AccountPurchaseTransaction_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe AccountPurchaseTransaction_type
accountPurchaseTransaction_type AccountPurchase
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
"username" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseUsername AccountPurchase
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
"vat_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountPurchase -> Maybe Text
accountPurchaseVat_number AccountPurchase
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON AccountPurchase where
    parseJSON :: Value -> Parser AccountPurchase
parseJSON = String
-> (Object -> Parser AccountPurchase)
-> Value
-> Parser AccountPurchase
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"AccountPurchase" (\Object
obj -> (((((((((((((((((((((((((Maybe AccountAcquisitionUpdate
 -> Maybe Address
 -> Maybe AccountPurchaseBill_to
 -> Maybe BillingInfoCreate
 -> Maybe Text
 -> Text
 -> Maybe Text
 -> Maybe CustomFields
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AccountPurchasePreferred_locale
 -> Maybe Text
 -> Maybe Bool
 -> Maybe AccountPurchaseTransaction_type
 -> Maybe Text
 -> Maybe Text
 -> AccountPurchase)
-> Parser
     (Maybe AccountAcquisitionUpdate
      -> Maybe Address
      -> Maybe AccountPurchaseBill_to
      -> Maybe BillingInfoCreate
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe AccountAcquisitionUpdate
-> Maybe Address
-> Maybe AccountPurchaseBill_to
-> Maybe BillingInfoCreate
-> Maybe Text
-> Text
-> Maybe Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AccountPurchasePreferred_locale
-> Maybe Text
-> Maybe Bool
-> Maybe AccountPurchaseTransaction_type
-> Maybe Text
-> Maybe Text
-> AccountPurchase
AccountPurchase Parser
  (Maybe AccountAcquisitionUpdate
   -> Maybe Address
   -> Maybe AccountPurchaseBill_to
   -> Maybe BillingInfoCreate
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe AccountAcquisitionUpdate)
-> Parser
     (Maybe Address
      -> Maybe AccountPurchaseBill_to
      -> Maybe BillingInfoCreate
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 AccountAcquisitionUpdate)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"acquisition")) Parser
  (Maybe Address
   -> Maybe AccountPurchaseBill_to
   -> Maybe BillingInfoCreate
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Address)
-> Parser
     (Maybe AccountPurchaseBill_to
      -> Maybe BillingInfoCreate
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 Address)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"address")) Parser
  (Maybe AccountPurchaseBill_to
   -> Maybe BillingInfoCreate
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe AccountPurchaseBill_to)
-> Parser
     (Maybe BillingInfoCreate
      -> Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 AccountPurchaseBill_to)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"bill_to")) Parser
  (Maybe BillingInfoCreate
   -> Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe BillingInfoCreate)
-> Parser
     (Maybe Text
      -> Text
      -> Maybe Text
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 BillingInfoCreate)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"billing_info")) Parser
  (Maybe Text
   -> Text
   -> Maybe Text
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> Maybe Text
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"cc_emails")) Parser
  (Text
   -> Maybe Text
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser Text
-> Parser
     (Maybe Text
      -> Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 Text
   -> Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe CustomFields
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"company")) Parser
  (Maybe CustomFields
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe CustomFields)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe CustomFields)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"custom_fields")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"email")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"entity_use_code")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"exemption_certificate")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"first_name")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"invoice_template_id")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"last_name")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"override_business_entity_id")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"parent_account_code")) Parser
  (Maybe Text
   -> Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe AccountPurchasePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"parent_account_id")) Parser
  (Maybe AccountPurchasePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe AccountPurchasePreferred_locale)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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 AccountPurchasePreferred_locale)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"preferred_locale")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe AccountPurchaseTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountPurchase)
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
"preferred_time_zone")) Parser
  (Maybe Bool
   -> Maybe AccountPurchaseTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountPurchase)
-> Parser (Maybe Bool)
-> Parser
     (Maybe AccountPurchaseTransaction_type
      -> Maybe Text -> Maybe Text -> AccountPurchase)
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 AccountPurchaseTransaction_type
   -> Maybe Text -> Maybe Text -> AccountPurchase)
-> Parser (Maybe AccountPurchaseTransaction_type)
-> Parser (Maybe Text -> Maybe Text -> AccountPurchase)
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 AccountPurchaseTransaction_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"transaction_type")) Parser (Maybe Text -> Maybe Text -> AccountPurchase)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AccountPurchase)
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
"username")) Parser (Maybe Text -> AccountPurchase)
-> Parser (Maybe Text) -> Parser AccountPurchase
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
"vat_number"))

-- | Create a new 'AccountPurchase' with all required fields.
mkAccountPurchase ::
    -- | 'accountPurchaseCode'
    Data.Text.Internal.Text ->
    AccountPurchase
mkAccountPurchase :: Text -> AccountPurchase
mkAccountPurchase Text
accountPurchaseCode =
    AccountPurchase
        { accountPurchaseAcquisition :: Maybe AccountAcquisitionUpdate
accountPurchaseAcquisition = Maybe AccountAcquisitionUpdate
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseAddress :: Maybe Address
accountPurchaseAddress = Maybe Address
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseBill_to :: Maybe AccountPurchaseBill_to
accountPurchaseBill_to = Maybe AccountPurchaseBill_to
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseBilling_info :: Maybe BillingInfoCreate
accountPurchaseBilling_info = Maybe BillingInfoCreate
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseCc_emails :: Maybe Text
accountPurchaseCc_emails = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseCode :: Text
accountPurchaseCode = Text
accountPurchaseCode
        , accountPurchaseCompany :: Maybe Text
accountPurchaseCompany = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseCustom_fields :: Maybe CustomFields
accountPurchaseCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseDunning_campaign_id :: Maybe Text
accountPurchaseDunning_campaign_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseEmail :: Maybe Text
accountPurchaseEmail = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseEntity_use_code :: Maybe Text
accountPurchaseEntity_use_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseExemption_certificate :: Maybe Text
accountPurchaseExemption_certificate = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseFirst_name :: Maybe Text
accountPurchaseFirst_name = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseId :: Maybe Text
accountPurchaseId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseInvoice_template_id :: Maybe Text
accountPurchaseInvoice_template_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseLast_name :: Maybe Text
accountPurchaseLast_name = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseOverride_business_entity_id :: Maybe Text
accountPurchaseOverride_business_entity_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseParent_account_code :: Maybe Text
accountPurchaseParent_account_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseParent_account_id :: Maybe Text
accountPurchaseParent_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchasePreferred_locale :: Maybe AccountPurchasePreferred_locale
accountPurchasePreferred_locale = Maybe AccountPurchasePreferred_locale
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchasePreferred_time_zone :: Maybe Text
accountPurchasePreferred_time_zone = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseTax_exempt :: Maybe Bool
accountPurchaseTax_exempt = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseTransaction_type :: Maybe AccountPurchaseTransaction_type
accountPurchaseTransaction_type = Maybe AccountPurchaseTransaction_type
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseUsername :: Maybe Text
accountPurchaseUsername = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountPurchaseVat_number :: Maybe Text
accountPurchaseVat_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        }

{- | Defines the enum schema located at @components.schemas.AccountPurchase.allOf.properties.bill_to@ in the specification.

An enumerable describing the billing behavior of the account, specifically whether the account is self-paying or will rely on the parent account to pay.
-}
data AccountPurchaseBill_to
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AccountPurchaseBill_toOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AccountPurchaseBill_toTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"parent"@
      AccountPurchaseBill_toEnumParent
    | -- | Represents the JSON value @"self"@
      AccountPurchaseBill_toEnumSelf
    deriving (Int -> AccountPurchaseBill_to -> ShowS
[AccountPurchaseBill_to] -> ShowS
AccountPurchaseBill_to -> String
(Int -> AccountPurchaseBill_to -> ShowS)
-> (AccountPurchaseBill_to -> String)
-> ([AccountPurchaseBill_to] -> ShowS)
-> Show AccountPurchaseBill_to
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountPurchaseBill_to -> ShowS
showsPrec :: Int -> AccountPurchaseBill_to -> ShowS
$cshow :: AccountPurchaseBill_to -> String
show :: AccountPurchaseBill_to -> String
$cshowList :: [AccountPurchaseBill_to] -> ShowS
showList :: [AccountPurchaseBill_to] -> ShowS
GHC.Show.Show, AccountPurchaseBill_to -> AccountPurchaseBill_to -> Bool
(AccountPurchaseBill_to -> AccountPurchaseBill_to -> Bool)
-> (AccountPurchaseBill_to -> AccountPurchaseBill_to -> Bool)
-> Eq AccountPurchaseBill_to
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AccountPurchaseBill_to -> AccountPurchaseBill_to -> Bool
== :: AccountPurchaseBill_to -> AccountPurchaseBill_to -> Bool
$c/= :: AccountPurchaseBill_to -> AccountPurchaseBill_to -> Bool
/= :: AccountPurchaseBill_to -> AccountPurchaseBill_to -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AccountPurchaseBill_to where
    toJSON :: AccountPurchaseBill_to -> Value
toJSON (AccountPurchaseBill_toOther Value
val) = Value
val
    toJSON (AccountPurchaseBill_toTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AccountPurchaseBill_to
AccountPurchaseBill_toEnumParent) = Value
"parent"
    toJSON (AccountPurchaseBill_to
AccountPurchaseBill_toEnumSelf) = Value
"self"
instance Data.Aeson.Types.FromJSON.FromJSON AccountPurchaseBill_to where
    parseJSON :: Value -> Parser AccountPurchaseBill_to
parseJSON Value
val =
        AccountPurchaseBill_to -> Parser AccountPurchaseBill_to
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
"parent" -> AccountPurchaseBill_to
AccountPurchaseBill_toEnumParent
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"self" -> AccountPurchaseBill_to
AccountPurchaseBill_toEnumSelf
                | Bool
GHC.Base.otherwise -> Value -> AccountPurchaseBill_to
AccountPurchaseBill_toOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AccountPurchase.allOf.properties.preferred_locale@ in the specification.

Used to determine the language and locale of emails sent on behalf of the merchant to the customer. The list of locales is restricted to those the merchant has enabled on the site.
-}
data AccountPurchasePreferred_locale
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AccountPurchasePreferred_localeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      AccountPurchasePreferred_localeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"da-DK"@
      AccountPurchasePreferred_localeEnumDa_DK
    | -- | Represents the JSON value @"de-CH"@
      AccountPurchasePreferred_localeEnumDe_CH
    | -- | Represents the JSON value @"de-DE"@
      AccountPurchasePreferred_localeEnumDe_DE
    | -- | Represents the JSON value @"en-AU"@
      AccountPurchasePreferred_localeEnumEn_AU
    | -- | Represents the JSON value @"en-CA"@
      AccountPurchasePreferred_localeEnumEn_CA
    | -- | Represents the JSON value @"en-GB"@
      AccountPurchasePreferred_localeEnumEn_GB
    | -- | Represents the JSON value @"en-IE"@
      AccountPurchasePreferred_localeEnumEn_IE
    | -- | Represents the JSON value @"en-NZ"@
      AccountPurchasePreferred_localeEnumEn_NZ
    | -- | Represents the JSON value @"en-US"@
      AccountPurchasePreferred_localeEnumEn_US
    | -- | Represents the JSON value @"es-ES"@
      AccountPurchasePreferred_localeEnumEs_ES
    | -- | Represents the JSON value @"es-MX"@
      AccountPurchasePreferred_localeEnumEs_MX
    | -- | Represents the JSON value @"es-US"@
      AccountPurchasePreferred_localeEnumEs_US
    | -- | Represents the JSON value @"fi-FI"@
      AccountPurchasePreferred_localeEnumFi_FI
    | -- | Represents the JSON value @"fr-BE"@
      AccountPurchasePreferred_localeEnumFr_BE
    | -- | Represents the JSON value @"fr-CA"@
      AccountPurchasePreferred_localeEnumFr_CA
    | -- | Represents the JSON value @"fr-CH"@
      AccountPurchasePreferred_localeEnumFr_CH
    | -- | Represents the JSON value @"fr-FR"@
      AccountPurchasePreferred_localeEnumFr_FR
    | -- | Represents the JSON value @"hi-IN"@
      AccountPurchasePreferred_localeEnumHi_IN
    | -- | Represents the JSON value @"it-IT"@
      AccountPurchasePreferred_localeEnumIt_IT
    | -- | Represents the JSON value @"ja-JP"@
      AccountPurchasePreferred_localeEnumJa_JP
    | -- | Represents the JSON value @"ko-KR"@
      AccountPurchasePreferred_localeEnumKo_KR
    | -- | Represents the JSON value @"nl-BE"@
      AccountPurchasePreferred_localeEnumNl_BE
    | -- | Represents the JSON value @"nl-NL"@
      AccountPurchasePreferred_localeEnumNl_NL
    | -- | Represents the JSON value @"pl-PL"@
      AccountPurchasePreferred_localeEnumPl_PL
    | -- | Represents the JSON value @"pt-BR"@
      AccountPurchasePreferred_localeEnumPt_BR
    | -- | Represents the JSON value @"pt-PT"@
      AccountPurchasePreferred_localeEnumPt_PT
    | -- | Represents the JSON value @"ro-RO"@
      AccountPurchasePreferred_localeEnumRo_RO
    | -- | Represents the JSON value @"ru-RU"@
      AccountPurchasePreferred_localeEnumRu_RU
    | -- | Represents the JSON value @"sk-SK"@
      AccountPurchasePreferred_localeEnumSk_SK
    | -- | Represents the JSON value @"sv-SE"@
      AccountPurchasePreferred_localeEnumSv_SE
    | -- | Represents the JSON value @"tr-TR"@
      AccountPurchasePreferred_localeEnumTr_TR
    | -- | Represents the JSON value @"zh-CN"@
      AccountPurchasePreferred_localeEnumZh_CN
    deriving (Int -> AccountPurchasePreferred_locale -> ShowS
[AccountPurchasePreferred_locale] -> ShowS
AccountPurchasePreferred_locale -> String
(Int -> AccountPurchasePreferred_locale -> ShowS)
-> (AccountPurchasePreferred_locale -> String)
-> ([AccountPurchasePreferred_locale] -> ShowS)
-> Show AccountPurchasePreferred_locale
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountPurchasePreferred_locale -> ShowS
showsPrec :: Int -> AccountPurchasePreferred_locale -> ShowS
$cshow :: AccountPurchasePreferred_locale -> String
show :: AccountPurchasePreferred_locale -> String
$cshowList :: [AccountPurchasePreferred_locale] -> ShowS
showList :: [AccountPurchasePreferred_locale] -> ShowS
GHC.Show.Show, AccountPurchasePreferred_locale
-> AccountPurchasePreferred_locale -> Bool
(AccountPurchasePreferred_locale
 -> AccountPurchasePreferred_locale -> Bool)
-> (AccountPurchasePreferred_locale
    -> AccountPurchasePreferred_locale -> Bool)
-> Eq AccountPurchasePreferred_locale
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AccountPurchasePreferred_locale
-> AccountPurchasePreferred_locale -> Bool
== :: AccountPurchasePreferred_locale
-> AccountPurchasePreferred_locale -> Bool
$c/= :: AccountPurchasePreferred_locale
-> AccountPurchasePreferred_locale -> Bool
/= :: AccountPurchasePreferred_locale
-> AccountPurchasePreferred_locale -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AccountPurchasePreferred_locale where
    toJSON :: AccountPurchasePreferred_locale -> Value
toJSON (AccountPurchasePreferred_localeOther Value
val) = Value
val
    toJSON (AccountPurchasePreferred_localeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumDa_DK) = Value
"da-DK"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumDe_CH) = Value
"de-CH"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumDe_DE) = Value
"de-DE"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_AU) = Value
"en-AU"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_CA) = Value
"en-CA"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_GB) = Value
"en-GB"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_IE) = Value
"en-IE"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_NZ) = Value
"en-NZ"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_US) = Value
"en-US"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEs_ES) = Value
"es-ES"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEs_MX) = Value
"es-MX"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEs_US) = Value
"es-US"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFi_FI) = Value
"fi-FI"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_BE) = Value
"fr-BE"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_CA) = Value
"fr-CA"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_CH) = Value
"fr-CH"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_FR) = Value
"fr-FR"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumHi_IN) = Value
"hi-IN"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumIt_IT) = Value
"it-IT"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumJa_JP) = Value
"ja-JP"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumKo_KR) = Value
"ko-KR"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumNl_BE) = Value
"nl-BE"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumNl_NL) = Value
"nl-NL"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumPl_PL) = Value
"pl-PL"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumPt_BR) = Value
"pt-BR"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumPt_PT) = Value
"pt-PT"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumRo_RO) = Value
"ro-RO"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumRu_RU) = Value
"ru-RU"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumSk_SK) = Value
"sk-SK"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumSv_SE) = Value
"sv-SE"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumTr_TR) = Value
"tr-TR"
    toJSON (AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumZh_CN) = Value
"zh-CN"
instance Data.Aeson.Types.FromJSON.FromJSON AccountPurchasePreferred_locale where
    parseJSON :: Value -> Parser AccountPurchasePreferred_locale
parseJSON Value
val =
        AccountPurchasePreferred_locale
-> Parser AccountPurchasePreferred_locale
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
"da-DK" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumDa_DK
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"de-CH" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumDe_CH
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"de-DE" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumDe_DE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-AU" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_AU
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-CA" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_CA
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-GB" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_GB
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-IE" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_IE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-NZ" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_NZ
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-US" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEn_US
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"es-ES" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEs_ES
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"es-MX" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEs_MX
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"es-US" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumEs_US
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fi-FI" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFi_FI
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-BE" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_BE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-CA" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_CA
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-CH" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_CH
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-FR" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumFr_FR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"hi-IN" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumHi_IN
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"it-IT" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumIt_IT
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ja-JP" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumJa_JP
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ko-KR" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumKo_KR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"nl-BE" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumNl_BE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"nl-NL" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumNl_NL
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pl-PL" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumPl_PL
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pt-BR" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumPt_BR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pt-PT" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumPt_PT
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ro-RO" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumRo_RO
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ru-RU" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumRu_RU
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sk-SK" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumSk_SK
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sv-SE" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumSv_SE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"tr-TR" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumTr_TR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"zh-CN" -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeEnumZh_CN
                | Bool
GHC.Base.otherwise -> Value -> AccountPurchasePreferred_locale
AccountPurchasePreferred_localeOther Value
val
            )

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

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

instance Data.Aeson.Types.ToJSON.ToJSON AccountPurchaseTransaction_type where
    toJSON :: AccountPurchaseTransaction_type -> Value
toJSON (AccountPurchaseTransaction_typeOther Value
val) = Value
val
    toJSON (AccountPurchaseTransaction_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AccountPurchaseTransaction_type
AccountPurchaseTransaction_typeEnumMoto) = Value
"moto"
instance Data.Aeson.Types.FromJSON.FromJSON AccountPurchaseTransaction_type where
    parseJSON :: Value -> Parser AccountPurchaseTransaction_type
parseJSON Value
val =
        AccountPurchaseTransaction_type
-> Parser AccountPurchaseTransaction_type
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"moto" -> AccountPurchaseTransaction_type
AccountPurchaseTransaction_typeEnumMoto
                | Bool
GHC.Base.otherwise -> Value -> AccountPurchaseTransaction_type
AccountPurchaseTransaction_typeOther Value
val
            )