{-# 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 AccountUpdate
module RecurlyClient.Types.AccountUpdate 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.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.AccountUpdate@ in the specification.
data AccountUpdate = AccountUpdate
    { AccountUpdate -> Maybe Address
accountUpdateAddress :: (GHC.Maybe.Maybe Address)
    -- ^ address
    , AccountUpdate -> Maybe AccountUpdateBill_to
accountUpdateBill_to :: (GHC.Maybe.Maybe AccountUpdateBill_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
    , AccountUpdate -> Maybe BillingInfoCreate
accountUpdateBilling_info :: (GHC.Maybe.Maybe BillingInfoCreate)
    -- ^ billing_info
    , AccountUpdate -> Maybe Text
accountUpdateCc_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
    , AccountUpdate -> Maybe Text
accountUpdateCompany :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ company
    --
    -- Constraints:
    --
    -- * Maximum length of 100
    , AccountUpdate -> Maybe CustomFields
accountUpdateCustom_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.
    , AccountUpdate -> Maybe Text
accountUpdateDunning_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.
    , AccountUpdate -> Maybe Text
accountUpdateEmail :: (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
    , AccountUpdate -> Maybe Text
accountUpdateEntity_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.
    , AccountUpdate -> Maybe Text
accountUpdateExemption_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
    , AccountUpdate -> Maybe Text
accountUpdateFirst_name :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ first_name
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountUpdate -> Maybe Text
accountUpdateInvoice_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.
    , AccountUpdate -> Maybe Text
accountUpdateLast_name :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ last_name
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountUpdate -> Maybe Text
accountUpdateOverride_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.
    , AccountUpdate -> Maybe Text
accountUpdateParent_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
    , AccountUpdate -> Maybe Text
accountUpdateParent_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
    , AccountUpdate -> Maybe AccountUpdatePreferred_locale
accountUpdatePreferred_locale :: (GHC.Maybe.Maybe AccountUpdatePreferred_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.
    , AccountUpdate -> Maybe Text
accountUpdatePreferred_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)
    , AccountUpdate -> Maybe Bool
accountUpdateTax_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.
    , AccountUpdate -> Maybe AccountUpdateTransaction_type
accountUpdateTransaction_type :: (GHC.Maybe.Maybe AccountUpdateTransaction_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.
    , AccountUpdate -> Maybe Text
accountUpdateUsername :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ username: A secondary value for the account.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , AccountUpdate -> Maybe Text
accountUpdateVat_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 -> AccountUpdate -> ShowS
[AccountUpdate] -> ShowS
AccountUpdate -> String
(Int -> AccountUpdate -> ShowS)
-> (AccountUpdate -> String)
-> ([AccountUpdate] -> ShowS)
-> Show AccountUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountUpdate -> ShowS
showsPrec :: Int -> AccountUpdate -> ShowS
$cshow :: AccountUpdate -> String
show :: AccountUpdate -> String
$cshowList :: [AccountUpdate] -> ShowS
showList :: [AccountUpdate] -> ShowS
GHC.Show.Show
        , AccountUpdate -> AccountUpdate -> Bool
(AccountUpdate -> AccountUpdate -> Bool)
-> (AccountUpdate -> AccountUpdate -> Bool) -> Eq AccountUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AccountUpdate -> AccountUpdate -> Bool
== :: AccountUpdate -> AccountUpdate -> Bool
$c/= :: AccountUpdate -> AccountUpdate -> Bool
/= :: AccountUpdate -> AccountUpdate -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON AccountUpdate where
    toJSON :: AccountUpdate -> Value
toJSON AccountUpdate
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([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..=)) (AccountUpdate -> Maybe Address
accountUpdateAddress AccountUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AccountUpdateBill_to -> [Pair])
-> Maybe AccountUpdateBill_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])
-> (AccountUpdateBill_to -> Pair) -> AccountUpdateBill_to -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"bill_to" Key -> AccountUpdateBill_to -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountUpdate -> Maybe AccountUpdateBill_to
accountUpdateBill_to AccountUpdate
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..=)) (AccountUpdate -> Maybe BillingInfoCreate
accountUpdateBilling_info AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateCc_emails AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateCompany AccountUpdate
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..=)) (AccountUpdate -> Maybe CustomFields
accountUpdateCustom_fields AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateDunning_campaign_id AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateEmail AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateEntity_use_code AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateExemption_certificate AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateFirst_name AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateInvoice_template_id AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateLast_name AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateOverride_business_entity_id AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateParent_account_code AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateParent_account_id AccountUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AccountUpdatePreferred_locale -> [Pair])
-> Maybe AccountUpdatePreferred_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])
-> (AccountUpdatePreferred_locale -> Pair)
-> AccountUpdatePreferred_locale
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"preferred_locale" Key -> AccountUpdatePreferred_locale -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountUpdate -> Maybe AccountUpdatePreferred_locale
accountUpdatePreferred_locale AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdatePreferred_time_zone AccountUpdate
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..=)) (AccountUpdate -> Maybe Bool
accountUpdateTax_exempt AccountUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (AccountUpdateTransaction_type -> [Pair])
-> Maybe AccountUpdateTransaction_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])
-> (AccountUpdateTransaction_type -> Pair)
-> AccountUpdateTransaction_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transaction_type" Key -> AccountUpdateTransaction_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (AccountUpdate -> Maybe AccountUpdateTransaction_type
accountUpdateTransaction_type AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateUsername AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateVat_number AccountUpdate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: AccountUpdate -> Encoding
toEncoding AccountUpdate
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] -> (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..=)) (AccountUpdate -> Maybe Address
accountUpdateAddress AccountUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AccountUpdateBill_to -> [Series])
-> Maybe AccountUpdateBill_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])
-> (AccountUpdateBill_to -> Series)
-> AccountUpdateBill_to
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"bill_to" Key -> AccountUpdateBill_to -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountUpdate -> Maybe AccountUpdateBill_to
accountUpdateBill_to AccountUpdate
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..=)) (AccountUpdate -> Maybe BillingInfoCreate
accountUpdateBilling_info AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateCc_emails AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateCompany AccountUpdate
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..=)) (AccountUpdate -> Maybe CustomFields
accountUpdateCustom_fields AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateDunning_campaign_id AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateEmail AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateEntity_use_code AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateExemption_certificate AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateFirst_name AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateInvoice_template_id AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateLast_name AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateOverride_business_entity_id AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateParent_account_code AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateParent_account_id AccountUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AccountUpdatePreferred_locale -> [Series])
-> Maybe AccountUpdatePreferred_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])
-> (AccountUpdatePreferred_locale -> Series)
-> AccountUpdatePreferred_locale
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"preferred_locale" Key -> AccountUpdatePreferred_locale -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountUpdate -> Maybe AccountUpdatePreferred_locale
accountUpdatePreferred_locale AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdatePreferred_time_zone AccountUpdate
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..=)) (AccountUpdate -> Maybe Bool
accountUpdateTax_exempt AccountUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (AccountUpdateTransaction_type -> [Series])
-> Maybe AccountUpdateTransaction_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])
-> (AccountUpdateTransaction_type -> Series)
-> AccountUpdateTransaction_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transaction_type" Key -> AccountUpdateTransaction_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (AccountUpdate -> Maybe AccountUpdateTransaction_type
accountUpdateTransaction_type AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateUsername AccountUpdate
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..=)) (AccountUpdate -> Maybe Text
accountUpdateVat_number AccountUpdate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON AccountUpdate where
    parseJSON :: Value -> Parser AccountUpdate
parseJSON = String
-> (Object -> Parser AccountUpdate)
-> Value
-> Parser AccountUpdate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"AccountUpdate" (\Object
obj -> ((((((((((((((((((((((Maybe Address
 -> Maybe AccountUpdateBill_to
 -> Maybe BillingInfoCreate
 -> Maybe 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 AccountUpdatePreferred_locale
 -> Maybe Text
 -> Maybe Bool
 -> Maybe AccountUpdateTransaction_type
 -> Maybe Text
 -> Maybe Text
 -> AccountUpdate)
-> Parser
     (Maybe Address
      -> Maybe AccountUpdateBill_to
      -> Maybe BillingInfoCreate
      -> Maybe 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 AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Address
-> Maybe AccountUpdateBill_to
-> Maybe BillingInfoCreate
-> Maybe 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 AccountUpdatePreferred_locale
-> Maybe Text
-> Maybe Bool
-> Maybe AccountUpdateTransaction_type
-> Maybe Text
-> Maybe Text
-> AccountUpdate
AccountUpdate Parser
  (Maybe Address
   -> Maybe AccountUpdateBill_to
   -> Maybe BillingInfoCreate
   -> Maybe 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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Address)
-> Parser
     (Maybe AccountUpdateBill_to
      -> Maybe BillingInfoCreate
      -> Maybe 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 AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdateBill_to
   -> Maybe BillingInfoCreate
   -> Maybe 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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe AccountUpdateBill_to)
-> Parser
     (Maybe BillingInfoCreate
      -> Maybe 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 AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdateBill_to)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"bill_to")) Parser
  (Maybe BillingInfoCreate
   -> Maybe 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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe BillingInfoCreate)
-> Parser
     (Maybe 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 AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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
   -> 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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe 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 AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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
  (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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> 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 AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> 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 AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe AccountUpdatePreferred_locale
      -> Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale
   -> Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe AccountUpdatePreferred_locale)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdatePreferred_locale)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"preferred_locale")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe AccountUpdateTransaction_type
      -> Maybe Text
      -> Maybe Text
      -> AccountUpdate)
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 AccountUpdateTransaction_type
   -> Maybe Text
   -> Maybe Text
   -> AccountUpdate)
-> Parser (Maybe Bool)
-> Parser
     (Maybe AccountUpdateTransaction_type
      -> Maybe Text -> Maybe Text -> AccountUpdate)
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 AccountUpdateTransaction_type
   -> Maybe Text -> Maybe Text -> AccountUpdate)
-> Parser (Maybe AccountUpdateTransaction_type)
-> Parser (Maybe Text -> Maybe Text -> AccountUpdate)
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 AccountUpdateTransaction_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"transaction_type")) Parser (Maybe Text -> Maybe Text -> AccountUpdate)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AccountUpdate)
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 -> AccountUpdate)
-> Parser (Maybe Text) -> Parser AccountUpdate
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 'AccountUpdate' with all required fields.
mkAccountUpdate :: AccountUpdate
mkAccountUpdate :: AccountUpdate
mkAccountUpdate =
    AccountUpdate
        { accountUpdateAddress :: Maybe Address
accountUpdateAddress = Maybe Address
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateBill_to :: Maybe AccountUpdateBill_to
accountUpdateBill_to = Maybe AccountUpdateBill_to
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateBilling_info :: Maybe BillingInfoCreate
accountUpdateBilling_info = Maybe BillingInfoCreate
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateCc_emails :: Maybe Text
accountUpdateCc_emails = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateCompany :: Maybe Text
accountUpdateCompany = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateCustom_fields :: Maybe CustomFields
accountUpdateCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateDunning_campaign_id :: Maybe Text
accountUpdateDunning_campaign_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateEmail :: Maybe Text
accountUpdateEmail = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateEntity_use_code :: Maybe Text
accountUpdateEntity_use_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateExemption_certificate :: Maybe Text
accountUpdateExemption_certificate = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateFirst_name :: Maybe Text
accountUpdateFirst_name = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateInvoice_template_id :: Maybe Text
accountUpdateInvoice_template_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateLast_name :: Maybe Text
accountUpdateLast_name = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateOverride_business_entity_id :: Maybe Text
accountUpdateOverride_business_entity_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateParent_account_code :: Maybe Text
accountUpdateParent_account_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateParent_account_id :: Maybe Text
accountUpdateParent_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdatePreferred_locale :: Maybe AccountUpdatePreferred_locale
accountUpdatePreferred_locale = Maybe AccountUpdatePreferred_locale
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdatePreferred_time_zone :: Maybe Text
accountUpdatePreferred_time_zone = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateTax_exempt :: Maybe Bool
accountUpdateTax_exempt = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateTransaction_type :: Maybe AccountUpdateTransaction_type
accountUpdateTransaction_type = Maybe AccountUpdateTransaction_type
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateUsername :: Maybe Text
accountUpdateUsername = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , accountUpdateVat_number :: Maybe Text
accountUpdateVat_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        }

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

instance Data.Aeson.Types.ToJSON.ToJSON AccountUpdateBill_to where
    toJSON :: AccountUpdateBill_to -> Value
toJSON (AccountUpdateBill_toOther Value
val) = Value
val
    toJSON (AccountUpdateBill_toTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AccountUpdateBill_to
AccountUpdateBill_toEnumParent) = Value
"parent"
    toJSON (AccountUpdateBill_to
AccountUpdateBill_toEnumSelf) = Value
"self"
instance Data.Aeson.Types.FromJSON.FromJSON AccountUpdateBill_to where
    parseJSON :: Value -> Parser AccountUpdateBill_to
parseJSON Value
val =
        AccountUpdateBill_to -> Parser AccountUpdateBill_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" -> AccountUpdateBill_to
AccountUpdateBill_toEnumParent
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"self" -> AccountUpdateBill_to
AccountUpdateBill_toEnumSelf
                | Bool
GHC.Base.otherwise -> Value -> AccountUpdateBill_to
AccountUpdateBill_toOther Value
val
            )

{- | Defines the enum schema located at @components.schemas.AccountUpdate.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 AccountUpdatePreferred_locale
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      AccountUpdatePreferred_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.
      AccountUpdatePreferred_localeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"da-DK"@
      AccountUpdatePreferred_localeEnumDa_DK
    | -- | Represents the JSON value @"de-CH"@
      AccountUpdatePreferred_localeEnumDe_CH
    | -- | Represents the JSON value @"de-DE"@
      AccountUpdatePreferred_localeEnumDe_DE
    | -- | Represents the JSON value @"en-AU"@
      AccountUpdatePreferred_localeEnumEn_AU
    | -- | Represents the JSON value @"en-CA"@
      AccountUpdatePreferred_localeEnumEn_CA
    | -- | Represents the JSON value @"en-GB"@
      AccountUpdatePreferred_localeEnumEn_GB
    | -- | Represents the JSON value @"en-IE"@
      AccountUpdatePreferred_localeEnumEn_IE
    | -- | Represents the JSON value @"en-NZ"@
      AccountUpdatePreferred_localeEnumEn_NZ
    | -- | Represents the JSON value @"en-US"@
      AccountUpdatePreferred_localeEnumEn_US
    | -- | Represents the JSON value @"es-ES"@
      AccountUpdatePreferred_localeEnumEs_ES
    | -- | Represents the JSON value @"es-MX"@
      AccountUpdatePreferred_localeEnumEs_MX
    | -- | Represents the JSON value @"es-US"@
      AccountUpdatePreferred_localeEnumEs_US
    | -- | Represents the JSON value @"fi-FI"@
      AccountUpdatePreferred_localeEnumFi_FI
    | -- | Represents the JSON value @"fr-BE"@
      AccountUpdatePreferred_localeEnumFr_BE
    | -- | Represents the JSON value @"fr-CA"@
      AccountUpdatePreferred_localeEnumFr_CA
    | -- | Represents the JSON value @"fr-CH"@
      AccountUpdatePreferred_localeEnumFr_CH
    | -- | Represents the JSON value @"fr-FR"@
      AccountUpdatePreferred_localeEnumFr_FR
    | -- | Represents the JSON value @"hi-IN"@
      AccountUpdatePreferred_localeEnumHi_IN
    | -- | Represents the JSON value @"it-IT"@
      AccountUpdatePreferred_localeEnumIt_IT
    | -- | Represents the JSON value @"ja-JP"@
      AccountUpdatePreferred_localeEnumJa_JP
    | -- | Represents the JSON value @"ko-KR"@
      AccountUpdatePreferred_localeEnumKo_KR
    | -- | Represents the JSON value @"nl-BE"@
      AccountUpdatePreferred_localeEnumNl_BE
    | -- | Represents the JSON value @"nl-NL"@
      AccountUpdatePreferred_localeEnumNl_NL
    | -- | Represents the JSON value @"pl-PL"@
      AccountUpdatePreferred_localeEnumPl_PL
    | -- | Represents the JSON value @"pt-BR"@
      AccountUpdatePreferred_localeEnumPt_BR
    | -- | Represents the JSON value @"pt-PT"@
      AccountUpdatePreferred_localeEnumPt_PT
    | -- | Represents the JSON value @"ro-RO"@
      AccountUpdatePreferred_localeEnumRo_RO
    | -- | Represents the JSON value @"ru-RU"@
      AccountUpdatePreferred_localeEnumRu_RU
    | -- | Represents the JSON value @"sk-SK"@
      AccountUpdatePreferred_localeEnumSk_SK
    | -- | Represents the JSON value @"sv-SE"@
      AccountUpdatePreferred_localeEnumSv_SE
    | -- | Represents the JSON value @"tr-TR"@
      AccountUpdatePreferred_localeEnumTr_TR
    | -- | Represents the JSON value @"zh-CN"@
      AccountUpdatePreferred_localeEnumZh_CN
    deriving (Int -> AccountUpdatePreferred_locale -> ShowS
[AccountUpdatePreferred_locale] -> ShowS
AccountUpdatePreferred_locale -> String
(Int -> AccountUpdatePreferred_locale -> ShowS)
-> (AccountUpdatePreferred_locale -> String)
-> ([AccountUpdatePreferred_locale] -> ShowS)
-> Show AccountUpdatePreferred_locale
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AccountUpdatePreferred_locale -> ShowS
showsPrec :: Int -> AccountUpdatePreferred_locale -> ShowS
$cshow :: AccountUpdatePreferred_locale -> String
show :: AccountUpdatePreferred_locale -> String
$cshowList :: [AccountUpdatePreferred_locale] -> ShowS
showList :: [AccountUpdatePreferred_locale] -> ShowS
GHC.Show.Show, AccountUpdatePreferred_locale
-> AccountUpdatePreferred_locale -> Bool
(AccountUpdatePreferred_locale
 -> AccountUpdatePreferred_locale -> Bool)
-> (AccountUpdatePreferred_locale
    -> AccountUpdatePreferred_locale -> Bool)
-> Eq AccountUpdatePreferred_locale
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AccountUpdatePreferred_locale
-> AccountUpdatePreferred_locale -> Bool
== :: AccountUpdatePreferred_locale
-> AccountUpdatePreferred_locale -> Bool
$c/= :: AccountUpdatePreferred_locale
-> AccountUpdatePreferred_locale -> Bool
/= :: AccountUpdatePreferred_locale
-> AccountUpdatePreferred_locale -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON AccountUpdatePreferred_locale where
    toJSON :: AccountUpdatePreferred_locale -> Value
toJSON (AccountUpdatePreferred_localeOther Value
val) = Value
val
    toJSON (AccountUpdatePreferred_localeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumDa_DK) = Value
"da-DK"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumDe_CH) = Value
"de-CH"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumDe_DE) = Value
"de-DE"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_AU) = Value
"en-AU"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_CA) = Value
"en-CA"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_GB) = Value
"en-GB"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_IE) = Value
"en-IE"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_NZ) = Value
"en-NZ"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_US) = Value
"en-US"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEs_ES) = Value
"es-ES"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEs_MX) = Value
"es-MX"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEs_US) = Value
"es-US"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFi_FI) = Value
"fi-FI"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_BE) = Value
"fr-BE"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_CA) = Value
"fr-CA"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_CH) = Value
"fr-CH"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_FR) = Value
"fr-FR"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumHi_IN) = Value
"hi-IN"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumIt_IT) = Value
"it-IT"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumJa_JP) = Value
"ja-JP"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumKo_KR) = Value
"ko-KR"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumNl_BE) = Value
"nl-BE"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumNl_NL) = Value
"nl-NL"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumPl_PL) = Value
"pl-PL"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumPt_BR) = Value
"pt-BR"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumPt_PT) = Value
"pt-PT"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumRo_RO) = Value
"ro-RO"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumRu_RU) = Value
"ru-RU"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumSk_SK) = Value
"sk-SK"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumSv_SE) = Value
"sv-SE"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumTr_TR) = Value
"tr-TR"
    toJSON (AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumZh_CN) = Value
"zh-CN"
instance Data.Aeson.Types.FromJSON.FromJSON AccountUpdatePreferred_locale where
    parseJSON :: Value -> Parser AccountUpdatePreferred_locale
parseJSON Value
val =
        AccountUpdatePreferred_locale
-> Parser AccountUpdatePreferred_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" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumDa_DK
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"de-CH" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumDe_CH
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"de-DE" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumDe_DE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-AU" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_AU
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-CA" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_CA
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-GB" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_GB
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-IE" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_IE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-NZ" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_NZ
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"en-US" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEn_US
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"es-ES" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEs_ES
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"es-MX" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEs_MX
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"es-US" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumEs_US
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fi-FI" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFi_FI
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-BE" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_BE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-CA" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_CA
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-CH" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_CH
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fr-FR" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumFr_FR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"hi-IN" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumHi_IN
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"it-IT" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumIt_IT
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ja-JP" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumJa_JP
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ko-KR" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumKo_KR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"nl-BE" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumNl_BE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"nl-NL" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumNl_NL
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pl-PL" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumPl_PL
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pt-BR" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumPt_BR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pt-PT" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumPt_PT
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ro-RO" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumRo_RO
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ru-RU" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumRu_RU
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sk-SK" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumSk_SK
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sv-SE" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumSv_SE
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"tr-TR" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumTr_TR
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"zh-CN" -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeEnumZh_CN
                | Bool
GHC.Base.otherwise -> Value -> AccountUpdatePreferred_locale
AccountUpdatePreferred_localeOther Value
val
            )

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

instance Data.Aeson.Types.ToJSON.ToJSON AccountUpdateTransaction_type where
    toJSON :: AccountUpdateTransaction_type -> Value
toJSON (AccountUpdateTransaction_typeOther Value
val) = Value
val
    toJSON (AccountUpdateTransaction_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (AccountUpdateTransaction_type
AccountUpdateTransaction_typeEnumMoto) = Value
"moto"
instance Data.Aeson.Types.FromJSON.FromJSON AccountUpdateTransaction_type where
    parseJSON :: Value -> Parser AccountUpdateTransaction_type
parseJSON Value
val =
        AccountUpdateTransaction_type
-> Parser AccountUpdateTransaction_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" -> AccountUpdateTransaction_type
AccountUpdateTransaction_typeEnumMoto
                | Bool
GHC.Base.otherwise -> Value -> AccountUpdateTransaction_type
AccountUpdateTransaction_typeOther Value
val
            )