{-# LANGUAGE ExplicitForAll #-}
{-# 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 different functions to run the operation postAccountBankAccountsId
module StripeAPI.Operations.PostAccountBankAccountsId where

import qualified Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
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.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Either
import qualified Data.Functor
import qualified Data.Scientific
import qualified Data.Text
import qualified 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 Data.Vector
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified Network.HTTP.Client
import qualified Network.HTTP.Client as Network.HTTP.Client.Request
import qualified Network.HTTP.Client as Network.HTTP.Client.Types
import qualified Network.HTTP.Simple
import qualified Network.HTTP.Types
import qualified Network.HTTP.Types as Network.HTTP.Types.Status
import qualified Network.HTTP.Types as Network.HTTP.Types.URI
import qualified StripeAPI.Common
import StripeAPI.Types
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | > POST /v1/account/bank_accounts/{id}
--
-- \<p>Updates the metadata, account holder name, and account holder type of a bank account belonging to a \<a href=\"\/docs\/connect\/custom-accounts\">Custom account\<\/a>, and optionally sets it as the default for its currency. Other bank account details are not editable by design.\<\/p>
--
-- \<p>You can re-enable a disabled bank account by performing an update call without providing any arguments or changes.\<\/p>
postAccountBankAccountsId ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | id
  Data.Text.Internal.Text ->
  -- | The request body to send
  GHC.Maybe.Maybe PostAccountBankAccountsIdRequestBody ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response PostAccountBankAccountsIdResponse)
postAccountBankAccountsId :: Text
-> Maybe PostAccountBankAccountsIdRequestBody
-> StripeT m (Response PostAccountBankAccountsIdResponse)
postAccountBankAccountsId
  Text
id
  Maybe PostAccountBankAccountsIdRequestBody
body =
    (Response ByteString -> Response PostAccountBankAccountsIdResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response PostAccountBankAccountsIdResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
      ( \Response ByteString
response_0 ->
          (ByteString -> PostAccountBankAccountsIdResponse)
-> Response ByteString
-> Response PostAccountBankAccountsIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
            ( (String -> PostAccountBankAccountsIdResponse)
-> (PostAccountBankAccountsIdResponse
    -> PostAccountBankAccountsIdResponse)
-> Either String PostAccountBankAccountsIdResponse
-> PostAccountBankAccountsIdResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostAccountBankAccountsIdResponse
PostAccountBankAccountsIdResponseError PostAccountBankAccountsIdResponse
-> PostAccountBankAccountsIdResponse
forall a. a -> a
GHC.Base.id
                (Either String PostAccountBankAccountsIdResponse
 -> PostAccountBankAccountsIdResponse)
-> (ByteString -> Either String PostAccountBankAccountsIdResponse)
-> ByteString
-> PostAccountBankAccountsIdResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. ( \Response ByteString
response ByteString
body ->
                               if
                                   | (\Status
status_1 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_1 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
200) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                     ExternalAccount -> PostAccountBankAccountsIdResponse
PostAccountBankAccountsIdResponse200
                                       (ExternalAccount -> PostAccountBankAccountsIdResponse)
-> Either String ExternalAccount
-> Either String PostAccountBankAccountsIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String ExternalAccount
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                            Data.Either.Either
                                                              GHC.Base.String
                                                              ExternalAccount
                                                        )
                                   | Bool -> Status -> Bool
forall a b. a -> b -> a
GHC.Base.const Bool
GHC.Types.True (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                     Error -> PostAccountBankAccountsIdResponse
PostAccountBankAccountsIdResponseDefault
                                       (Error -> PostAccountBankAccountsIdResponse)
-> Either String Error
-> Either String PostAccountBankAccountsIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String Error
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                            Data.Either.Either
                                                              GHC.Base.String
                                                              Error
                                                        )
                                   | Bool
GHC.Base.otherwise -> String -> Either String PostAccountBankAccountsIdResponse
forall a b. a -> Either a b
Data.Either.Left String
"Missing default response type"
                           )
                  Response ByteString
response_0
            )
            Response ByteString
response_0
      )
      (Text
-> Text
-> [QueryParameter]
-> Maybe PostAccountBankAccountsIdRequestBody
-> RequestBodyEncoding
-> StripeT m (Response ByteString)
forall (m :: * -> *) body.
(MonadHTTP m, ToJSON body) =>
Text
-> Text
-> [QueryParameter]
-> Maybe body
-> RequestBodyEncoding
-> StripeT m (Response ByteString)
StripeAPI.Common.doBodyCallWithConfigurationM (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"POST") (String -> Text
Data.Text.pack (String
"/v1/account/bank_accounts/" String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ (ByteString -> String
Data.ByteString.Char8.unpack (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (String -> ByteString
Data.ByteString.Char8.pack (String -> ByteString) -> String -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> String
forall a. StringifyModel a => a -> String
StripeAPI.Common.stringifyModel Text
id)) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
""))) [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty Maybe PostAccountBankAccountsIdRequestBody
body RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)

-- | Defines the object schema located at @paths.\/v1\/account\/bank_accounts\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification.
data PostAccountBankAccountsIdRequestBody = PostAccountBankAccountsIdRequestBody
  { -- | account_holder_name: The name of the person or business that owns the bank account.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAccountHolderName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | account_holder_type: The type of entity that holds the account. This can be either \`individual\` or \`company\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody
-> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
postAccountBankAccountsIdRequestBodyAccountHolderType :: (GHC.Maybe.Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'),
    -- | address_city: City\/District\/Suburb\/Town\/Village.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressCity :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | address_country: Billing address country, if provided when creating card.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressCountry :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | address_line1: Address line 1 (Street address\/PO Box\/Company name).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | address_line2: Address line 2 (Apartment\/Suite\/Unit\/Building).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | address_state: State\/County\/Province\/Region.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressState :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | address_zip: ZIP or postal code.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressZip :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | default_for_currency: When set to true, this becomes the default external account for its currency.
    PostAccountBankAccountsIdRequestBody -> Maybe Bool
postAccountBankAccountsIdRequestBodyDefaultForCurrency :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | exp_month: Two digit number representing the card’s expiration month.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyExpMonth :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | exp_year: Four digit number representing the card’s expiration year.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyExpYear :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | expand: Specifies which fields in the response should be expanded.
    PostAccountBankAccountsIdRequestBody -> Maybe [Text]
postAccountBankAccountsIdRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
    -- | metadata: Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`.
    PostAccountBankAccountsIdRequestBody
-> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
postAccountBankAccountsIdRequestBodyMetadata :: (GHC.Maybe.Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants),
    -- | name: Cardholder name.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyName :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> PostAccountBankAccountsIdRequestBody -> String -> String
[PostAccountBankAccountsIdRequestBody] -> String -> String
PostAccountBankAccountsIdRequestBody -> String
(Int -> PostAccountBankAccountsIdRequestBody -> String -> String)
-> (PostAccountBankAccountsIdRequestBody -> String)
-> ([PostAccountBankAccountsIdRequestBody] -> String -> String)
-> Show PostAccountBankAccountsIdRequestBody
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostAccountBankAccountsIdRequestBody] -> String -> String
$cshowList :: [PostAccountBankAccountsIdRequestBody] -> String -> String
show :: PostAccountBankAccountsIdRequestBody -> String
$cshow :: PostAccountBankAccountsIdRequestBody -> String
showsPrec :: Int -> PostAccountBankAccountsIdRequestBody -> String -> String
$cshowsPrec :: Int -> PostAccountBankAccountsIdRequestBody -> String -> String
GHC.Show.Show,
      PostAccountBankAccountsIdRequestBody
-> PostAccountBankAccountsIdRequestBody -> Bool
(PostAccountBankAccountsIdRequestBody
 -> PostAccountBankAccountsIdRequestBody -> Bool)
-> (PostAccountBankAccountsIdRequestBody
    -> PostAccountBankAccountsIdRequestBody -> Bool)
-> Eq PostAccountBankAccountsIdRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostAccountBankAccountsIdRequestBody
-> PostAccountBankAccountsIdRequestBody -> Bool
$c/= :: PostAccountBankAccountsIdRequestBody
-> PostAccountBankAccountsIdRequestBody -> Bool
== :: PostAccountBankAccountsIdRequestBody
-> PostAccountBankAccountsIdRequestBody -> Bool
$c== :: PostAccountBankAccountsIdRequestBody
-> PostAccountBankAccountsIdRequestBody -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostAccountBankAccountsIdRequestBody where
  toJSON :: PostAccountBankAccountsIdRequestBody -> Value
toJSON PostAccountBankAccountsIdRequestBody
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"account_holder_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAccountHolderName PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"account_holder_type" Text
-> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody
-> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
postAccountBankAccountsIdRequestBodyAccountHolderType PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_city" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressCity PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_country" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressCountry PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_line1" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine1 PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_line2" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine2 PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_state" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressState PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"address_zip" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressZip PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"default_for_currency" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Bool
postAccountBankAccountsIdRequestBodyDefaultForCurrency PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"exp_month" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyExpMonth PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"exp_year" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyExpYear PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"expand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe [Text]
postAccountBankAccountsIdRequestBodyExpand PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text
-> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody
-> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
postAccountBankAccountsIdRequestBodyMetadata PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyName PostAccountBankAccountsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostAccountBankAccountsIdRequestBody -> Encoding
toEncoding PostAccountBankAccountsIdRequestBody
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"account_holder_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAccountHolderName PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"account_holder_type" Text
-> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody
-> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
postAccountBankAccountsIdRequestBodyAccountHolderType PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_city" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressCity PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_country" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressCountry PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_line1" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine1 PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_line2" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine2 PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_state" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressState PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"address_zip" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyAddressZip PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"default_for_currency" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Bool
postAccountBankAccountsIdRequestBodyDefaultForCurrency PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"exp_month" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyExpMonth PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"exp_year" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyExpYear PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"expand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe [Text]
postAccountBankAccountsIdRequestBodyExpand PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text
-> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody
-> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
postAccountBankAccountsIdRequestBodyMetadata PostAccountBankAccountsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostAccountBankAccountsIdRequestBody -> Maybe Text
postAccountBankAccountsIdRequestBodyName PostAccountBankAccountsIdRequestBody
obj))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountBankAccountsIdRequestBody where
  parseJSON :: Value -> Parser PostAccountBankAccountsIdRequestBody
parseJSON = String
-> (Object -> Parser PostAccountBankAccountsIdRequestBody)
-> Value
-> Parser PostAccountBankAccountsIdRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostAccountBankAccountsIdRequestBody" (\Object
obj -> ((((((((((((((Maybe Text
 -> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
 -> Maybe Text
 -> PostAccountBankAccountsIdRequestBody)
-> Parser
     (Maybe Text
      -> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Maybe Text
-> PostAccountBankAccountsIdRequestBody
PostAccountBankAccountsIdRequestBody Parser
  (Maybe Text
   -> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"account_holder_name")) Parser
  (Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser
     (Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType')
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"account_holder_type")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_city")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_country")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_line1")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_line2")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_state")) Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address_zip")) Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"default_for_currency")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"exp_month")) Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text
      -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"exp_year")) Parser
  (Maybe [Text]
   -> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text
   -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe [Text])
-> Parser
     (Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
      -> Maybe Text -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"expand")) Parser
  (Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
   -> Maybe Text -> PostAccountBankAccountsIdRequestBody)
-> Parser
     (Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants)
-> Parser (Maybe Text -> PostAccountBankAccountsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser (Maybe Text -> PostAccountBankAccountsIdRequestBody)
-> Parser (Maybe Text)
-> Parser PostAccountBankAccountsIdRequestBody
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"name"))

-- | Create a new 'PostAccountBankAccountsIdRequestBody' with all required fields.
mkPostAccountBankAccountsIdRequestBody :: PostAccountBankAccountsIdRequestBody
mkPostAccountBankAccountsIdRequestBody :: PostAccountBankAccountsIdRequestBody
mkPostAccountBankAccountsIdRequestBody =
  PostAccountBankAccountsIdRequestBody :: Maybe Text
-> Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Maybe Text
-> PostAccountBankAccountsIdRequestBody
PostAccountBankAccountsIdRequestBody
    { postAccountBankAccountsIdRequestBodyAccountHolderName :: Maybe Text
postAccountBankAccountsIdRequestBodyAccountHolderName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyAccountHolderType :: Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
postAccountBankAccountsIdRequestBodyAccountHolderType = Maybe PostAccountBankAccountsIdRequestBodyAccountHolderType'
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyAddressCity :: Maybe Text
postAccountBankAccountsIdRequestBodyAddressCity = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyAddressCountry :: Maybe Text
postAccountBankAccountsIdRequestBodyAddressCountry = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyAddressLine1 :: Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine1 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyAddressLine2 :: Maybe Text
postAccountBankAccountsIdRequestBodyAddressLine2 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyAddressState :: Maybe Text
postAccountBankAccountsIdRequestBodyAddressState = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyAddressZip :: Maybe Text
postAccountBankAccountsIdRequestBodyAddressZip = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyDefaultForCurrency :: Maybe Bool
postAccountBankAccountsIdRequestBodyDefaultForCurrency = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyExpMonth :: Maybe Text
postAccountBankAccountsIdRequestBodyExpMonth = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyExpYear :: Maybe Text
postAccountBankAccountsIdRequestBodyExpYear = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyExpand :: Maybe [Text]
postAccountBankAccountsIdRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyMetadata :: Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
postAccountBankAccountsIdRequestBodyMetadata = Maybe PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      postAccountBankAccountsIdRequestBodyName :: Maybe Text
postAccountBankAccountsIdRequestBodyName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @paths.\/v1\/account\/bank_accounts\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.account_holder_type@ in the specification.
--
-- The type of entity that holds the account. This can be either \`individual\` or \`company\`.
data PostAccountBankAccountsIdRequestBodyAccountHolderType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PostAccountBankAccountsIdRequestBodyAccountHolderType'Other Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    PostAccountBankAccountsIdRequestBodyAccountHolderType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @""@
    PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumEmptyString
  | -- | Represents the JSON value @"company"@
    PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumCompany
  | -- | Represents the JSON value @"individual"@
    PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumIndividual
  deriving (Int
-> PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> String
-> String
[PostAccountBankAccountsIdRequestBodyAccountHolderType']
-> String -> String
PostAccountBankAccountsIdRequestBodyAccountHolderType' -> String
(Int
 -> PostAccountBankAccountsIdRequestBodyAccountHolderType'
 -> String
 -> String)
-> (PostAccountBankAccountsIdRequestBodyAccountHolderType'
    -> String)
-> ([PostAccountBankAccountsIdRequestBodyAccountHolderType']
    -> String -> String)
-> Show PostAccountBankAccountsIdRequestBodyAccountHolderType'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostAccountBankAccountsIdRequestBodyAccountHolderType']
-> String -> String
$cshowList :: [PostAccountBankAccountsIdRequestBodyAccountHolderType']
-> String -> String
show :: PostAccountBankAccountsIdRequestBodyAccountHolderType' -> String
$cshow :: PostAccountBankAccountsIdRequestBodyAccountHolderType' -> String
showsPrec :: Int
-> PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> String
-> String
$cshowsPrec :: Int
-> PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> String
-> String
GHC.Show.Show, PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Bool
(PostAccountBankAccountsIdRequestBodyAccountHolderType'
 -> PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Bool)
-> (PostAccountBankAccountsIdRequestBodyAccountHolderType'
    -> PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Bool)
-> Eq PostAccountBankAccountsIdRequestBodyAccountHolderType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Bool
$c/= :: PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Bool
== :: PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Bool
$c== :: PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostAccountBankAccountsIdRequestBodyAccountHolderType' where
  toJSON :: PostAccountBankAccountsIdRequestBodyAccountHolderType' -> Value
toJSON (PostAccountBankAccountsIdRequestBodyAccountHolderType'Other Value
val) = Value
val
  toJSON (PostAccountBankAccountsIdRequestBodyAccountHolderType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PostAccountBankAccountsIdRequestBodyAccountHolderType'
PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumEmptyString) = Value
""
  toJSON (PostAccountBankAccountsIdRequestBodyAccountHolderType'
PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumCompany) = Value
"company"
  toJSON (PostAccountBankAccountsIdRequestBodyAccountHolderType'
PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumIndividual) = Value
"individual"

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountBankAccountsIdRequestBodyAccountHolderType' where
  parseJSON :: Value
-> Parser PostAccountBankAccountsIdRequestBodyAccountHolderType'
parseJSON Value
val =
    PostAccountBankAccountsIdRequestBodyAccountHolderType'
-> Parser PostAccountBankAccountsIdRequestBodyAccountHolderType'
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
"" -> PostAccountBankAccountsIdRequestBodyAccountHolderType'
PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumEmptyString
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"company" -> PostAccountBankAccountsIdRequestBodyAccountHolderType'
PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumCompany
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"individual" -> PostAccountBankAccountsIdRequestBodyAccountHolderType'
PostAccountBankAccountsIdRequestBodyAccountHolderType'EnumIndividual
            | Bool
GHC.Base.otherwise -> Value -> PostAccountBankAccountsIdRequestBodyAccountHolderType'
PostAccountBankAccountsIdRequestBodyAccountHolderType'Other Value
val
      )

-- | Defines the oneOf schema located at @paths.\/v1\/account\/bank_accounts\/{id}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.metadata.anyOf@ in the specification.
--
-- Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`.
data PostAccountBankAccountsIdRequestBodyMetadata'Variants
  = -- | Represents the JSON value @""@
    PostAccountBankAccountsIdRequestBodyMetadata'EmptyString
  | PostAccountBankAccountsIdRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object
  deriving (Int
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> String
-> String
[PostAccountBankAccountsIdRequestBodyMetadata'Variants]
-> String -> String
PostAccountBankAccountsIdRequestBodyMetadata'Variants -> String
(Int
 -> PostAccountBankAccountsIdRequestBodyMetadata'Variants
 -> String
 -> String)
-> (PostAccountBankAccountsIdRequestBodyMetadata'Variants
    -> String)
-> ([PostAccountBankAccountsIdRequestBodyMetadata'Variants]
    -> String -> String)
-> Show PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostAccountBankAccountsIdRequestBodyMetadata'Variants]
-> String -> String
$cshowList :: [PostAccountBankAccountsIdRequestBodyMetadata'Variants]
-> String -> String
show :: PostAccountBankAccountsIdRequestBodyMetadata'Variants -> String
$cshow :: PostAccountBankAccountsIdRequestBodyMetadata'Variants -> String
showsPrec :: Int
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> String
-> String
$cshowsPrec :: Int
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> String
-> String
GHC.Show.Show, PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Bool
(PostAccountBankAccountsIdRequestBodyMetadata'Variants
 -> PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Bool)
-> (PostAccountBankAccountsIdRequestBodyMetadata'Variants
    -> PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Bool)
-> Eq PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Bool
$c/= :: PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Bool
== :: PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Bool
$c== :: PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostAccountBankAccountsIdRequestBodyMetadata'Variants where
  toJSON :: PostAccountBankAccountsIdRequestBodyMetadata'Variants -> Value
toJSON (PostAccountBankAccountsIdRequestBodyMetadata'Object Object
a) = Object -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Object
a
  toJSON (PostAccountBankAccountsIdRequestBodyMetadata'Variants
PostAccountBankAccountsIdRequestBodyMetadata'EmptyString) = Value
""

instance Data.Aeson.Types.FromJSON.FromJSON PostAccountBankAccountsIdRequestBodyMetadata'Variants where
  parseJSON :: Value
-> Parser PostAccountBankAccountsIdRequestBodyMetadata'Variants
parseJSON Value
val =
    if
        | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Parser PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostAccountBankAccountsIdRequestBodyMetadata'Variants
PostAccountBankAccountsIdRequestBodyMetadata'EmptyString
        | Bool
GHC.Base.otherwise -> case (Object -> PostAccountBankAccountsIdRequestBodyMetadata'Variants
PostAccountBankAccountsIdRequestBodyMetadata'Object (Object -> PostAccountBankAccountsIdRequestBodyMetadata'Variants)
-> Result Object
-> Result PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Object
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Result PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Result PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
          Data.Aeson.Types.Internal.Success PostAccountBankAccountsIdRequestBodyMetadata'Variants
a -> PostAccountBankAccountsIdRequestBodyMetadata'Variants
-> Parser PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostAccountBankAccountsIdRequestBodyMetadata'Variants
a
          Data.Aeson.Types.Internal.Error String
a -> String
-> Parser PostAccountBankAccountsIdRequestBodyMetadata'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Represents a response of the operation 'postAccountBankAccountsId'.
--
-- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'PostAccountBankAccountsIdResponseError' is used.
data PostAccountBankAccountsIdResponse
  = -- | Means either no matching case available or a parse error
    PostAccountBankAccountsIdResponseError GHC.Base.String
  | -- | Successful response.
    PostAccountBankAccountsIdResponse200 ExternalAccount
  | -- | Error response.
    PostAccountBankAccountsIdResponseDefault Error
  deriving (Int -> PostAccountBankAccountsIdResponse -> String -> String
[PostAccountBankAccountsIdResponse] -> String -> String
PostAccountBankAccountsIdResponse -> String
(Int -> PostAccountBankAccountsIdResponse -> String -> String)
-> (PostAccountBankAccountsIdResponse -> String)
-> ([PostAccountBankAccountsIdResponse] -> String -> String)
-> Show PostAccountBankAccountsIdResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostAccountBankAccountsIdResponse] -> String -> String
$cshowList :: [PostAccountBankAccountsIdResponse] -> String -> String
show :: PostAccountBankAccountsIdResponse -> String
$cshow :: PostAccountBankAccountsIdResponse -> String
showsPrec :: Int -> PostAccountBankAccountsIdResponse -> String -> String
$cshowsPrec :: Int -> PostAccountBankAccountsIdResponse -> String -> String
GHC.Show.Show, PostAccountBankAccountsIdResponse
-> PostAccountBankAccountsIdResponse -> Bool
(PostAccountBankAccountsIdResponse
 -> PostAccountBankAccountsIdResponse -> Bool)
-> (PostAccountBankAccountsIdResponse
    -> PostAccountBankAccountsIdResponse -> Bool)
-> Eq PostAccountBankAccountsIdResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostAccountBankAccountsIdResponse
-> PostAccountBankAccountsIdResponse -> Bool
$c/= :: PostAccountBankAccountsIdResponse
-> PostAccountBankAccountsIdResponse -> Bool
== :: PostAccountBankAccountsIdResponse
-> PostAccountBankAccountsIdResponse -> Bool
$c== :: PostAccountBankAccountsIdResponse
-> PostAccountBankAccountsIdResponse -> Bool
GHC.Classes.Eq)