{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Operations.GetPaymentMethods 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
getPaymentMethods ::
forall m.
StripeAPI.Common.MonadHTTP m =>
GetPaymentMethodsParameters ->
StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response GetPaymentMethodsResponse)
getPaymentMethods :: GetPaymentMethodsParameters
-> StripeT m (Response GetPaymentMethodsResponse)
getPaymentMethods GetPaymentMethodsParameters
parameters =
(Response ByteString -> Response GetPaymentMethodsResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response GetPaymentMethodsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( \Response ByteString
response_0 ->
(ByteString -> GetPaymentMethodsResponse)
-> Response ByteString -> Response GetPaymentMethodsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( (String -> GetPaymentMethodsResponse)
-> (GetPaymentMethodsResponse -> GetPaymentMethodsResponse)
-> Either String GetPaymentMethodsResponse
-> GetPaymentMethodsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetPaymentMethodsResponse
GetPaymentMethodsResponseError GetPaymentMethodsResponse -> GetPaymentMethodsResponse
forall a. a -> a
GHC.Base.id
(Either String GetPaymentMethodsResponse
-> GetPaymentMethodsResponse)
-> (ByteString -> Either String GetPaymentMethodsResponse)
-> ByteString
-> GetPaymentMethodsResponse
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) ->
GetPaymentMethodsResponseBody200 -> GetPaymentMethodsResponse
GetPaymentMethodsResponse200
(GetPaymentMethodsResponseBody200 -> GetPaymentMethodsResponse)
-> Either String GetPaymentMethodsResponseBody200
-> Either String GetPaymentMethodsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String GetPaymentMethodsResponseBody200
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
GetPaymentMethodsResponseBody200
)
| 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 -> GetPaymentMethodsResponse
GetPaymentMethodsResponseDefault
(Error -> GetPaymentMethodsResponse)
-> Either String Error -> Either String GetPaymentMethodsResponse
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 GetPaymentMethodsResponse
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] -> StripeT m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Text -> Text -> [QueryParameter] -> StripeT m (Response ByteString)
StripeAPI.Common.doCallWithConfigurationM
(Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"GET")
(String -> Text
Data.Text.pack String
"/v1/payment_methods")
[ Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"customer") (Value -> Maybe Value
forall a. a -> Maybe a
GHC.Maybe.Just (Value -> Maybe Value) -> Value -> Maybe Value
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetPaymentMethodsParameters -> Text
getPaymentMethodsParametersQueryCustomer GetPaymentMethodsParameters
parameters)) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"ending_before") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryEndingBefore GetPaymentMethodsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"expand") ([Text] -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON ([Text] -> Value) -> Maybe [Text] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetPaymentMethodsParameters -> Maybe [Text]
getPaymentMethodsParametersQueryExpand GetPaymentMethodsParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"limit") (Int -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Int -> Value) -> Maybe Int -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetPaymentMethodsParameters -> Maybe Int
getPaymentMethodsParametersQueryLimit GetPaymentMethodsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"starting_after") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryStartingAfter GetPaymentMethodsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"type") (Value -> Maybe Value
forall a. a -> Maybe a
GHC.Maybe.Just (Value -> Maybe Value) -> Value -> Maybe Value
forall a b. (a -> b) -> a -> b
GHC.Base.$ GetPaymentMethodsParametersQueryType' -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetPaymentMethodsParameters
-> GetPaymentMethodsParametersQueryType'
getPaymentMethodsParametersQueryType GetPaymentMethodsParameters
parameters)) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True
]
)
data GetPaymentMethodsParameters = GetPaymentMethodsParameters
{
GetPaymentMethodsParameters -> Text
getPaymentMethodsParametersQueryCustomer :: Data.Text.Internal.Text,
GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryEndingBefore :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
GetPaymentMethodsParameters -> Maybe [Text]
getPaymentMethodsParametersQueryExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
GetPaymentMethodsParameters -> Maybe Int
getPaymentMethodsParametersQueryLimit :: (GHC.Maybe.Maybe GHC.Types.Int),
GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryStartingAfter :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
GetPaymentMethodsParameters
-> GetPaymentMethodsParametersQueryType'
getPaymentMethodsParametersQueryType :: GetPaymentMethodsParametersQueryType'
}
deriving
( Int -> GetPaymentMethodsParameters -> ShowS
[GetPaymentMethodsParameters] -> ShowS
GetPaymentMethodsParameters -> String
(Int -> GetPaymentMethodsParameters -> ShowS)
-> (GetPaymentMethodsParameters -> String)
-> ([GetPaymentMethodsParameters] -> ShowS)
-> Show GetPaymentMethodsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPaymentMethodsParameters] -> ShowS
$cshowList :: [GetPaymentMethodsParameters] -> ShowS
show :: GetPaymentMethodsParameters -> String
$cshow :: GetPaymentMethodsParameters -> String
showsPrec :: Int -> GetPaymentMethodsParameters -> ShowS
$cshowsPrec :: Int -> GetPaymentMethodsParameters -> ShowS
GHC.Show.Show,
GetPaymentMethodsParameters -> GetPaymentMethodsParameters -> Bool
(GetPaymentMethodsParameters
-> GetPaymentMethodsParameters -> Bool)
-> (GetPaymentMethodsParameters
-> GetPaymentMethodsParameters -> Bool)
-> Eq GetPaymentMethodsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPaymentMethodsParameters -> GetPaymentMethodsParameters -> Bool
$c/= :: GetPaymentMethodsParameters -> GetPaymentMethodsParameters -> Bool
== :: GetPaymentMethodsParameters -> GetPaymentMethodsParameters -> Bool
$c== :: GetPaymentMethodsParameters -> GetPaymentMethodsParameters -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON GetPaymentMethodsParameters where
toJSON :: GetPaymentMethodsParameters -> Value
toJSON GetPaymentMethodsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"queryCustomer" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Text
getPaymentMethodsParametersQueryCustomer GetPaymentMethodsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryEnding_before" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryEndingBefore GetPaymentMethodsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryExpand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe [Text]
getPaymentMethodsParametersQueryExpand GetPaymentMethodsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryLimit" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe Int
getPaymentMethodsParametersQueryLimit GetPaymentMethodsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryStarting_after" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryStartingAfter GetPaymentMethodsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryType" Text -> GetPaymentMethodsParametersQueryType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters
-> GetPaymentMethodsParametersQueryType'
getPaymentMethodsParametersQueryType GetPaymentMethodsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: GetPaymentMethodsParameters -> Encoding
toEncoding GetPaymentMethodsParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"queryCustomer" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Text
getPaymentMethodsParametersQueryCustomer GetPaymentMethodsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryEnding_before" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryEndingBefore GetPaymentMethodsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryExpand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe [Text]
getPaymentMethodsParametersQueryExpand GetPaymentMethodsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryLimit" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe Int
getPaymentMethodsParametersQueryLimit GetPaymentMethodsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryStarting_after" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters -> Maybe Text
getPaymentMethodsParametersQueryStartingAfter GetPaymentMethodsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"queryType" Text -> GetPaymentMethodsParametersQueryType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsParameters
-> GetPaymentMethodsParametersQueryType'
getPaymentMethodsParametersQueryType GetPaymentMethodsParameters
obj))))))
instance Data.Aeson.Types.FromJSON.FromJSON GetPaymentMethodsParameters where
parseJSON :: Value -> Parser GetPaymentMethodsParameters
parseJSON = String
-> (Object -> Parser GetPaymentMethodsParameters)
-> Value
-> Parser GetPaymentMethodsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetPaymentMethodsParameters" (\Object
obj -> ((((((Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
-> Parser
(Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters
GetPaymentMethodsParameters Parser
(Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
-> Parser Text
-> Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
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
"queryCustomer")) Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
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
"queryEnding_before")) Parser
(Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
-> Parser (Maybe [Text])
-> Parser
(Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
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
"queryExpand")) Parser
(Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
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
"queryLimit")) Parser
(Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
-> Parser (Maybe Text)
-> Parser
(GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
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
"queryStarting_after")) Parser
(GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters)
-> Parser GetPaymentMethodsParametersQueryType'
-> Parser GetPaymentMethodsParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser GetPaymentMethodsParametersQueryType'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"queryType"))
mkGetPaymentMethodsParameters ::
Data.Text.Internal.Text ->
GetPaymentMethodsParametersQueryType' ->
GetPaymentMethodsParameters
mkGetPaymentMethodsParameters :: Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters
mkGetPaymentMethodsParameters Text
getPaymentMethodsParametersQueryCustomer GetPaymentMethodsParametersQueryType'
getPaymentMethodsParametersQueryType =
GetPaymentMethodsParameters :: Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParameters
GetPaymentMethodsParameters
{ getPaymentMethodsParametersQueryCustomer :: Text
getPaymentMethodsParametersQueryCustomer = Text
getPaymentMethodsParametersQueryCustomer,
getPaymentMethodsParametersQueryEndingBefore :: Maybe Text
getPaymentMethodsParametersQueryEndingBefore = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
getPaymentMethodsParametersQueryExpand :: Maybe [Text]
getPaymentMethodsParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
getPaymentMethodsParametersQueryLimit :: Maybe Int
getPaymentMethodsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
getPaymentMethodsParametersQueryStartingAfter :: Maybe Text
getPaymentMethodsParametersQueryStartingAfter = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
getPaymentMethodsParametersQueryType :: GetPaymentMethodsParametersQueryType'
getPaymentMethodsParametersQueryType = GetPaymentMethodsParametersQueryType'
getPaymentMethodsParametersQueryType
}
data GetPaymentMethodsParametersQueryType'
=
GetPaymentMethodsParametersQueryType'Other Data.Aeson.Types.Internal.Value
|
GetPaymentMethodsParametersQueryType'Typed Data.Text.Internal.Text
|
GetPaymentMethodsParametersQueryType'EnumAcssDebit
|
GetPaymentMethodsParametersQueryType'EnumAfterpayClearpay
|
GetPaymentMethodsParametersQueryType'EnumAlipay
|
GetPaymentMethodsParametersQueryType'EnumAuBecsDebit
|
GetPaymentMethodsParametersQueryType'EnumBacsDebit
|
GetPaymentMethodsParametersQueryType'EnumBancontact
|
GetPaymentMethodsParametersQueryType'EnumBoleto
|
GetPaymentMethodsParametersQueryType'EnumCard
|
GetPaymentMethodsParametersQueryType'EnumEps
|
GetPaymentMethodsParametersQueryType'EnumFpx
|
GetPaymentMethodsParametersQueryType'EnumGiropay
|
GetPaymentMethodsParametersQueryType'EnumGrabpay
|
GetPaymentMethodsParametersQueryType'EnumIdeal
|
GetPaymentMethodsParametersQueryType'EnumOxxo
|
GetPaymentMethodsParametersQueryType'EnumP24
|
GetPaymentMethodsParametersQueryType'EnumSepaDebit
|
GetPaymentMethodsParametersQueryType'EnumSofort
deriving (Int -> GetPaymentMethodsParametersQueryType' -> ShowS
[GetPaymentMethodsParametersQueryType'] -> ShowS
GetPaymentMethodsParametersQueryType' -> String
(Int -> GetPaymentMethodsParametersQueryType' -> ShowS)
-> (GetPaymentMethodsParametersQueryType' -> String)
-> ([GetPaymentMethodsParametersQueryType'] -> ShowS)
-> Show GetPaymentMethodsParametersQueryType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPaymentMethodsParametersQueryType'] -> ShowS
$cshowList :: [GetPaymentMethodsParametersQueryType'] -> ShowS
show :: GetPaymentMethodsParametersQueryType' -> String
$cshow :: GetPaymentMethodsParametersQueryType' -> String
showsPrec :: Int -> GetPaymentMethodsParametersQueryType' -> ShowS
$cshowsPrec :: Int -> GetPaymentMethodsParametersQueryType' -> ShowS
GHC.Show.Show, GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParametersQueryType' -> Bool
(GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParametersQueryType' -> Bool)
-> (GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParametersQueryType' -> Bool)
-> Eq GetPaymentMethodsParametersQueryType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParametersQueryType' -> Bool
$c/= :: GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParametersQueryType' -> Bool
== :: GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParametersQueryType' -> Bool
$c== :: GetPaymentMethodsParametersQueryType'
-> GetPaymentMethodsParametersQueryType' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON GetPaymentMethodsParametersQueryType' where
toJSON :: GetPaymentMethodsParametersQueryType' -> Value
toJSON (GetPaymentMethodsParametersQueryType'Other Value
val) = Value
val
toJSON (GetPaymentMethodsParametersQueryType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAcssDebit) = Value
"acss_debit"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAfterpayClearpay) = Value
"afterpay_clearpay"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAlipay) = Value
"alipay"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAuBecsDebit) = Value
"au_becs_debit"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumBacsDebit) = Value
"bacs_debit"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumBancontact) = Value
"bancontact"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumBoleto) = Value
"boleto"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumCard) = Value
"card"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumEps) = Value
"eps"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumFpx) = Value
"fpx"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumGiropay) = Value
"giropay"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumGrabpay) = Value
"grabpay"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumIdeal) = Value
"ideal"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumOxxo) = Value
"oxxo"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumP24) = Value
"p24"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumSepaDebit) = Value
"sepa_debit"
toJSON (GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumSofort) = Value
"sofort"
instance Data.Aeson.Types.FromJSON.FromJSON GetPaymentMethodsParametersQueryType' where
parseJSON :: Value -> Parser GetPaymentMethodsParametersQueryType'
parseJSON Value
val =
GetPaymentMethodsParametersQueryType'
-> Parser GetPaymentMethodsParametersQueryType'
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
"acss_debit" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAcssDebit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"afterpay_clearpay" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAfterpayClearpay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"alipay" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAlipay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"au_becs_debit" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumAuBecsDebit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"bacs_debit" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumBacsDebit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"bancontact" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumBancontact
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"boleto" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumBoleto
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"card" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumCard
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"eps" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumEps
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fpx" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumFpx
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"giropay" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumGiropay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"grabpay" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumGrabpay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"ideal" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumIdeal
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"oxxo" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumOxxo
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"p24" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumP24
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sepa_debit" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumSepaDebit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sofort" -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'EnumSofort
| Bool
GHC.Base.otherwise -> Value -> GetPaymentMethodsParametersQueryType'
GetPaymentMethodsParametersQueryType'Other Value
val
)
data GetPaymentMethodsResponse
=
GetPaymentMethodsResponseError GHC.Base.String
|
GetPaymentMethodsResponse200 GetPaymentMethodsResponseBody200
|
GetPaymentMethodsResponseDefault Error
deriving (Int -> GetPaymentMethodsResponse -> ShowS
[GetPaymentMethodsResponse] -> ShowS
GetPaymentMethodsResponse -> String
(Int -> GetPaymentMethodsResponse -> ShowS)
-> (GetPaymentMethodsResponse -> String)
-> ([GetPaymentMethodsResponse] -> ShowS)
-> Show GetPaymentMethodsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPaymentMethodsResponse] -> ShowS
$cshowList :: [GetPaymentMethodsResponse] -> ShowS
show :: GetPaymentMethodsResponse -> String
$cshow :: GetPaymentMethodsResponse -> String
showsPrec :: Int -> GetPaymentMethodsResponse -> ShowS
$cshowsPrec :: Int -> GetPaymentMethodsResponse -> ShowS
GHC.Show.Show, GetPaymentMethodsResponse -> GetPaymentMethodsResponse -> Bool
(GetPaymentMethodsResponse -> GetPaymentMethodsResponse -> Bool)
-> (GetPaymentMethodsResponse -> GetPaymentMethodsResponse -> Bool)
-> Eq GetPaymentMethodsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPaymentMethodsResponse -> GetPaymentMethodsResponse -> Bool
$c/= :: GetPaymentMethodsResponse -> GetPaymentMethodsResponse -> Bool
== :: GetPaymentMethodsResponse -> GetPaymentMethodsResponse -> Bool
$c== :: GetPaymentMethodsResponse -> GetPaymentMethodsResponse -> Bool
GHC.Classes.Eq)
data GetPaymentMethodsResponseBody200 = GetPaymentMethodsResponseBody200
{
GetPaymentMethodsResponseBody200 -> [PaymentMethod]
getPaymentMethodsResponseBody200Data :: ([PaymentMethod]),
GetPaymentMethodsResponseBody200 -> Bool
getPaymentMethodsResponseBody200HasMore :: GHC.Types.Bool,
GetPaymentMethodsResponseBody200 -> Text
getPaymentMethodsResponseBody200Url :: Data.Text.Internal.Text
}
deriving
( Int -> GetPaymentMethodsResponseBody200 -> ShowS
[GetPaymentMethodsResponseBody200] -> ShowS
GetPaymentMethodsResponseBody200 -> String
(Int -> GetPaymentMethodsResponseBody200 -> ShowS)
-> (GetPaymentMethodsResponseBody200 -> String)
-> ([GetPaymentMethodsResponseBody200] -> ShowS)
-> Show GetPaymentMethodsResponseBody200
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPaymentMethodsResponseBody200] -> ShowS
$cshowList :: [GetPaymentMethodsResponseBody200] -> ShowS
show :: GetPaymentMethodsResponseBody200 -> String
$cshow :: GetPaymentMethodsResponseBody200 -> String
showsPrec :: Int -> GetPaymentMethodsResponseBody200 -> ShowS
$cshowsPrec :: Int -> GetPaymentMethodsResponseBody200 -> ShowS
GHC.Show.Show,
GetPaymentMethodsResponseBody200
-> GetPaymentMethodsResponseBody200 -> Bool
(GetPaymentMethodsResponseBody200
-> GetPaymentMethodsResponseBody200 -> Bool)
-> (GetPaymentMethodsResponseBody200
-> GetPaymentMethodsResponseBody200 -> Bool)
-> Eq GetPaymentMethodsResponseBody200
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPaymentMethodsResponseBody200
-> GetPaymentMethodsResponseBody200 -> Bool
$c/= :: GetPaymentMethodsResponseBody200
-> GetPaymentMethodsResponseBody200 -> Bool
== :: GetPaymentMethodsResponseBody200
-> GetPaymentMethodsResponseBody200 -> Bool
$c== :: GetPaymentMethodsResponseBody200
-> GetPaymentMethodsResponseBody200 -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON GetPaymentMethodsResponseBody200 where
toJSON :: GetPaymentMethodsResponseBody200 -> Value
toJSON GetPaymentMethodsResponseBody200
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"data" Text -> [PaymentMethod] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsResponseBody200 -> [PaymentMethod]
getPaymentMethodsResponseBody200Data GetPaymentMethodsResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"has_more" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsResponseBody200 -> Bool
getPaymentMethodsResponseBody200HasMore GetPaymentMethodsResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsResponseBody200 -> Text
getPaymentMethodsResponseBody200Url GetPaymentMethodsResponseBody200
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
"list" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: GetPaymentMethodsResponseBody200 -> Encoding
toEncoding GetPaymentMethodsResponseBody200
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"data" Text -> [PaymentMethod] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsResponseBody200 -> [PaymentMethod]
getPaymentMethodsResponseBody200Data GetPaymentMethodsResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"has_more" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsResponseBody200 -> Bool
getPaymentMethodsResponseBody200HasMore GetPaymentMethodsResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"url" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetPaymentMethodsResponseBody200 -> Text
getPaymentMethodsResponseBody200Url GetPaymentMethodsResponseBody200
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
"list"))))
instance Data.Aeson.Types.FromJSON.FromJSON GetPaymentMethodsResponseBody200 where
parseJSON :: Value -> Parser GetPaymentMethodsResponseBody200
parseJSON = String
-> (Object -> Parser GetPaymentMethodsResponseBody200)
-> Value
-> Parser GetPaymentMethodsResponseBody200
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetPaymentMethodsResponseBody200" (\Object
obj -> ((([PaymentMethod]
-> Bool -> Text -> GetPaymentMethodsResponseBody200)
-> Parser
([PaymentMethod]
-> Bool -> Text -> GetPaymentMethodsResponseBody200)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure [PaymentMethod] -> Bool -> Text -> GetPaymentMethodsResponseBody200
GetPaymentMethodsResponseBody200 Parser
([PaymentMethod]
-> Bool -> Text -> GetPaymentMethodsResponseBody200)
-> Parser [PaymentMethod]
-> Parser (Bool -> Text -> GetPaymentMethodsResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser [PaymentMethod]
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"data")) Parser (Bool -> Text -> GetPaymentMethodsResponseBody200)
-> Parser Bool -> Parser (Text -> GetPaymentMethodsResponseBody200)
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
"has_more")) Parser (Text -> GetPaymentMethodsResponseBody200)
-> Parser Text -> Parser GetPaymentMethodsResponseBody200
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
"url"))
mkGetPaymentMethodsResponseBody200 ::
[PaymentMethod] ->
GHC.Types.Bool ->
Data.Text.Internal.Text ->
GetPaymentMethodsResponseBody200
mkGetPaymentMethodsResponseBody200 :: [PaymentMethod] -> Bool -> Text -> GetPaymentMethodsResponseBody200
mkGetPaymentMethodsResponseBody200 [PaymentMethod]
getPaymentMethodsResponseBody200Data Bool
getPaymentMethodsResponseBody200HasMore Text
getPaymentMethodsResponseBody200Url =
GetPaymentMethodsResponseBody200 :: [PaymentMethod] -> Bool -> Text -> GetPaymentMethodsResponseBody200
GetPaymentMethodsResponseBody200
{ getPaymentMethodsResponseBody200Data :: [PaymentMethod]
getPaymentMethodsResponseBody200Data = [PaymentMethod]
getPaymentMethodsResponseBody200Data,
getPaymentMethodsResponseBody200HasMore :: Bool
getPaymentMethodsResponseBody200HasMore = Bool
getPaymentMethodsResponseBody200HasMore,
getPaymentMethodsResponseBody200Url :: Text
getPaymentMethodsResponseBody200Url = Text
getPaymentMethodsResponseBody200Url
}