{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.CountrySpec 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.CountrySpecVerificationFields
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data CountrySpec = CountrySpec
{
CountrySpec -> Text
countrySpecDefaultCurrency :: Data.Text.Internal.Text,
CountrySpec -> Text
countrySpecId :: Data.Text.Internal.Text,
CountrySpec -> Object
countrySpecSupportedBankAccountCurrencies :: Data.Aeson.Types.Internal.Object,
CountrySpec -> [Text]
countrySpecSupportedPaymentCurrencies :: ([Data.Text.Internal.Text]),
CountrySpec -> [Text]
countrySpecSupportedPaymentMethods :: ([Data.Text.Internal.Text]),
CountrySpec -> [Text]
countrySpecSupportedTransferCountries :: ([Data.Text.Internal.Text]),
CountrySpec -> CountrySpecVerificationFields
countrySpecVerificationFields :: CountrySpecVerificationFields
}
deriving
( Int -> CountrySpec -> ShowS
[CountrySpec] -> ShowS
CountrySpec -> String
(Int -> CountrySpec -> ShowS)
-> (CountrySpec -> String)
-> ([CountrySpec] -> ShowS)
-> Show CountrySpec
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CountrySpec] -> ShowS
$cshowList :: [CountrySpec] -> ShowS
show :: CountrySpec -> String
$cshow :: CountrySpec -> String
showsPrec :: Int -> CountrySpec -> ShowS
$cshowsPrec :: Int -> CountrySpec -> ShowS
GHC.Show.Show,
CountrySpec -> CountrySpec -> Bool
(CountrySpec -> CountrySpec -> Bool)
-> (CountrySpec -> CountrySpec -> Bool) -> Eq CountrySpec
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CountrySpec -> CountrySpec -> Bool
$c/= :: CountrySpec -> CountrySpec -> Bool
== :: CountrySpec -> CountrySpec -> Bool
$c== :: CountrySpec -> CountrySpec -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON CountrySpec where
toJSON :: CountrySpec -> Value
toJSON CountrySpec
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"default_currency" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> Text
countrySpecDefaultCurrency CountrySpec
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..= CountrySpec -> Text
countrySpecId CountrySpec
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"supported_bank_account_currencies" Text -> Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> Object
countrySpecSupportedBankAccountCurrencies CountrySpec
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"supported_payment_currencies" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> [Text]
countrySpecSupportedPaymentCurrencies CountrySpec
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"supported_payment_methods" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> [Text]
countrySpecSupportedPaymentMethods CountrySpec
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"supported_transfer_countries" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> [Text]
countrySpecSupportedTransferCountries CountrySpec
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"verification_fields" Text -> CountrySpecVerificationFields -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> CountrySpecVerificationFields
countrySpecVerificationFields CountrySpec
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
"country_spec" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: CountrySpec -> Encoding
toEncoding CountrySpec
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"default_currency" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> Text
countrySpecDefaultCurrency CountrySpec
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..= CountrySpec -> Text
countrySpecId CountrySpec
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"supported_bank_account_currencies" Text -> Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> Object
countrySpecSupportedBankAccountCurrencies CountrySpec
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"supported_payment_currencies" Text -> [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> [Text]
countrySpecSupportedPaymentCurrencies CountrySpec
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"supported_payment_methods" Text -> [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> [Text]
countrySpecSupportedPaymentMethods CountrySpec
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"supported_transfer_countries" Text -> [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> [Text]
countrySpecSupportedTransferCountries CountrySpec
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"verification_fields" Text -> CountrySpecVerificationFields -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= CountrySpec -> CountrySpecVerificationFields
countrySpecVerificationFields CountrySpec
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
"country_spec"))))))))
instance Data.Aeson.Types.FromJSON.FromJSON CountrySpec where
parseJSON :: Value -> Parser CountrySpec
parseJSON = String
-> (Object -> Parser CountrySpec) -> Value -> Parser CountrySpec
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"CountrySpec" (\Object
obj -> (((((((Text
-> Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
-> Parser
(Text
-> Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text
-> Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec
CountrySpec Parser
(Text
-> Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
-> Parser Text
-> Parser
(Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
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
"default_currency")) Parser
(Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
-> Parser Text
-> Parser
(Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
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
(Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
-> Parser Object
-> Parser
([Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Object
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"supported_bank_account_currencies")) Parser
([Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec)
-> Parser [Text]
-> Parser
([Text] -> [Text] -> CountrySpecVerificationFields -> CountrySpec)
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
"supported_payment_currencies")) Parser
([Text] -> [Text] -> CountrySpecVerificationFields -> CountrySpec)
-> Parser [Text]
-> Parser ([Text] -> CountrySpecVerificationFields -> CountrySpec)
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
"supported_payment_methods")) Parser ([Text] -> CountrySpecVerificationFields -> CountrySpec)
-> Parser [Text]
-> Parser (CountrySpecVerificationFields -> CountrySpec)
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
"supported_transfer_countries")) Parser (CountrySpecVerificationFields -> CountrySpec)
-> Parser CountrySpecVerificationFields -> Parser CountrySpec
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser CountrySpecVerificationFields
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"verification_fields"))
mkCountrySpec ::
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
Data.Aeson.Types.Internal.Object ->
[Data.Text.Internal.Text] ->
[Data.Text.Internal.Text] ->
[Data.Text.Internal.Text] ->
CountrySpecVerificationFields ->
CountrySpec
mkCountrySpec :: Text
-> Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec
mkCountrySpec Text
countrySpecDefaultCurrency Text
countrySpecId Object
countrySpecSupportedBankAccountCurrencies [Text]
countrySpecSupportedPaymentCurrencies [Text]
countrySpecSupportedPaymentMethods [Text]
countrySpecSupportedTransferCountries CountrySpecVerificationFields
countrySpecVerificationFields =
CountrySpec :: Text
-> Text
-> Object
-> [Text]
-> [Text]
-> [Text]
-> CountrySpecVerificationFields
-> CountrySpec
CountrySpec
{ countrySpecDefaultCurrency :: Text
countrySpecDefaultCurrency = Text
countrySpecDefaultCurrency,
countrySpecId :: Text
countrySpecId = Text
countrySpecId,
countrySpecSupportedBankAccountCurrencies :: Object
countrySpecSupportedBankAccountCurrencies = Object
countrySpecSupportedBankAccountCurrencies,
countrySpecSupportedPaymentCurrencies :: [Text]
countrySpecSupportedPaymentCurrencies = [Text]
countrySpecSupportedPaymentCurrencies,
countrySpecSupportedPaymentMethods :: [Text]
countrySpecSupportedPaymentMethods = [Text]
countrySpecSupportedPaymentMethods,
countrySpecSupportedTransferCountries :: [Text]
countrySpecSupportedTransferCountries = [Text]
countrySpecSupportedTransferCountries,
countrySpecVerificationFields :: CountrySpecVerificationFields
countrySpecVerificationFields = CountrySpecVerificationFields
countrySpecVerificationFields
}