{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Operations.PostRecipientsId 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
postRecipientsId ::
forall m.
StripeAPI.Common.MonadHTTP m =>
Data.Text.Internal.Text ->
GHC.Maybe.Maybe PostRecipientsIdRequestBody ->
StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostRecipientsIdResponse)
postRecipientsId :: Text
-> Maybe PostRecipientsIdRequestBody
-> ClientT m (Response PostRecipientsIdResponse)
postRecipientsId
Text
id
Maybe PostRecipientsIdRequestBody
body =
(Response ByteString -> Response PostRecipientsIdResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response PostRecipientsIdResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( \Response ByteString
response_0 ->
(ByteString -> PostRecipientsIdResponse)
-> Response ByteString -> Response PostRecipientsIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( (String -> PostRecipientsIdResponse)
-> (PostRecipientsIdResponse -> PostRecipientsIdResponse)
-> Either String PostRecipientsIdResponse
-> PostRecipientsIdResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostRecipientsIdResponse
PostRecipientsIdResponseError PostRecipientsIdResponse -> PostRecipientsIdResponse
forall a. a -> a
GHC.Base.id
(Either String PostRecipientsIdResponse
-> PostRecipientsIdResponse)
-> (ByteString -> Either String PostRecipientsIdResponse)
-> ByteString
-> PostRecipientsIdResponse
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) ->
Recipient -> PostRecipientsIdResponse
PostRecipientsIdResponse200
(Recipient -> PostRecipientsIdResponse)
-> Either String Recipient
-> Either String PostRecipientsIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String Recipient
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
Recipient
)
| 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 -> PostRecipientsIdResponse
PostRecipientsIdResponseDefault
(Error -> PostRecipientsIdResponse)
-> Either String Error -> Either String PostRecipientsIdResponse
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 PostRecipientsIdResponse
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 PostRecipientsIdRequestBody
-> 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/recipients/" String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ (ByteString -> String
Data.ByteString.Char8.unpack (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (String -> ByteString
Data.ByteString.Char8.pack (String -> ByteString) -> String -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> String
forall a. StringifyModel a => a -> String
StripeAPI.Common.stringifyModel Text
id)) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
""))) [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty Maybe PostRecipientsIdRequestBody
body RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)
data PostRecipientsIdRequestBody = PostRecipientsIdRequestBody
{
PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyBankAccount :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyCard :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyDefaultCard :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostRecipientsIdRequestBody -> Maybe [Text]
postRecipientsIdRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
PostRecipientsIdRequestBody
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
postRecipientsIdRequestBodyMetadata :: (GHC.Maybe.Maybe PostRecipientsIdRequestBodyMetadata'Variants),
PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyTaxId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> PostRecipientsIdRequestBody -> String -> String
[PostRecipientsIdRequestBody] -> String -> String
PostRecipientsIdRequestBody -> String
(Int -> PostRecipientsIdRequestBody -> String -> String)
-> (PostRecipientsIdRequestBody -> String)
-> ([PostRecipientsIdRequestBody] -> String -> String)
-> Show PostRecipientsIdRequestBody
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostRecipientsIdRequestBody] -> String -> String
$cshowList :: [PostRecipientsIdRequestBody] -> String -> String
show :: PostRecipientsIdRequestBody -> String
$cshow :: PostRecipientsIdRequestBody -> String
showsPrec :: Int -> PostRecipientsIdRequestBody -> String -> String
$cshowsPrec :: Int -> PostRecipientsIdRequestBody -> String -> String
GHC.Show.Show,
PostRecipientsIdRequestBody -> PostRecipientsIdRequestBody -> Bool
(PostRecipientsIdRequestBody
-> PostRecipientsIdRequestBody -> Bool)
-> (PostRecipientsIdRequestBody
-> PostRecipientsIdRequestBody -> Bool)
-> Eq PostRecipientsIdRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostRecipientsIdRequestBody -> PostRecipientsIdRequestBody -> Bool
$c/= :: PostRecipientsIdRequestBody -> PostRecipientsIdRequestBody -> Bool
== :: PostRecipientsIdRequestBody -> PostRecipientsIdRequestBody -> Bool
$c== :: PostRecipientsIdRequestBody -> PostRecipientsIdRequestBody -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostRecipientsIdRequestBody where
toJSON :: PostRecipientsIdRequestBody -> Value
toJSON PostRecipientsIdRequestBody
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"bank_account" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyBankAccount PostRecipientsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"card" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyCard PostRecipientsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"default_card" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyDefaultCard PostRecipientsIdRequestBody
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..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyDescription PostRecipientsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"email" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyEmail PostRecipientsIdRequestBody
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..= PostRecipientsIdRequestBody -> Maybe [Text]
postRecipientsIdRequestBodyExpand PostRecipientsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Maybe PostRecipientsIdRequestBodyMetadata'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
postRecipientsIdRequestBodyMetadata PostRecipientsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyName PostRecipientsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_id" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyTaxId PostRecipientsIdRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PostRecipientsIdRequestBody -> Encoding
toEncoding PostRecipientsIdRequestBody
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"bank_account" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyBankAccount PostRecipientsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"card" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyCard PostRecipientsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"default_card" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyDefaultCard PostRecipientsIdRequestBody
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..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyDescription PostRecipientsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"email" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyEmail PostRecipientsIdRequestBody
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..= PostRecipientsIdRequestBody -> Maybe [Text]
postRecipientsIdRequestBodyExpand PostRecipientsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
postRecipientsIdRequestBodyMetadata PostRecipientsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyName PostRecipientsIdRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"tax_id" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostRecipientsIdRequestBody -> Maybe Text
postRecipientsIdRequestBodyTaxId PostRecipientsIdRequestBody
obj)))))))))
instance Data.Aeson.Types.FromJSON.FromJSON PostRecipientsIdRequestBody where
parseJSON :: Value -> Parser PostRecipientsIdRequestBody
parseJSON = String
-> (Object -> Parser PostRecipientsIdRequestBody)
-> Value
-> Parser PostRecipientsIdRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostRecipientsIdRequestBody" (\Object
obj -> (((((((((Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody
PostRecipientsIdRequestBody Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"bank_account")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
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
"card")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
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
"default_card")) Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
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 PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
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
"email")) Parser
(Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody)
-> Parser (Maybe [Text])
-> Parser
(Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text -> Maybe Text -> PostRecipientsIdRequestBody)
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 PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text -> Maybe Text -> PostRecipientsIdRequestBody)
-> Parser (Maybe PostRecipientsIdRequestBodyMetadata'Variants)
-> Parser (Maybe Text -> Maybe Text -> PostRecipientsIdRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PostRecipientsIdRequestBodyMetadata'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser (Maybe Text -> Maybe Text -> PostRecipientsIdRequestBody)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> PostRecipientsIdRequestBody)
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
"name")) Parser (Maybe Text -> PostRecipientsIdRequestBody)
-> Parser (Maybe Text) -> Parser PostRecipientsIdRequestBody
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
"tax_id"))
mkPostRecipientsIdRequestBody :: PostRecipientsIdRequestBody
mkPostRecipientsIdRequestBody :: PostRecipientsIdRequestBody
mkPostRecipientsIdRequestBody =
PostRecipientsIdRequestBody :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe PostRecipientsIdRequestBodyMetadata'Variants
-> Maybe Text
-> Maybe Text
-> PostRecipientsIdRequestBody
PostRecipientsIdRequestBody
{ postRecipientsIdRequestBodyBankAccount :: Maybe Text
postRecipientsIdRequestBodyBankAccount = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyCard :: Maybe Text
postRecipientsIdRequestBodyCard = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyDefaultCard :: Maybe Text
postRecipientsIdRequestBodyDefaultCard = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyDescription :: Maybe Text
postRecipientsIdRequestBodyDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyEmail :: Maybe Text
postRecipientsIdRequestBodyEmail = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyExpand :: Maybe [Text]
postRecipientsIdRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyMetadata :: Maybe PostRecipientsIdRequestBodyMetadata'Variants
postRecipientsIdRequestBodyMetadata = Maybe PostRecipientsIdRequestBodyMetadata'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyName :: Maybe Text
postRecipientsIdRequestBodyName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postRecipientsIdRequestBodyTaxId :: Maybe Text
postRecipientsIdRequestBodyTaxId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
}
data PostRecipientsIdRequestBodyMetadata'Variants
=
PostRecipientsIdRequestBodyMetadata'EmptyString
| PostRecipientsIdRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object
deriving (Int
-> PostRecipientsIdRequestBodyMetadata'Variants -> String -> String
[PostRecipientsIdRequestBodyMetadata'Variants] -> String -> String
PostRecipientsIdRequestBodyMetadata'Variants -> String
(Int
-> PostRecipientsIdRequestBodyMetadata'Variants
-> String
-> String)
-> (PostRecipientsIdRequestBodyMetadata'Variants -> String)
-> ([PostRecipientsIdRequestBodyMetadata'Variants]
-> String -> String)
-> Show PostRecipientsIdRequestBodyMetadata'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostRecipientsIdRequestBodyMetadata'Variants] -> String -> String
$cshowList :: [PostRecipientsIdRequestBodyMetadata'Variants] -> String -> String
show :: PostRecipientsIdRequestBodyMetadata'Variants -> String
$cshow :: PostRecipientsIdRequestBodyMetadata'Variants -> String
showsPrec :: Int
-> PostRecipientsIdRequestBodyMetadata'Variants -> String -> String
$cshowsPrec :: Int
-> PostRecipientsIdRequestBodyMetadata'Variants -> String -> String
GHC.Show.Show, PostRecipientsIdRequestBodyMetadata'Variants
-> PostRecipientsIdRequestBodyMetadata'Variants -> Bool
(PostRecipientsIdRequestBodyMetadata'Variants
-> PostRecipientsIdRequestBodyMetadata'Variants -> Bool)
-> (PostRecipientsIdRequestBodyMetadata'Variants
-> PostRecipientsIdRequestBodyMetadata'Variants -> Bool)
-> Eq PostRecipientsIdRequestBodyMetadata'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostRecipientsIdRequestBodyMetadata'Variants
-> PostRecipientsIdRequestBodyMetadata'Variants -> Bool
$c/= :: PostRecipientsIdRequestBodyMetadata'Variants
-> PostRecipientsIdRequestBodyMetadata'Variants -> Bool
== :: PostRecipientsIdRequestBodyMetadata'Variants
-> PostRecipientsIdRequestBodyMetadata'Variants -> Bool
$c== :: PostRecipientsIdRequestBodyMetadata'Variants
-> PostRecipientsIdRequestBodyMetadata'Variants -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostRecipientsIdRequestBodyMetadata'Variants where
toJSON :: PostRecipientsIdRequestBodyMetadata'Variants -> Value
toJSON (PostRecipientsIdRequestBodyMetadata'Object Object
a) = Object -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Object
a
toJSON (PostRecipientsIdRequestBodyMetadata'Variants
PostRecipientsIdRequestBodyMetadata'EmptyString) = Value
""
instance Data.Aeson.Types.FromJSON.FromJSON PostRecipientsIdRequestBodyMetadata'Variants where
parseJSON :: Value -> Parser PostRecipientsIdRequestBodyMetadata'Variants
parseJSON Value
val =
if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostRecipientsIdRequestBodyMetadata'Variants
-> Parser PostRecipientsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostRecipientsIdRequestBodyMetadata'Variants
PostRecipientsIdRequestBodyMetadata'EmptyString
| Bool
GHC.Base.otherwise -> case (Object -> PostRecipientsIdRequestBodyMetadata'Variants
PostRecipientsIdRequestBodyMetadata'Object (Object -> PostRecipientsIdRequestBodyMetadata'Variants)
-> Result Object
-> Result PostRecipientsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Object
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PostRecipientsIdRequestBodyMetadata'Variants
-> Result PostRecipientsIdRequestBodyMetadata'Variants
-> Result PostRecipientsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PostRecipientsIdRequestBodyMetadata'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
Data.Aeson.Types.Internal.Success PostRecipientsIdRequestBodyMetadata'Variants
a -> PostRecipientsIdRequestBodyMetadata'Variants
-> Parser PostRecipientsIdRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostRecipientsIdRequestBodyMetadata'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String -> Parser PostRecipientsIdRequestBodyMetadata'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a
data PostRecipientsIdResponse
=
PostRecipientsIdResponseError GHC.Base.String
|
PostRecipientsIdResponse200 Recipient
|
PostRecipientsIdResponseDefault Error
deriving (Int -> PostRecipientsIdResponse -> String -> String
[PostRecipientsIdResponse] -> String -> String
PostRecipientsIdResponse -> String
(Int -> PostRecipientsIdResponse -> String -> String)
-> (PostRecipientsIdResponse -> String)
-> ([PostRecipientsIdResponse] -> String -> String)
-> Show PostRecipientsIdResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostRecipientsIdResponse] -> String -> String
$cshowList :: [PostRecipientsIdResponse] -> String -> String
show :: PostRecipientsIdResponse -> String
$cshow :: PostRecipientsIdResponse -> String
showsPrec :: Int -> PostRecipientsIdResponse -> String -> String
$cshowsPrec :: Int -> PostRecipientsIdResponse -> String -> String
GHC.Show.Show, PostRecipientsIdResponse -> PostRecipientsIdResponse -> Bool
(PostRecipientsIdResponse -> PostRecipientsIdResponse -> Bool)
-> (PostRecipientsIdResponse -> PostRecipientsIdResponse -> Bool)
-> Eq PostRecipientsIdResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostRecipientsIdResponse -> PostRecipientsIdResponse -> Bool
$c/= :: PostRecipientsIdResponse -> PostRecipientsIdResponse -> Bool
== :: PostRecipientsIdResponse -> PostRecipientsIdResponse -> Bool
$c== :: PostRecipientsIdResponse -> PostRecipientsIdResponse -> Bool
GHC.Classes.Eq)