{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.BankAccount 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.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
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 GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import {-# SOURCE #-} StripeAPI.Types.Account
import {-# SOURCE #-} StripeAPI.Types.Customer
import {-# SOURCE #-} StripeAPI.Types.DeletedCustomer
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data BankAccount = BankAccount
{
BankAccount -> Maybe BankAccountAccount'Variants
bankAccountAccount :: (GHC.Maybe.Maybe BankAccountAccount'Variants),
BankAccount -> Maybe Text
bankAccountAccountHolderName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
BankAccount -> Maybe Text
bankAccountAccountHolderType :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
BankAccount -> Maybe [BankAccountAvailablePayoutMethods']
bankAccountAvailablePayoutMethods :: (GHC.Maybe.Maybe ([BankAccountAvailablePayoutMethods'])),
BankAccount -> Maybe Text
bankAccountBankName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
BankAccount -> Text
bankAccountCountry :: Data.Text.Internal.Text,
BankAccount -> Text
bankAccountCurrency :: Data.Text.Internal.Text,
BankAccount -> Maybe BankAccountCustomer'Variants
bankAccountCustomer :: (GHC.Maybe.Maybe BankAccountCustomer'Variants),
BankAccount -> Maybe Bool
bankAccountDefaultForCurrency :: (GHC.Maybe.Maybe GHC.Types.Bool),
BankAccount -> Maybe Text
bankAccountFingerprint :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
BankAccount -> Text
bankAccountId :: Data.Text.Internal.Text,
BankAccount -> Text
bankAccountLast4 :: Data.Text.Internal.Text,
BankAccount -> Maybe Object
bankAccountMetadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
BankAccount -> Maybe Text
bankAccountRoutingNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
BankAccount -> Text
bankAccountStatus :: Data.Text.Internal.Text
}
deriving
( Int -> BankAccount -> ShowS
[BankAccount] -> ShowS
BankAccount -> String
(Int -> BankAccount -> ShowS)
-> (BankAccount -> String)
-> ([BankAccount] -> ShowS)
-> Show BankAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BankAccount] -> ShowS
$cshowList :: [BankAccount] -> ShowS
show :: BankAccount -> String
$cshow :: BankAccount -> String
showsPrec :: Int -> BankAccount -> ShowS
$cshowsPrec :: Int -> BankAccount -> ShowS
GHC.Show.Show,
BankAccount -> BankAccount -> Bool
(BankAccount -> BankAccount -> Bool)
-> (BankAccount -> BankAccount -> Bool) -> Eq BankAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BankAccount -> BankAccount -> Bool
$c/= :: BankAccount -> BankAccount -> Bool
== :: BankAccount -> BankAccount -> Bool
$c== :: BankAccount -> BankAccount -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON BankAccount where
toJSON :: BankAccount -> Value
toJSON BankAccount
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"account" Text -> Maybe BankAccountAccount'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe BankAccountAccount'Variants
bankAccountAccount BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"account_holder_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountAccountHolderName BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"account_holder_type" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountAccountHolderType BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"available_payout_methods" Text -> Maybe [BankAccountAvailablePayoutMethods'] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe [BankAccountAvailablePayoutMethods']
bankAccountAvailablePayoutMethods BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"bank_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountBankName BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"country" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountCountry BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"currency" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountCurrency BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"customer" Text -> Maybe BankAccountCustomer'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe BankAccountCustomer'Variants
bankAccountCustomer BankAccount
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..= BankAccount -> Maybe Bool
bankAccountDefaultForCurrency BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"fingerprint" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountFingerprint BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountId BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"last4" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountLast4 BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Maybe Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Object
bankAccountMetadata BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"routing_number" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountRoutingNumber BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountStatus BankAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"bank_account" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: BankAccount -> Encoding
toEncoding BankAccount
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"account" Text -> Maybe BankAccountAccount'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe BankAccountAccount'Variants
bankAccountAccount BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"account_holder_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountAccountHolderName BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"account_holder_type" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountAccountHolderType BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"available_payout_methods" Text -> Maybe [BankAccountAvailablePayoutMethods'] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe [BankAccountAvailablePayoutMethods']
bankAccountAvailablePayoutMethods BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"bank_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountBankName BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"country" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountCountry BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"currency" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountCurrency BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"customer" Text -> Maybe BankAccountCustomer'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe BankAccountCustomer'Variants
bankAccountCustomer BankAccount
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..= BankAccount -> Maybe Bool
bankAccountDefaultForCurrency BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"fingerprint" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountFingerprint BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountId BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"last4" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountLast4 BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text -> Maybe Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Object
bankAccountMetadata BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"routing_number" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Maybe Text
bankAccountRoutingNumber BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"status" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BankAccount -> Text
bankAccountStatus BankAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"bank_account"))))))))))))))))
instance Data.Aeson.Types.FromJSON.FromJSON BankAccount where
parseJSON :: Value -> Parser BankAccount
parseJSON = String
-> (Object -> Parser BankAccount) -> Value -> Parser BankAccount
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"BankAccount" (\Object
obj -> (((((((((((((((Maybe BankAccountAccount'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser
(Maybe BankAccountAccount'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe BankAccountAccount'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount
BankAccount Parser
(Maybe BankAccountAccount'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe BankAccountAccount'Variants)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe BankAccountAccount'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"account")) Parser
(Maybe Text
-> Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
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 Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe Text)
-> Parser
(Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
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_type")) Parser
(Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe [BankAccountAvailablePayoutMethods'])
-> Parser
(Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe [BankAccountAvailablePayoutMethods'])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"available_payout_methods")) Parser
(Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe Text)
-> Parser
(Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
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
"bank_name")) Parser
(Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser Text
-> Parser
(Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"country")) Parser
(Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser Text
-> Parser
(Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"currency")) Parser
(Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe BankAccountCustomer'Variants)
-> Parser
(Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe BankAccountCustomer'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"customer")) Parser
(Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
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
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount)
-> Parser (Maybe Text)
-> Parser
(Text -> Text -> Maybe Object -> Maybe Text -> Text -> BankAccount)
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
"fingerprint")) Parser
(Text -> Text -> Maybe Object -> Maybe Text -> Text -> BankAccount)
-> Parser Text
-> Parser
(Text -> Maybe Object -> Maybe Text -> Text -> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"id")) Parser (Text -> Maybe Object -> Maybe Text -> Text -> BankAccount)
-> Parser Text
-> Parser (Maybe Object -> Maybe Text -> Text -> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"last4")) Parser (Maybe Object -> Maybe Text -> Text -> BankAccount)
-> Parser (Maybe Object)
-> Parser (Maybe Text -> Text -> BankAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser (Maybe Text -> Text -> BankAccount)
-> Parser (Maybe Text) -> Parser (Text -> BankAccount)
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
"routing_number")) Parser (Text -> BankAccount) -> Parser Text -> Parser BankAccount
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"status"))
mkBankAccount ::
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
BankAccount
mkBankAccount :: Text -> Text -> Text -> Text -> Text -> BankAccount
mkBankAccount Text
bankAccountCountry Text
bankAccountCurrency Text
bankAccountId Text
bankAccountLast4 Text
bankAccountStatus =
BankAccount :: Maybe BankAccountAccount'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [BankAccountAvailablePayoutMethods']
-> Maybe Text
-> Text
-> Text
-> Maybe BankAccountCustomer'Variants
-> Maybe Bool
-> Maybe Text
-> Text
-> Text
-> Maybe Object
-> Maybe Text
-> Text
-> BankAccount
BankAccount
{ bankAccountAccount :: Maybe BankAccountAccount'Variants
bankAccountAccount = Maybe BankAccountAccount'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountAccountHolderName :: Maybe Text
bankAccountAccountHolderName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountAccountHolderType :: Maybe Text
bankAccountAccountHolderType = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountAvailablePayoutMethods :: Maybe [BankAccountAvailablePayoutMethods']
bankAccountAvailablePayoutMethods = Maybe [BankAccountAvailablePayoutMethods']
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountBankName :: Maybe Text
bankAccountBankName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountCountry :: Text
bankAccountCountry = Text
bankAccountCountry,
bankAccountCurrency :: Text
bankAccountCurrency = Text
bankAccountCurrency,
bankAccountCustomer :: Maybe BankAccountCustomer'Variants
bankAccountCustomer = Maybe BankAccountCustomer'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountDefaultForCurrency :: Maybe Bool
bankAccountDefaultForCurrency = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountFingerprint :: Maybe Text
bankAccountFingerprint = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountId :: Text
bankAccountId = Text
bankAccountId,
bankAccountLast4 :: Text
bankAccountLast4 = Text
bankAccountLast4,
bankAccountMetadata :: Maybe Object
bankAccountMetadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountRoutingNumber :: Maybe Text
bankAccountRoutingNumber = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
bankAccountStatus :: Text
bankAccountStatus = Text
bankAccountStatus
}
data BankAccountAccount'Variants
= BankAccountAccount'Text Data.Text.Internal.Text
| BankAccountAccount'Account Account
deriving (Int -> BankAccountAccount'Variants -> ShowS
[BankAccountAccount'Variants] -> ShowS
BankAccountAccount'Variants -> String
(Int -> BankAccountAccount'Variants -> ShowS)
-> (BankAccountAccount'Variants -> String)
-> ([BankAccountAccount'Variants] -> ShowS)
-> Show BankAccountAccount'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BankAccountAccount'Variants] -> ShowS
$cshowList :: [BankAccountAccount'Variants] -> ShowS
show :: BankAccountAccount'Variants -> String
$cshow :: BankAccountAccount'Variants -> String
showsPrec :: Int -> BankAccountAccount'Variants -> ShowS
$cshowsPrec :: Int -> BankAccountAccount'Variants -> ShowS
GHC.Show.Show, BankAccountAccount'Variants -> BankAccountAccount'Variants -> Bool
(BankAccountAccount'Variants
-> BankAccountAccount'Variants -> Bool)
-> (BankAccountAccount'Variants
-> BankAccountAccount'Variants -> Bool)
-> Eq BankAccountAccount'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BankAccountAccount'Variants -> BankAccountAccount'Variants -> Bool
$c/= :: BankAccountAccount'Variants -> BankAccountAccount'Variants -> Bool
== :: BankAccountAccount'Variants -> BankAccountAccount'Variants -> Bool
$c== :: BankAccountAccount'Variants -> BankAccountAccount'Variants -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON BankAccountAccount'Variants where
toJSON :: BankAccountAccount'Variants -> Value
toJSON (BankAccountAccount'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
toJSON (BankAccountAccount'Account Account
a) = Account -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Account
a
instance Data.Aeson.Types.FromJSON.FromJSON BankAccountAccount'Variants where
parseJSON :: Value -> Parser BankAccountAccount'Variants
parseJSON Value
val = case (Text -> BankAccountAccount'Variants
BankAccountAccount'Text (Text -> BankAccountAccount'Variants)
-> Result Text -> Result BankAccountAccount'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result BankAccountAccount'Variants
-> Result BankAccountAccount'Variants
-> Result BankAccountAccount'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Account -> BankAccountAccount'Variants
BankAccountAccount'Account (Account -> BankAccountAccount'Variants)
-> Result Account -> Result BankAccountAccount'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Account
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result BankAccountAccount'Variants
-> Result BankAccountAccount'Variants
-> Result BankAccountAccount'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result BankAccountAccount'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
Data.Aeson.Types.Internal.Success BankAccountAccount'Variants
a -> BankAccountAccount'Variants -> Parser BankAccountAccount'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure BankAccountAccount'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String -> Parser BankAccountAccount'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a
data BankAccountAvailablePayoutMethods'
=
BankAccountAvailablePayoutMethods'Other Data.Aeson.Types.Internal.Value
|
BankAccountAvailablePayoutMethods'Typed Data.Text.Internal.Text
|
BankAccountAvailablePayoutMethods'EnumInstant
|
BankAccountAvailablePayoutMethods'EnumStandard
deriving (Int -> BankAccountAvailablePayoutMethods' -> ShowS
[BankAccountAvailablePayoutMethods'] -> ShowS
BankAccountAvailablePayoutMethods' -> String
(Int -> BankAccountAvailablePayoutMethods' -> ShowS)
-> (BankAccountAvailablePayoutMethods' -> String)
-> ([BankAccountAvailablePayoutMethods'] -> ShowS)
-> Show BankAccountAvailablePayoutMethods'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BankAccountAvailablePayoutMethods'] -> ShowS
$cshowList :: [BankAccountAvailablePayoutMethods'] -> ShowS
show :: BankAccountAvailablePayoutMethods' -> String
$cshow :: BankAccountAvailablePayoutMethods' -> String
showsPrec :: Int -> BankAccountAvailablePayoutMethods' -> ShowS
$cshowsPrec :: Int -> BankAccountAvailablePayoutMethods' -> ShowS
GHC.Show.Show, BankAccountAvailablePayoutMethods'
-> BankAccountAvailablePayoutMethods' -> Bool
(BankAccountAvailablePayoutMethods'
-> BankAccountAvailablePayoutMethods' -> Bool)
-> (BankAccountAvailablePayoutMethods'
-> BankAccountAvailablePayoutMethods' -> Bool)
-> Eq BankAccountAvailablePayoutMethods'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BankAccountAvailablePayoutMethods'
-> BankAccountAvailablePayoutMethods' -> Bool
$c/= :: BankAccountAvailablePayoutMethods'
-> BankAccountAvailablePayoutMethods' -> Bool
== :: BankAccountAvailablePayoutMethods'
-> BankAccountAvailablePayoutMethods' -> Bool
$c== :: BankAccountAvailablePayoutMethods'
-> BankAccountAvailablePayoutMethods' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON BankAccountAvailablePayoutMethods' where
toJSON :: BankAccountAvailablePayoutMethods' -> Value
toJSON (BankAccountAvailablePayoutMethods'Other Value
val) = Value
val
toJSON (BankAccountAvailablePayoutMethods'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (BankAccountAvailablePayoutMethods'
BankAccountAvailablePayoutMethods'EnumInstant) = Value
"instant"
toJSON (BankAccountAvailablePayoutMethods'
BankAccountAvailablePayoutMethods'EnumStandard) = Value
"standard"
instance Data.Aeson.Types.FromJSON.FromJSON BankAccountAvailablePayoutMethods' where
parseJSON :: Value -> Parser BankAccountAvailablePayoutMethods'
parseJSON Value
val =
BankAccountAvailablePayoutMethods'
-> Parser BankAccountAvailablePayoutMethods'
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
"instant" -> BankAccountAvailablePayoutMethods'
BankAccountAvailablePayoutMethods'EnumInstant
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"standard" -> BankAccountAvailablePayoutMethods'
BankAccountAvailablePayoutMethods'EnumStandard
| Bool
GHC.Base.otherwise -> Value -> BankAccountAvailablePayoutMethods'
BankAccountAvailablePayoutMethods'Other Value
val
)
data BankAccountCustomer'Variants
= BankAccountCustomer'Text Data.Text.Internal.Text
| BankAccountCustomer'Customer Customer
| BankAccountCustomer'DeletedCustomer DeletedCustomer
deriving (Int -> BankAccountCustomer'Variants -> ShowS
[BankAccountCustomer'Variants] -> ShowS
BankAccountCustomer'Variants -> String
(Int -> BankAccountCustomer'Variants -> ShowS)
-> (BankAccountCustomer'Variants -> String)
-> ([BankAccountCustomer'Variants] -> ShowS)
-> Show BankAccountCustomer'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BankAccountCustomer'Variants] -> ShowS
$cshowList :: [BankAccountCustomer'Variants] -> ShowS
show :: BankAccountCustomer'Variants -> String
$cshow :: BankAccountCustomer'Variants -> String
showsPrec :: Int -> BankAccountCustomer'Variants -> ShowS
$cshowsPrec :: Int -> BankAccountCustomer'Variants -> ShowS
GHC.Show.Show, BankAccountCustomer'Variants
-> BankAccountCustomer'Variants -> Bool
(BankAccountCustomer'Variants
-> BankAccountCustomer'Variants -> Bool)
-> (BankAccountCustomer'Variants
-> BankAccountCustomer'Variants -> Bool)
-> Eq BankAccountCustomer'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BankAccountCustomer'Variants
-> BankAccountCustomer'Variants -> Bool
$c/= :: BankAccountCustomer'Variants
-> BankAccountCustomer'Variants -> Bool
== :: BankAccountCustomer'Variants
-> BankAccountCustomer'Variants -> Bool
$c== :: BankAccountCustomer'Variants
-> BankAccountCustomer'Variants -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON BankAccountCustomer'Variants where
toJSON :: BankAccountCustomer'Variants -> Value
toJSON (BankAccountCustomer'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
toJSON (BankAccountCustomer'Customer Customer
a) = Customer -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Customer
a
toJSON (BankAccountCustomer'DeletedCustomer DeletedCustomer
a) = DeletedCustomer -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON DeletedCustomer
a
instance Data.Aeson.Types.FromJSON.FromJSON BankAccountCustomer'Variants where
parseJSON :: Value -> Parser BankAccountCustomer'Variants
parseJSON Value
val = case (Text -> BankAccountCustomer'Variants
BankAccountCustomer'Text (Text -> BankAccountCustomer'Variants)
-> Result Text -> Result BankAccountCustomer'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result BankAccountCustomer'Variants
-> Result BankAccountCustomer'Variants
-> Result BankAccountCustomer'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Customer -> BankAccountCustomer'Variants
BankAccountCustomer'Customer (Customer -> BankAccountCustomer'Variants)
-> Result Customer -> Result BankAccountCustomer'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Customer
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result BankAccountCustomer'Variants
-> Result BankAccountCustomer'Variants
-> Result BankAccountCustomer'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((DeletedCustomer -> BankAccountCustomer'Variants
BankAccountCustomer'DeletedCustomer (DeletedCustomer -> BankAccountCustomer'Variants)
-> Result DeletedCustomer -> Result BankAccountCustomer'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result DeletedCustomer
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result BankAccountCustomer'Variants
-> Result BankAccountCustomer'Variants
-> Result BankAccountCustomer'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result BankAccountCustomer'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched")) of
Data.Aeson.Types.Internal.Success BankAccountCustomer'Variants
a -> BankAccountCustomer'Variants -> Parser BankAccountCustomer'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure BankAccountCustomer'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String -> Parser BankAccountCustomer'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a