{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Operations.PostPayouts 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
postPayouts ::
forall m.
StripeAPI.Common.MonadHTTP m =>
PostPayoutsRequestBody ->
StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostPayoutsResponse)
postPayouts :: PostPayoutsRequestBody -> ClientT m (Response PostPayoutsResponse)
postPayouts PostPayoutsRequestBody
body =
(Response ByteString -> Response PostPayoutsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response PostPayoutsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( \Response ByteString
response_0 ->
(ByteString -> PostPayoutsResponse)
-> Response ByteString -> Response PostPayoutsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( (String -> PostPayoutsResponse)
-> (PostPayoutsResponse -> PostPayoutsResponse)
-> Either String PostPayoutsResponse
-> PostPayoutsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostPayoutsResponse
PostPayoutsResponseError PostPayoutsResponse -> PostPayoutsResponse
forall a. a -> a
GHC.Base.id
(Either String PostPayoutsResponse -> PostPayoutsResponse)
-> (ByteString -> Either String PostPayoutsResponse)
-> ByteString
-> PostPayoutsResponse
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) ->
Payout -> PostPayoutsResponse
PostPayoutsResponse200
(Payout -> PostPayoutsResponse)
-> Either String Payout -> Either String PostPayoutsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String Payout
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
Payout
)
| 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 -> PostPayoutsResponse
PostPayoutsResponseDefault
(Error -> PostPayoutsResponse)
-> Either String Error -> Either String PostPayoutsResponse
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 PostPayoutsResponse
forall a b. a -> Either a b
Data.Either.Left String
"Missing default response type"
)
Response ByteString
response_0
)
Response ByteString
response_0
)
(Text
-> Text
-> [QueryParameter]
-> Maybe PostPayoutsRequestBody
-> RequestBodyEncoding
-> ClientT m (Response ByteString)
forall (m :: * -> *) body.
(MonadHTTP m, ToJSON body) =>
Text
-> Text
-> [QueryParameter]
-> Maybe body
-> RequestBodyEncoding
-> ClientT m (Response ByteString)
StripeAPI.Common.doBodyCallWithConfigurationM (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"POST") (String -> Text
Data.Text.pack String
"/v1/payouts") [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty (PostPayoutsRequestBody -> Maybe PostPayoutsRequestBody
forall a. a -> Maybe a
GHC.Maybe.Just PostPayoutsRequestBody
body) RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)
data PostPayoutsRequestBody = PostPayoutsRequestBody
{
PostPayoutsRequestBody -> Int
postPayoutsRequestBodyAmount :: GHC.Types.Int,
PostPayoutsRequestBody -> Text
postPayoutsRequestBodyCurrency :: Data.Text.Internal.Text,
PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyDestination :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostPayoutsRequestBody -> Maybe [Text]
postPayoutsRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
PostPayoutsRequestBody -> Maybe Object
postPayoutsRequestBodyMetadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
PostPayoutsRequestBody -> Maybe PostPayoutsRequestBodyMethod'
postPayoutsRequestBodyMethod :: (GHC.Maybe.Maybe PostPayoutsRequestBodyMethod'),
PostPayoutsRequestBody -> Maybe PostPayoutsRequestBodySourceType'
postPayoutsRequestBodySourceType :: (GHC.Maybe.Maybe PostPayoutsRequestBodySourceType'),
PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyStatementDescriptor :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> PostPayoutsRequestBody -> ShowS
[PostPayoutsRequestBody] -> ShowS
PostPayoutsRequestBody -> String
(Int -> PostPayoutsRequestBody -> ShowS)
-> (PostPayoutsRequestBody -> String)
-> ([PostPayoutsRequestBody] -> ShowS)
-> Show PostPayoutsRequestBody
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostPayoutsRequestBody] -> ShowS
$cshowList :: [PostPayoutsRequestBody] -> ShowS
show :: PostPayoutsRequestBody -> String
$cshow :: PostPayoutsRequestBody -> String
showsPrec :: Int -> PostPayoutsRequestBody -> ShowS
$cshowsPrec :: Int -> PostPayoutsRequestBody -> ShowS
GHC.Show.Show,
PostPayoutsRequestBody -> PostPayoutsRequestBody -> Bool
(PostPayoutsRequestBody -> PostPayoutsRequestBody -> Bool)
-> (PostPayoutsRequestBody -> PostPayoutsRequestBody -> Bool)
-> Eq PostPayoutsRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostPayoutsRequestBody -> PostPayoutsRequestBody -> Bool
$c/= :: PostPayoutsRequestBody -> PostPayoutsRequestBody -> Bool
== :: PostPayoutsRequestBody -> PostPayoutsRequestBody -> Bool
$c== :: PostPayoutsRequestBody -> PostPayoutsRequestBody -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostPayoutsRequestBody where
toJSON :: PostPayoutsRequestBody -> Value
toJSON PostPayoutsRequestBody
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"amount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Int
postPayoutsRequestBodyAmount PostPayoutsRequestBody
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..= PostPayoutsRequestBody -> Text
postPayoutsRequestBodyCurrency PostPayoutsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"description" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyDescription PostPayoutsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"destination" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyDestination PostPayoutsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"expand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe [Text]
postPayoutsRequestBodyExpand PostPayoutsRequestBody
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..= PostPayoutsRequestBody -> Maybe Object
postPayoutsRequestBodyMetadata PostPayoutsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"method" Text -> Maybe PostPayoutsRequestBodyMethod' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe PostPayoutsRequestBodyMethod'
postPayoutsRequestBodyMethod PostPayoutsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"source_type" Text -> Maybe PostPayoutsRequestBodySourceType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe PostPayoutsRequestBodySourceType'
postPayoutsRequestBodySourceType PostPayoutsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"statement_descriptor" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyStatementDescriptor PostPayoutsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PostPayoutsRequestBody -> Encoding
toEncoding PostPayoutsRequestBody
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"amount" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Int
postPayoutsRequestBodyAmount PostPayoutsRequestBody
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..= PostPayoutsRequestBody -> Text
postPayoutsRequestBodyCurrency PostPayoutsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"description" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyDescription PostPayoutsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"destination" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyDestination PostPayoutsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"expand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe [Text]
postPayoutsRequestBodyExpand PostPayoutsRequestBody
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..= PostPayoutsRequestBody -> Maybe Object
postPayoutsRequestBodyMetadata PostPayoutsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"method" Text -> Maybe PostPayoutsRequestBodyMethod' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe PostPayoutsRequestBodyMethod'
postPayoutsRequestBodyMethod PostPayoutsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"source_type" Text -> Maybe PostPayoutsRequestBodySourceType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe PostPayoutsRequestBodySourceType'
postPayoutsRequestBodySourceType PostPayoutsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"statement_descriptor" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPayoutsRequestBody -> Maybe Text
postPayoutsRequestBodyStatementDescriptor PostPayoutsRequestBody
obj)))))))))
instance Data.Aeson.Types.FromJSON.FromJSON PostPayoutsRequestBody where
parseJSON :: Value -> Parser PostPayoutsRequestBody
parseJSON = String
-> (Object -> Parser PostPayoutsRequestBody)
-> Value
-> Parser PostPayoutsRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostPayoutsRequestBody" (\Object
obj -> (((((((((Int
-> Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser
(Int
-> Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int
-> Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody
PostPayoutsRequestBody Parser
(Int
-> Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser Int
-> Parser
(Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
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
"amount")) Parser
(Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser Text
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
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 Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
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
"description")) Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
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
"destination")) Parser
(Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser (Maybe [Text])
-> Parser
(Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"expand")) Parser
(Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser (Maybe Object)
-> Parser
(Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
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 PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody)
-> Parser (Maybe PostPayoutsRequestBodyMethod')
-> Parser
(Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text -> PostPayoutsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PostPayoutsRequestBodyMethod')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"method")) Parser
(Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text -> PostPayoutsRequestBody)
-> Parser (Maybe PostPayoutsRequestBodySourceType')
-> Parser (Maybe Text -> PostPayoutsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PostPayoutsRequestBodySourceType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"source_type")) Parser (Maybe Text -> PostPayoutsRequestBody)
-> Parser (Maybe Text) -> Parser PostPayoutsRequestBody
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
"statement_descriptor"))
mkPostPayoutsRequestBody ::
GHC.Types.Int ->
Data.Text.Internal.Text ->
PostPayoutsRequestBody
mkPostPayoutsRequestBody :: Int -> Text -> PostPayoutsRequestBody
mkPostPayoutsRequestBody Int
postPayoutsRequestBodyAmount Text
postPayoutsRequestBodyCurrency =
PostPayoutsRequestBody :: Int
-> Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Object
-> Maybe PostPayoutsRequestBodyMethod'
-> Maybe PostPayoutsRequestBodySourceType'
-> Maybe Text
-> PostPayoutsRequestBody
PostPayoutsRequestBody
{ postPayoutsRequestBodyAmount :: Int
postPayoutsRequestBodyAmount = Int
postPayoutsRequestBodyAmount,
postPayoutsRequestBodyCurrency :: Text
postPayoutsRequestBodyCurrency = Text
postPayoutsRequestBodyCurrency,
postPayoutsRequestBodyDescription :: Maybe Text
postPayoutsRequestBodyDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postPayoutsRequestBodyDestination :: Maybe Text
postPayoutsRequestBodyDestination = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postPayoutsRequestBodyExpand :: Maybe [Text]
postPayoutsRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
postPayoutsRequestBodyMetadata :: Maybe Object
postPayoutsRequestBodyMetadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
postPayoutsRequestBodyMethod :: Maybe PostPayoutsRequestBodyMethod'
postPayoutsRequestBodyMethod = Maybe PostPayoutsRequestBodyMethod'
forall a. Maybe a
GHC.Maybe.Nothing,
postPayoutsRequestBodySourceType :: Maybe PostPayoutsRequestBodySourceType'
postPayoutsRequestBodySourceType = Maybe PostPayoutsRequestBodySourceType'
forall a. Maybe a
GHC.Maybe.Nothing,
postPayoutsRequestBodyStatementDescriptor :: Maybe Text
postPayoutsRequestBodyStatementDescriptor = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
}
data PostPayoutsRequestBodyMethod'
=
PostPayoutsRequestBodyMethod'Other Data.Aeson.Types.Internal.Value
|
PostPayoutsRequestBodyMethod'Typed Data.Text.Internal.Text
|
PostPayoutsRequestBodyMethod'EnumInstant
|
PostPayoutsRequestBodyMethod'EnumStandard
deriving (Int -> PostPayoutsRequestBodyMethod' -> ShowS
[PostPayoutsRequestBodyMethod'] -> ShowS
PostPayoutsRequestBodyMethod' -> String
(Int -> PostPayoutsRequestBodyMethod' -> ShowS)
-> (PostPayoutsRequestBodyMethod' -> String)
-> ([PostPayoutsRequestBodyMethod'] -> ShowS)
-> Show PostPayoutsRequestBodyMethod'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostPayoutsRequestBodyMethod'] -> ShowS
$cshowList :: [PostPayoutsRequestBodyMethod'] -> ShowS
show :: PostPayoutsRequestBodyMethod' -> String
$cshow :: PostPayoutsRequestBodyMethod' -> String
showsPrec :: Int -> PostPayoutsRequestBodyMethod' -> ShowS
$cshowsPrec :: Int -> PostPayoutsRequestBodyMethod' -> ShowS
GHC.Show.Show, PostPayoutsRequestBodyMethod'
-> PostPayoutsRequestBodyMethod' -> Bool
(PostPayoutsRequestBodyMethod'
-> PostPayoutsRequestBodyMethod' -> Bool)
-> (PostPayoutsRequestBodyMethod'
-> PostPayoutsRequestBodyMethod' -> Bool)
-> Eq PostPayoutsRequestBodyMethod'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostPayoutsRequestBodyMethod'
-> PostPayoutsRequestBodyMethod' -> Bool
$c/= :: PostPayoutsRequestBodyMethod'
-> PostPayoutsRequestBodyMethod' -> Bool
== :: PostPayoutsRequestBodyMethod'
-> PostPayoutsRequestBodyMethod' -> Bool
$c== :: PostPayoutsRequestBodyMethod'
-> PostPayoutsRequestBodyMethod' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostPayoutsRequestBodyMethod' where
toJSON :: PostPayoutsRequestBodyMethod' -> Value
toJSON (PostPayoutsRequestBodyMethod'Other Value
val) = Value
val
toJSON (PostPayoutsRequestBodyMethod'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PostPayoutsRequestBodyMethod'
PostPayoutsRequestBodyMethod'EnumInstant) = Value
"instant"
toJSON (PostPayoutsRequestBodyMethod'
PostPayoutsRequestBodyMethod'EnumStandard) = Value
"standard"
instance Data.Aeson.Types.FromJSON.FromJSON PostPayoutsRequestBodyMethod' where
parseJSON :: Value -> Parser PostPayoutsRequestBodyMethod'
parseJSON Value
val =
PostPayoutsRequestBodyMethod'
-> Parser PostPayoutsRequestBodyMethod'
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" -> PostPayoutsRequestBodyMethod'
PostPayoutsRequestBodyMethod'EnumInstant
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"standard" -> PostPayoutsRequestBodyMethod'
PostPayoutsRequestBodyMethod'EnumStandard
| Bool
GHC.Base.otherwise -> Value -> PostPayoutsRequestBodyMethod'
PostPayoutsRequestBodyMethod'Other Value
val
)
data PostPayoutsRequestBodySourceType'
=
PostPayoutsRequestBodySourceType'Other Data.Aeson.Types.Internal.Value
|
PostPayoutsRequestBodySourceType'Typed Data.Text.Internal.Text
|
PostPayoutsRequestBodySourceType'EnumBankAccount
|
PostPayoutsRequestBodySourceType'EnumCard
|
PostPayoutsRequestBodySourceType'EnumFpx
deriving (Int -> PostPayoutsRequestBodySourceType' -> ShowS
[PostPayoutsRequestBodySourceType'] -> ShowS
PostPayoutsRequestBodySourceType' -> String
(Int -> PostPayoutsRequestBodySourceType' -> ShowS)
-> (PostPayoutsRequestBodySourceType' -> String)
-> ([PostPayoutsRequestBodySourceType'] -> ShowS)
-> Show PostPayoutsRequestBodySourceType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostPayoutsRequestBodySourceType'] -> ShowS
$cshowList :: [PostPayoutsRequestBodySourceType'] -> ShowS
show :: PostPayoutsRequestBodySourceType' -> String
$cshow :: PostPayoutsRequestBodySourceType' -> String
showsPrec :: Int -> PostPayoutsRequestBodySourceType' -> ShowS
$cshowsPrec :: Int -> PostPayoutsRequestBodySourceType' -> ShowS
GHC.Show.Show, PostPayoutsRequestBodySourceType'
-> PostPayoutsRequestBodySourceType' -> Bool
(PostPayoutsRequestBodySourceType'
-> PostPayoutsRequestBodySourceType' -> Bool)
-> (PostPayoutsRequestBodySourceType'
-> PostPayoutsRequestBodySourceType' -> Bool)
-> Eq PostPayoutsRequestBodySourceType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostPayoutsRequestBodySourceType'
-> PostPayoutsRequestBodySourceType' -> Bool
$c/= :: PostPayoutsRequestBodySourceType'
-> PostPayoutsRequestBodySourceType' -> Bool
== :: PostPayoutsRequestBodySourceType'
-> PostPayoutsRequestBodySourceType' -> Bool
$c== :: PostPayoutsRequestBodySourceType'
-> PostPayoutsRequestBodySourceType' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostPayoutsRequestBodySourceType' where
toJSON :: PostPayoutsRequestBodySourceType' -> Value
toJSON (PostPayoutsRequestBodySourceType'Other Value
val) = Value
val
toJSON (PostPayoutsRequestBodySourceType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PostPayoutsRequestBodySourceType'
PostPayoutsRequestBodySourceType'EnumBankAccount) = Value
"bank_account"
toJSON (PostPayoutsRequestBodySourceType'
PostPayoutsRequestBodySourceType'EnumCard) = Value
"card"
toJSON (PostPayoutsRequestBodySourceType'
PostPayoutsRequestBodySourceType'EnumFpx) = Value
"fpx"
instance Data.Aeson.Types.FromJSON.FromJSON PostPayoutsRequestBodySourceType' where
parseJSON :: Value -> Parser PostPayoutsRequestBodySourceType'
parseJSON Value
val =
PostPayoutsRequestBodySourceType'
-> Parser PostPayoutsRequestBodySourceType'
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
"bank_account" -> PostPayoutsRequestBodySourceType'
PostPayoutsRequestBodySourceType'EnumBankAccount
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"card" -> PostPayoutsRequestBodySourceType'
PostPayoutsRequestBodySourceType'EnumCard
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"fpx" -> PostPayoutsRequestBodySourceType'
PostPayoutsRequestBodySourceType'EnumFpx
| Bool
GHC.Base.otherwise -> Value -> PostPayoutsRequestBodySourceType'
PostPayoutsRequestBodySourceType'Other Value
val
)
data PostPayoutsResponse
=
PostPayoutsResponseError GHC.Base.String
|
PostPayoutsResponse200 Payout
|
PostPayoutsResponseDefault Error
deriving (Int -> PostPayoutsResponse -> ShowS
[PostPayoutsResponse] -> ShowS
PostPayoutsResponse -> String
(Int -> PostPayoutsResponse -> ShowS)
-> (PostPayoutsResponse -> String)
-> ([PostPayoutsResponse] -> ShowS)
-> Show PostPayoutsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostPayoutsResponse] -> ShowS
$cshowList :: [PostPayoutsResponse] -> ShowS
show :: PostPayoutsResponse -> String
$cshow :: PostPayoutsResponse -> String
showsPrec :: Int -> PostPayoutsResponse -> ShowS
$cshowsPrec :: Int -> PostPayoutsResponse -> ShowS
GHC.Show.Show, PostPayoutsResponse -> PostPayoutsResponse -> Bool
(PostPayoutsResponse -> PostPayoutsResponse -> Bool)
-> (PostPayoutsResponse -> PostPayoutsResponse -> Bool)
-> Eq PostPayoutsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostPayoutsResponse -> PostPayoutsResponse -> Bool
$c/= :: PostPayoutsResponse -> PostPayoutsResponse -> Bool
== :: PostPayoutsResponse -> PostPayoutsResponse -> Bool
$c== :: PostPayoutsResponse -> PostPayoutsResponse -> Bool
GHC.Classes.Eq)