{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Operations.GetAccountsAccountBankAccountsId 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
getAccountsAccountBankAccountsId ::
forall m.
StripeAPI.Common.MonadHTTP m =>
GetAccountsAccountBankAccountsIdParameters ->
StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response GetAccountsAccountBankAccountsIdResponse)
getAccountsAccountBankAccountsId :: GetAccountsAccountBankAccountsIdParameters
-> StripeT m (Response GetAccountsAccountBankAccountsIdResponse)
getAccountsAccountBankAccountsId GetAccountsAccountBankAccountsIdParameters
parameters =
(Response ByteString
-> Response GetAccountsAccountBankAccountsIdResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response GetAccountsAccountBankAccountsIdResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( \Response ByteString
response_0 ->
(ByteString -> GetAccountsAccountBankAccountsIdResponse)
-> Response ByteString
-> Response GetAccountsAccountBankAccountsIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( (String -> GetAccountsAccountBankAccountsIdResponse)
-> (GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse)
-> Either String GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetAccountsAccountBankAccountsIdResponse
GetAccountsAccountBankAccountsIdResponseError GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse
forall a. a -> a
GHC.Base.id
(Either String GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse)
-> (ByteString
-> Either String GetAccountsAccountBankAccountsIdResponse)
-> ByteString
-> GetAccountsAccountBankAccountsIdResponse
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) ->
ExternalAccount -> GetAccountsAccountBankAccountsIdResponse
GetAccountsAccountBankAccountsIdResponse200
(ExternalAccount -> GetAccountsAccountBankAccountsIdResponse)
-> Either String ExternalAccount
-> Either String GetAccountsAccountBankAccountsIdResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String ExternalAccount
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
ExternalAccount
)
| 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 -> GetAccountsAccountBankAccountsIdResponse
GetAccountsAccountBankAccountsIdResponseDefault
(Error -> GetAccountsAccountBankAccountsIdResponse)
-> Either String Error
-> Either String GetAccountsAccountBankAccountsIdResponse
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 GetAccountsAccountBankAccountsIdResponse
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/accounts/" 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 (GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathAccount GetAccountsAccountBankAccountsIdParameters
parameters))) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ (String
"/bank_accounts/" 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 (GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathId GetAccountsAccountBankAccountsIdParameters
parameters))) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
""))))) [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.<$> GetAccountsAccountBankAccountsIdParameters -> Maybe [Text]
getAccountsAccountBankAccountsIdParametersQueryExpand GetAccountsAccountBankAccountsIdParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True])
data GetAccountsAccountBankAccountsIdParameters = GetAccountsAccountBankAccountsIdParameters
{
GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathAccount :: Data.Text.Internal.Text,
GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathId :: Data.Text.Internal.Text,
GetAccountsAccountBankAccountsIdParameters -> Maybe [Text]
getAccountsAccountBankAccountsIdParametersQueryExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text]))
}
deriving
( Int
-> GetAccountsAccountBankAccountsIdParameters -> String -> String
[GetAccountsAccountBankAccountsIdParameters] -> String -> String
GetAccountsAccountBankAccountsIdParameters -> String
(Int
-> GetAccountsAccountBankAccountsIdParameters -> String -> String)
-> (GetAccountsAccountBankAccountsIdParameters -> String)
-> ([GetAccountsAccountBankAccountsIdParameters]
-> String -> String)
-> Show GetAccountsAccountBankAccountsIdParameters
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [GetAccountsAccountBankAccountsIdParameters] -> String -> String
$cshowList :: [GetAccountsAccountBankAccountsIdParameters] -> String -> String
show :: GetAccountsAccountBankAccountsIdParameters -> String
$cshow :: GetAccountsAccountBankAccountsIdParameters -> String
showsPrec :: Int
-> GetAccountsAccountBankAccountsIdParameters -> String -> String
$cshowsPrec :: Int
-> GetAccountsAccountBankAccountsIdParameters -> String -> String
GHC.Show.Show,
GetAccountsAccountBankAccountsIdParameters
-> GetAccountsAccountBankAccountsIdParameters -> Bool
(GetAccountsAccountBankAccountsIdParameters
-> GetAccountsAccountBankAccountsIdParameters -> Bool)
-> (GetAccountsAccountBankAccountsIdParameters
-> GetAccountsAccountBankAccountsIdParameters -> Bool)
-> Eq GetAccountsAccountBankAccountsIdParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccountsAccountBankAccountsIdParameters
-> GetAccountsAccountBankAccountsIdParameters -> Bool
$c/= :: GetAccountsAccountBankAccountsIdParameters
-> GetAccountsAccountBankAccountsIdParameters -> Bool
== :: GetAccountsAccountBankAccountsIdParameters
-> GetAccountsAccountBankAccountsIdParameters -> Bool
$c== :: GetAccountsAccountBankAccountsIdParameters
-> GetAccountsAccountBankAccountsIdParameters -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON GetAccountsAccountBankAccountsIdParameters where
toJSON :: GetAccountsAccountBankAccountsIdParameters -> Value
toJSON GetAccountsAccountBankAccountsIdParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"pathAccount" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathAccount GetAccountsAccountBankAccountsIdParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"pathId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathId GetAccountsAccountBankAccountsIdParameters
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..= GetAccountsAccountBankAccountsIdParameters -> Maybe [Text]
getAccountsAccountBankAccountsIdParametersQueryExpand GetAccountsAccountBankAccountsIdParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: GetAccountsAccountBankAccountsIdParameters -> Encoding
toEncoding GetAccountsAccountBankAccountsIdParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"pathAccount" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathAccount GetAccountsAccountBankAccountsIdParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"pathId" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetAccountsAccountBankAccountsIdParameters -> Text
getAccountsAccountBankAccountsIdParametersPathId GetAccountsAccountBankAccountsIdParameters
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..= GetAccountsAccountBankAccountsIdParameters -> Maybe [Text]
getAccountsAccountBankAccountsIdParametersQueryExpand GetAccountsAccountBankAccountsIdParameters
obj)))
instance Data.Aeson.Types.FromJSON.FromJSON GetAccountsAccountBankAccountsIdParameters where
parseJSON :: Value -> Parser GetAccountsAccountBankAccountsIdParameters
parseJSON = String
-> (Object -> Parser GetAccountsAccountBankAccountsIdParameters)
-> Value
-> Parser GetAccountsAccountBankAccountsIdParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetAccountsAccountBankAccountsIdParameters" (\Object
obj -> (((Text
-> Text
-> Maybe [Text]
-> GetAccountsAccountBankAccountsIdParameters)
-> Parser
(Text
-> Text
-> Maybe [Text]
-> GetAccountsAccountBankAccountsIdParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text
-> Text
-> Maybe [Text]
-> GetAccountsAccountBankAccountsIdParameters
GetAccountsAccountBankAccountsIdParameters Parser
(Text
-> Text
-> Maybe [Text]
-> GetAccountsAccountBankAccountsIdParameters)
-> Parser Text
-> Parser
(Text
-> Maybe [Text] -> GetAccountsAccountBankAccountsIdParameters)
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
"pathAccount")) Parser
(Text
-> Maybe [Text] -> GetAccountsAccountBankAccountsIdParameters)
-> Parser Text
-> Parser
(Maybe [Text] -> GetAccountsAccountBankAccountsIdParameters)
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
"pathId")) Parser (Maybe [Text] -> GetAccountsAccountBankAccountsIdParameters)
-> Parser (Maybe [Text])
-> Parser GetAccountsAccountBankAccountsIdParameters
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"))
mkGetAccountsAccountBankAccountsIdParameters ::
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
GetAccountsAccountBankAccountsIdParameters
mkGetAccountsAccountBankAccountsIdParameters :: Text -> Text -> GetAccountsAccountBankAccountsIdParameters
mkGetAccountsAccountBankAccountsIdParameters Text
getAccountsAccountBankAccountsIdParametersPathAccount Text
getAccountsAccountBankAccountsIdParametersPathId =
GetAccountsAccountBankAccountsIdParameters :: Text
-> Text
-> Maybe [Text]
-> GetAccountsAccountBankAccountsIdParameters
GetAccountsAccountBankAccountsIdParameters
{ getAccountsAccountBankAccountsIdParametersPathAccount :: Text
getAccountsAccountBankAccountsIdParametersPathAccount = Text
getAccountsAccountBankAccountsIdParametersPathAccount,
getAccountsAccountBankAccountsIdParametersPathId :: Text
getAccountsAccountBankAccountsIdParametersPathId = Text
getAccountsAccountBankAccountsIdParametersPathId,
getAccountsAccountBankAccountsIdParametersQueryExpand :: Maybe [Text]
getAccountsAccountBankAccountsIdParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
}
data GetAccountsAccountBankAccountsIdResponse
=
GetAccountsAccountBankAccountsIdResponseError GHC.Base.String
|
GetAccountsAccountBankAccountsIdResponse200 ExternalAccount
|
GetAccountsAccountBankAccountsIdResponseDefault Error
deriving (Int -> GetAccountsAccountBankAccountsIdResponse -> String -> String
[GetAccountsAccountBankAccountsIdResponse] -> String -> String
GetAccountsAccountBankAccountsIdResponse -> String
(Int
-> GetAccountsAccountBankAccountsIdResponse -> String -> String)
-> (GetAccountsAccountBankAccountsIdResponse -> String)
-> ([GetAccountsAccountBankAccountsIdResponse] -> String -> String)
-> Show GetAccountsAccountBankAccountsIdResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [GetAccountsAccountBankAccountsIdResponse] -> String -> String
$cshowList :: [GetAccountsAccountBankAccountsIdResponse] -> String -> String
show :: GetAccountsAccountBankAccountsIdResponse -> String
$cshow :: GetAccountsAccountBankAccountsIdResponse -> String
showsPrec :: Int -> GetAccountsAccountBankAccountsIdResponse -> String -> String
$cshowsPrec :: Int -> GetAccountsAccountBankAccountsIdResponse -> String -> String
GHC.Show.Show, GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse -> Bool
(GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse -> Bool)
-> (GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse -> Bool)
-> Eq GetAccountsAccountBankAccountsIdResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse -> Bool
$c/= :: GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse -> Bool
== :: GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse -> Bool
$c== :: GetAccountsAccountBankAccountsIdResponse
-> GetAccountsAccountBankAccountsIdResponse -> Bool
GHC.Classes.Eq)