{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.AlipayAccount 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.Customer
import {-# SOURCE #-} StripeAPI.Types.DeletedCustomer
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data AlipayAccount = AlipayAccount
{
AlipayAccount -> Int
alipayAccountCreated :: GHC.Types.Int,
AlipayAccount -> Maybe AlipayAccountCustomer'Variants
alipayAccountCustomer :: (GHC.Maybe.Maybe AlipayAccountCustomer'Variants),
AlipayAccount -> Text
alipayAccountFingerprint :: Data.Text.Internal.Text,
AlipayAccount -> Text
alipayAccountId :: Data.Text.Internal.Text,
AlipayAccount -> Bool
alipayAccountLivemode :: GHC.Types.Bool,
AlipayAccount -> Maybe Object
alipayAccountMetadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
AlipayAccount -> Maybe Int
alipayAccountPaymentAmount :: (GHC.Maybe.Maybe GHC.Types.Int),
AlipayAccount -> Maybe Text
alipayAccountPaymentCurrency :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
AlipayAccount -> Bool
alipayAccountReusable :: GHC.Types.Bool,
AlipayAccount -> Bool
alipayAccountUsed :: GHC.Types.Bool,
AlipayAccount -> Text
alipayAccountUsername :: Data.Text.Internal.Text
}
deriving
( Int -> AlipayAccount -> ShowS
[AlipayAccount] -> ShowS
AlipayAccount -> String
(Int -> AlipayAccount -> ShowS)
-> (AlipayAccount -> String)
-> ([AlipayAccount] -> ShowS)
-> Show AlipayAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlipayAccount] -> ShowS
$cshowList :: [AlipayAccount] -> ShowS
show :: AlipayAccount -> String
$cshow :: AlipayAccount -> String
showsPrec :: Int -> AlipayAccount -> ShowS
$cshowsPrec :: Int -> AlipayAccount -> ShowS
GHC.Show.Show,
AlipayAccount -> AlipayAccount -> Bool
(AlipayAccount -> AlipayAccount -> Bool)
-> (AlipayAccount -> AlipayAccount -> Bool) -> Eq AlipayAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlipayAccount -> AlipayAccount -> Bool
$c/= :: AlipayAccount -> AlipayAccount -> Bool
== :: AlipayAccount -> AlipayAccount -> Bool
$c== :: AlipayAccount -> AlipayAccount -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON AlipayAccount where
toJSON :: AlipayAccount -> Value
toJSON AlipayAccount
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"created" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Int
alipayAccountCreated AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"customer" Text -> Maybe AlipayAccountCustomer'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Maybe AlipayAccountCustomer'Variants
alipayAccountCustomer AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"fingerprint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Text
alipayAccountFingerprint AlipayAccount
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..= AlipayAccount -> Text
alipayAccountId AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"livemode" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Bool
alipayAccountLivemode AlipayAccount
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..= AlipayAccount -> Maybe Object
alipayAccountMetadata AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"payment_amount" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Maybe Int
alipayAccountPaymentAmount AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"payment_currency" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Maybe Text
alipayAccountPaymentCurrency AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"reusable" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Bool
alipayAccountReusable AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"used" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Bool
alipayAccountUsed AlipayAccount
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"username" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Text
alipayAccountUsername AlipayAccount
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
"alipay_account" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: AlipayAccount -> Encoding
toEncoding AlipayAccount
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"created" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Int
alipayAccountCreated AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"customer" Text -> Maybe AlipayAccountCustomer'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Maybe AlipayAccountCustomer'Variants
alipayAccountCustomer AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"fingerprint" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Text
alipayAccountFingerprint AlipayAccount
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..= AlipayAccount -> Text
alipayAccountId AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"livemode" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Bool
alipayAccountLivemode AlipayAccount
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..= AlipayAccount -> Maybe Object
alipayAccountMetadata AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"payment_amount" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Maybe Int
alipayAccountPaymentAmount AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"payment_currency" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Maybe Text
alipayAccountPaymentCurrency AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"reusable" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Bool
alipayAccountReusable AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"used" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Bool
alipayAccountUsed AlipayAccount
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"username" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AlipayAccount -> Text
alipayAccountUsername AlipayAccount
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
"alipay_account"))))))))))))
instance Data.Aeson.Types.FromJSON.FromJSON AlipayAccount where
parseJSON :: Value -> Parser AlipayAccount
parseJSON = String
-> (Object -> Parser AlipayAccount)
-> Value
-> Parser AlipayAccount
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"AlipayAccount" (\Object
obj -> (((((((((((Int
-> Maybe AlipayAccountCustomer'Variants
-> Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
-> Parser
(Int
-> Maybe AlipayAccountCustomer'Variants
-> Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int
-> Maybe AlipayAccountCustomer'Variants
-> Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount
AlipayAccount Parser
(Int
-> Maybe AlipayAccountCustomer'Variants
-> Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
-> Parser Int
-> Parser
(Maybe AlipayAccountCustomer'Variants
-> Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"created")) Parser
(Maybe AlipayAccountCustomer'Variants
-> Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
-> Parser (Maybe AlipayAccountCustomer'Variants)
-> Parser
(Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe AlipayAccountCustomer'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"customer")) Parser
(Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
-> Parser Text
-> Parser
(Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
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
"fingerprint")) Parser
(Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
-> Parser Text
-> Parser
(Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
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
(Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
-> Parser Bool
-> Parser
(Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"livemode")) Parser
(Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount)
-> Parser (Maybe Object)
-> Parser
(Maybe Int -> Maybe Text -> Bool -> Bool -> Text -> AlipayAccount)
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 Int -> Maybe Text -> Bool -> Bool -> Text -> AlipayAccount)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Bool -> Bool -> Text -> AlipayAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"payment_amount")) Parser (Maybe Text -> Bool -> Bool -> Text -> AlipayAccount)
-> Parser (Maybe Text)
-> Parser (Bool -> Bool -> Text -> AlipayAccount)
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
"payment_currency")) Parser (Bool -> Bool -> Text -> AlipayAccount)
-> Parser Bool -> Parser (Bool -> Text -> AlipayAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"reusable")) Parser (Bool -> Text -> AlipayAccount)
-> Parser Bool -> Parser (Text -> AlipayAccount)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"used")) Parser (Text -> AlipayAccount)
-> Parser Text -> Parser AlipayAccount
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
"username"))
mkAlipayAccount ::
GHC.Types.Int ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
GHC.Types.Bool ->
GHC.Types.Bool ->
GHC.Types.Bool ->
Data.Text.Internal.Text ->
AlipayAccount
mkAlipayAccount :: Int
-> Text -> Text -> Bool -> Bool -> Bool -> Text -> AlipayAccount
mkAlipayAccount Int
alipayAccountCreated Text
alipayAccountFingerprint Text
alipayAccountId Bool
alipayAccountLivemode Bool
alipayAccountReusable Bool
alipayAccountUsed Text
alipayAccountUsername =
AlipayAccount :: Int
-> Maybe AlipayAccountCustomer'Variants
-> Text
-> Text
-> Bool
-> Maybe Object
-> Maybe Int
-> Maybe Text
-> Bool
-> Bool
-> Text
-> AlipayAccount
AlipayAccount
{ alipayAccountCreated :: Int
alipayAccountCreated = Int
alipayAccountCreated,
alipayAccountCustomer :: Maybe AlipayAccountCustomer'Variants
alipayAccountCustomer = Maybe AlipayAccountCustomer'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
alipayAccountFingerprint :: Text
alipayAccountFingerprint = Text
alipayAccountFingerprint,
alipayAccountId :: Text
alipayAccountId = Text
alipayAccountId,
alipayAccountLivemode :: Bool
alipayAccountLivemode = Bool
alipayAccountLivemode,
alipayAccountMetadata :: Maybe Object
alipayAccountMetadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
alipayAccountPaymentAmount :: Maybe Int
alipayAccountPaymentAmount = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
alipayAccountPaymentCurrency :: Maybe Text
alipayAccountPaymentCurrency = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
alipayAccountReusable :: Bool
alipayAccountReusable = Bool
alipayAccountReusable,
alipayAccountUsed :: Bool
alipayAccountUsed = Bool
alipayAccountUsed,
alipayAccountUsername :: Text
alipayAccountUsername = Text
alipayAccountUsername
}
data AlipayAccountCustomer'Variants
= AlipayAccountCustomer'Text Data.Text.Internal.Text
| AlipayAccountCustomer'Customer Customer
| AlipayAccountCustomer'DeletedCustomer DeletedCustomer
deriving (Int -> AlipayAccountCustomer'Variants -> ShowS
[AlipayAccountCustomer'Variants] -> ShowS
AlipayAccountCustomer'Variants -> String
(Int -> AlipayAccountCustomer'Variants -> ShowS)
-> (AlipayAccountCustomer'Variants -> String)
-> ([AlipayAccountCustomer'Variants] -> ShowS)
-> Show AlipayAccountCustomer'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlipayAccountCustomer'Variants] -> ShowS
$cshowList :: [AlipayAccountCustomer'Variants] -> ShowS
show :: AlipayAccountCustomer'Variants -> String
$cshow :: AlipayAccountCustomer'Variants -> String
showsPrec :: Int -> AlipayAccountCustomer'Variants -> ShowS
$cshowsPrec :: Int -> AlipayAccountCustomer'Variants -> ShowS
GHC.Show.Show, AlipayAccountCustomer'Variants
-> AlipayAccountCustomer'Variants -> Bool
(AlipayAccountCustomer'Variants
-> AlipayAccountCustomer'Variants -> Bool)
-> (AlipayAccountCustomer'Variants
-> AlipayAccountCustomer'Variants -> Bool)
-> Eq AlipayAccountCustomer'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlipayAccountCustomer'Variants
-> AlipayAccountCustomer'Variants -> Bool
$c/= :: AlipayAccountCustomer'Variants
-> AlipayAccountCustomer'Variants -> Bool
== :: AlipayAccountCustomer'Variants
-> AlipayAccountCustomer'Variants -> Bool
$c== :: AlipayAccountCustomer'Variants
-> AlipayAccountCustomer'Variants -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON AlipayAccountCustomer'Variants where
toJSON :: AlipayAccountCustomer'Variants -> Value
toJSON (AlipayAccountCustomer'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
toJSON (AlipayAccountCustomer'Customer Customer
a) = Customer -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Customer
a
toJSON (AlipayAccountCustomer'DeletedCustomer DeletedCustomer
a) = DeletedCustomer -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON DeletedCustomer
a
instance Data.Aeson.Types.FromJSON.FromJSON AlipayAccountCustomer'Variants where
parseJSON :: Value -> Parser AlipayAccountCustomer'Variants
parseJSON Value
val = case (Text -> AlipayAccountCustomer'Variants
AlipayAccountCustomer'Text (Text -> AlipayAccountCustomer'Variants)
-> Result Text -> Result AlipayAccountCustomer'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 AlipayAccountCustomer'Variants
-> Result AlipayAccountCustomer'Variants
-> Result AlipayAccountCustomer'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Customer -> AlipayAccountCustomer'Variants
AlipayAccountCustomer'Customer (Customer -> AlipayAccountCustomer'Variants)
-> Result Customer -> Result AlipayAccountCustomer'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 AlipayAccountCustomer'Variants
-> Result AlipayAccountCustomer'Variants
-> Result AlipayAccountCustomer'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((DeletedCustomer -> AlipayAccountCustomer'Variants
AlipayAccountCustomer'DeletedCustomer (DeletedCustomer -> AlipayAccountCustomer'Variants)
-> Result DeletedCustomer -> Result AlipayAccountCustomer'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 AlipayAccountCustomer'Variants
-> Result AlipayAccountCustomer'Variants
-> Result AlipayAccountCustomer'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result AlipayAccountCustomer'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched")) of
Data.Aeson.Types.Internal.Success AlipayAccountCustomer'Variants
a -> AlipayAccountCustomer'Variants
-> Parser AlipayAccountCustomer'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure AlipayAccountCustomer'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String -> Parser AlipayAccountCustomer'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a