{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the different functions to run the operation postCustomersCustomerBankAccountsIdVerify
module StripeAPI.Operations.PostCustomersCustomerBankAccountsIdVerify 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

-- | > POST /v1/customers/{customer}/bank_accounts/{id}/verify
--
-- \<p>Verify a specified bank account for a given customer.\<\/p>
postCustomersCustomerBankAccountsIdVerify ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | Contains all available parameters of this operation (query and path parameters)
  PostCustomersCustomerBankAccountsIdVerifyParameters ->
  -- | The request body to send
  GHC.Maybe.Maybe PostCustomersCustomerBankAccountsIdVerifyRequestBody ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response PostCustomersCustomerBankAccountsIdVerifyResponse)
postCustomersCustomerBankAccountsIdVerify :: PostCustomersCustomerBankAccountsIdVerifyParameters
-> Maybe PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> StripeT
     m (Response PostCustomersCustomerBankAccountsIdVerifyResponse)
postCustomersCustomerBankAccountsIdVerify
  PostCustomersCustomerBankAccountsIdVerifyParameters
parameters
  Maybe PostCustomersCustomerBankAccountsIdVerifyRequestBody
body =
    (Response ByteString
 -> Response PostCustomersCustomerBankAccountsIdVerifyResponse)
-> StripeT m (Response ByteString)
-> StripeT
     m (Response PostCustomersCustomerBankAccountsIdVerifyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
      ( \Response ByteString
response_0 ->
          (ByteString -> PostCustomersCustomerBankAccountsIdVerifyResponse)
-> Response ByteString
-> Response PostCustomersCustomerBankAccountsIdVerifyResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
            ( (String -> PostCustomersCustomerBankAccountsIdVerifyResponse)
-> (PostCustomersCustomerBankAccountsIdVerifyResponse
    -> PostCustomersCustomerBankAccountsIdVerifyResponse)
-> Either String PostCustomersCustomerBankAccountsIdVerifyResponse
-> PostCustomersCustomerBankAccountsIdVerifyResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostCustomersCustomerBankAccountsIdVerifyResponse
PostCustomersCustomerBankAccountsIdVerifyResponseError PostCustomersCustomerBankAccountsIdVerifyResponse
-> PostCustomersCustomerBankAccountsIdVerifyResponse
forall a. a -> a
GHC.Base.id
                (Either String PostCustomersCustomerBankAccountsIdVerifyResponse
 -> PostCustomersCustomerBankAccountsIdVerifyResponse)
-> (ByteString
    -> Either String PostCustomersCustomerBankAccountsIdVerifyResponse)
-> ByteString
-> PostCustomersCustomerBankAccountsIdVerifyResponse
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) ->
                                     BankAccount -> PostCustomersCustomerBankAccountsIdVerifyResponse
PostCustomersCustomerBankAccountsIdVerifyResponse200
                                       (BankAccount -> PostCustomersCustomerBankAccountsIdVerifyResponse)
-> Either String BankAccount
-> Either String PostCustomersCustomerBankAccountsIdVerifyResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String BankAccount
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                            Data.Either.Either
                                                              GHC.Base.String
                                                              BankAccount
                                                        )
                                   | 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 -> PostCustomersCustomerBankAccountsIdVerifyResponse
PostCustomersCustomerBankAccountsIdVerifyResponseDefault
                                       (Error -> PostCustomersCustomerBankAccountsIdVerifyResponse)
-> Either String Error
-> Either String PostCustomersCustomerBankAccountsIdVerifyResponse
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 PostCustomersCustomerBankAccountsIdVerifyResponse
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 PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> RequestBodyEncoding
-> StripeT m (Response ByteString)
forall (m :: * -> *) body.
(MonadHTTP m, ToJSON body) =>
Text
-> Text
-> [QueryParameter]
-> Maybe body
-> RequestBodyEncoding
-> StripeT 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/customers/" 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 (PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer PostCustomersCustomerBankAccountsIdVerifyParameters
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 (PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathId PostCustomersCustomerBankAccountsIdVerifyParameters
parameters))) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
"/verify"))))) [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty Maybe PostCustomersCustomerBankAccountsIdVerifyRequestBody
body RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)

-- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/bank_accounts\/{id}\/verify.POST.parameters@ in the specification.
data PostCustomersCustomerBankAccountsIdVerifyParameters = PostCustomersCustomerBankAccountsIdVerifyParameters
  { -- | pathCustomer: Represents the parameter named \'customer\'
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer :: Data.Text.Internal.Text,
    -- | pathId: Represents the parameter named \'id\'
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathId :: Data.Text.Internal.Text
  }
  deriving
    ( Int
-> PostCustomersCustomerBankAccountsIdVerifyParameters
-> String
-> String
[PostCustomersCustomerBankAccountsIdVerifyParameters]
-> String -> String
PostCustomersCustomerBankAccountsIdVerifyParameters -> String
(Int
 -> PostCustomersCustomerBankAccountsIdVerifyParameters
 -> String
 -> String)
-> (PostCustomersCustomerBankAccountsIdVerifyParameters -> String)
-> ([PostCustomersCustomerBankAccountsIdVerifyParameters]
    -> String -> String)
-> Show PostCustomersCustomerBankAccountsIdVerifyParameters
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostCustomersCustomerBankAccountsIdVerifyParameters]
-> String -> String
$cshowList :: [PostCustomersCustomerBankAccountsIdVerifyParameters]
-> String -> String
show :: PostCustomersCustomerBankAccountsIdVerifyParameters -> String
$cshow :: PostCustomersCustomerBankAccountsIdVerifyParameters -> String
showsPrec :: Int
-> PostCustomersCustomerBankAccountsIdVerifyParameters
-> String
-> String
$cshowsPrec :: Int
-> PostCustomersCustomerBankAccountsIdVerifyParameters
-> String
-> String
GHC.Show.Show,
      PostCustomersCustomerBankAccountsIdVerifyParameters
-> PostCustomersCustomerBankAccountsIdVerifyParameters -> Bool
(PostCustomersCustomerBankAccountsIdVerifyParameters
 -> PostCustomersCustomerBankAccountsIdVerifyParameters -> Bool)
-> (PostCustomersCustomerBankAccountsIdVerifyParameters
    -> PostCustomersCustomerBankAccountsIdVerifyParameters -> Bool)
-> Eq PostCustomersCustomerBankAccountsIdVerifyParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostCustomersCustomerBankAccountsIdVerifyParameters
-> PostCustomersCustomerBankAccountsIdVerifyParameters -> Bool
$c/= :: PostCustomersCustomerBankAccountsIdVerifyParameters
-> PostCustomersCustomerBankAccountsIdVerifyParameters -> Bool
== :: PostCustomersCustomerBankAccountsIdVerifyParameters
-> PostCustomersCustomerBankAccountsIdVerifyParameters -> Bool
$c== :: PostCustomersCustomerBankAccountsIdVerifyParameters
-> PostCustomersCustomerBankAccountsIdVerifyParameters -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerBankAccountsIdVerifyParameters where
  toJSON :: PostCustomersCustomerBankAccountsIdVerifyParameters -> Value
toJSON PostCustomersCustomerBankAccountsIdVerifyParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"pathCustomer" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer PostCustomersCustomerBankAccountsIdVerifyParameters
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..= PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathId PostCustomersCustomerBankAccountsIdVerifyParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostCustomersCustomerBankAccountsIdVerifyParameters -> Encoding
toEncoding PostCustomersCustomerBankAccountsIdVerifyParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"pathCustomer" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer PostCustomersCustomerBankAccountsIdVerifyParameters
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..= PostCustomersCustomerBankAccountsIdVerifyParameters -> Text
postCustomersCustomerBankAccountsIdVerifyParametersPathId PostCustomersCustomerBankAccountsIdVerifyParameters
obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerBankAccountsIdVerifyParameters where
  parseJSON :: Value -> Parser PostCustomersCustomerBankAccountsIdVerifyParameters
parseJSON = String
-> (Object
    -> Parser PostCustomersCustomerBankAccountsIdVerifyParameters)
-> Value
-> Parser PostCustomersCustomerBankAccountsIdVerifyParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostCustomersCustomerBankAccountsIdVerifyParameters" (\Object
obj -> ((Text
 -> Text -> PostCustomersCustomerBankAccountsIdVerifyParameters)
-> Parser
     (Text
      -> Text -> PostCustomersCustomerBankAccountsIdVerifyParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text -> Text -> PostCustomersCustomerBankAccountsIdVerifyParameters
PostCustomersCustomerBankAccountsIdVerifyParameters Parser
  (Text
   -> Text -> PostCustomersCustomerBankAccountsIdVerifyParameters)
-> Parser Text
-> Parser
     (Text -> PostCustomersCustomerBankAccountsIdVerifyParameters)
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
"pathCustomer")) Parser
  (Text -> PostCustomersCustomerBankAccountsIdVerifyParameters)
-> Parser Text
-> Parser PostCustomersCustomerBankAccountsIdVerifyParameters
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"))

-- | Create a new 'PostCustomersCustomerBankAccountsIdVerifyParameters' with all required fields.
mkPostCustomersCustomerBankAccountsIdVerifyParameters ::
  -- | 'postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer'
  Data.Text.Internal.Text ->
  -- | 'postCustomersCustomerBankAccountsIdVerifyParametersPathId'
  Data.Text.Internal.Text ->
  PostCustomersCustomerBankAccountsIdVerifyParameters
mkPostCustomersCustomerBankAccountsIdVerifyParameters :: Text -> Text -> PostCustomersCustomerBankAccountsIdVerifyParameters
mkPostCustomersCustomerBankAccountsIdVerifyParameters Text
postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer Text
postCustomersCustomerBankAccountsIdVerifyParametersPathId =
  PostCustomersCustomerBankAccountsIdVerifyParameters :: Text -> Text -> PostCustomersCustomerBankAccountsIdVerifyParameters
PostCustomersCustomerBankAccountsIdVerifyParameters
    { postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer :: Text
postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer = Text
postCustomersCustomerBankAccountsIdVerifyParametersPathCustomer,
      postCustomersCustomerBankAccountsIdVerifyParametersPathId :: Text
postCustomersCustomerBankAccountsIdVerifyParametersPathId = Text
postCustomersCustomerBankAccountsIdVerifyParametersPathId
    }

-- | Defines the object schema located at @paths.\/v1\/customers\/{customer}\/bank_accounts\/{id}\/verify.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification.
data PostCustomersCustomerBankAccountsIdVerifyRequestBody = PostCustomersCustomerBankAccountsIdVerifyRequestBody
  { -- | amounts: Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.
    PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Maybe [Int]
postCustomersCustomerBankAccountsIdVerifyRequestBodyAmounts :: (GHC.Maybe.Maybe ([GHC.Types.Int])),
    -- | expand: Specifies which fields in the response should be expanded.
    PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> Maybe [Text]
postCustomersCustomerBankAccountsIdVerifyRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text]))
  }
  deriving
    ( Int
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> String
-> String
[PostCustomersCustomerBankAccountsIdVerifyRequestBody]
-> String -> String
PostCustomersCustomerBankAccountsIdVerifyRequestBody -> String
(Int
 -> PostCustomersCustomerBankAccountsIdVerifyRequestBody
 -> String
 -> String)
-> (PostCustomersCustomerBankAccountsIdVerifyRequestBody -> String)
-> ([PostCustomersCustomerBankAccountsIdVerifyRequestBody]
    -> String -> String)
-> Show PostCustomersCustomerBankAccountsIdVerifyRequestBody
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostCustomersCustomerBankAccountsIdVerifyRequestBody]
-> String -> String
$cshowList :: [PostCustomersCustomerBankAccountsIdVerifyRequestBody]
-> String -> String
show :: PostCustomersCustomerBankAccountsIdVerifyRequestBody -> String
$cshow :: PostCustomersCustomerBankAccountsIdVerifyRequestBody -> String
showsPrec :: Int
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> String
-> String
$cshowsPrec :: Int
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> String
-> String
GHC.Show.Show,
      PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Bool
(PostCustomersCustomerBankAccountsIdVerifyRequestBody
 -> PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Bool)
-> (PostCustomersCustomerBankAccountsIdVerifyRequestBody
    -> PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Bool)
-> Eq PostCustomersCustomerBankAccountsIdVerifyRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Bool
$c/= :: PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Bool
== :: PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Bool
$c== :: PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerBankAccountsIdVerifyRequestBody where
  toJSON :: PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Value
toJSON PostCustomersCustomerBankAccountsIdVerifyRequestBody
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"amounts" Text -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Maybe [Int]
postCustomersCustomerBankAccountsIdVerifyRequestBodyAmounts PostCustomersCustomerBankAccountsIdVerifyRequestBody
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..= PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> Maybe [Text]
postCustomersCustomerBankAccountsIdVerifyRequestBodyExpand PostCustomersCustomerBankAccountsIdVerifyRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Encoding
toEncoding PostCustomersCustomerBankAccountsIdVerifyRequestBody
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"amounts" Text -> Maybe [Int] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostCustomersCustomerBankAccountsIdVerifyRequestBody -> Maybe [Int]
postCustomersCustomerBankAccountsIdVerifyRequestBodyAmounts PostCustomersCustomerBankAccountsIdVerifyRequestBody
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..= PostCustomersCustomerBankAccountsIdVerifyRequestBody
-> Maybe [Text]
postCustomersCustomerBankAccountsIdVerifyRequestBodyExpand PostCustomersCustomerBankAccountsIdVerifyRequestBody
obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerBankAccountsIdVerifyRequestBody where
  parseJSON :: Value
-> Parser PostCustomersCustomerBankAccountsIdVerifyRequestBody
parseJSON = String
-> (Object
    -> Parser PostCustomersCustomerBankAccountsIdVerifyRequestBody)
-> Value
-> Parser PostCustomersCustomerBankAccountsIdVerifyRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostCustomersCustomerBankAccountsIdVerifyRequestBody" (\Object
obj -> ((Maybe [Int]
 -> Maybe [Text]
 -> PostCustomersCustomerBankAccountsIdVerifyRequestBody)
-> Parser
     (Maybe [Int]
      -> Maybe [Text]
      -> PostCustomersCustomerBankAccountsIdVerifyRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe [Int]
-> Maybe [Text]
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody
PostCustomersCustomerBankAccountsIdVerifyRequestBody Parser
  (Maybe [Int]
   -> Maybe [Text]
   -> PostCustomersCustomerBankAccountsIdVerifyRequestBody)
-> Parser (Maybe [Int])
-> Parser
     (Maybe [Text]
      -> PostCustomersCustomerBankAccountsIdVerifyRequestBody)
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
"amounts")) Parser
  (Maybe [Text]
   -> PostCustomersCustomerBankAccountsIdVerifyRequestBody)
-> Parser (Maybe [Text])
-> Parser PostCustomersCustomerBankAccountsIdVerifyRequestBody
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"))

-- | Create a new 'PostCustomersCustomerBankAccountsIdVerifyRequestBody' with all required fields.
mkPostCustomersCustomerBankAccountsIdVerifyRequestBody :: PostCustomersCustomerBankAccountsIdVerifyRequestBody
mkPostCustomersCustomerBankAccountsIdVerifyRequestBody :: PostCustomersCustomerBankAccountsIdVerifyRequestBody
mkPostCustomersCustomerBankAccountsIdVerifyRequestBody =
  PostCustomersCustomerBankAccountsIdVerifyRequestBody :: Maybe [Int]
-> Maybe [Text]
-> PostCustomersCustomerBankAccountsIdVerifyRequestBody
PostCustomersCustomerBankAccountsIdVerifyRequestBody
    { postCustomersCustomerBankAccountsIdVerifyRequestBodyAmounts :: Maybe [Int]
postCustomersCustomerBankAccountsIdVerifyRequestBodyAmounts = Maybe [Int]
forall a. Maybe a
GHC.Maybe.Nothing,
      postCustomersCustomerBankAccountsIdVerifyRequestBodyExpand :: Maybe [Text]
postCustomersCustomerBankAccountsIdVerifyRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Represents a response of the operation 'postCustomersCustomerBankAccountsIdVerify'.
--
-- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'PostCustomersCustomerBankAccountsIdVerifyResponseError' is used.
data PostCustomersCustomerBankAccountsIdVerifyResponse
  = -- | Means either no matching case available or a parse error
    PostCustomersCustomerBankAccountsIdVerifyResponseError GHC.Base.String
  | -- | Successful response.
    PostCustomersCustomerBankAccountsIdVerifyResponse200 BankAccount
  | -- | Error response.
    PostCustomersCustomerBankAccountsIdVerifyResponseDefault Error
  deriving (Int
-> PostCustomersCustomerBankAccountsIdVerifyResponse
-> String
-> String
[PostCustomersCustomerBankAccountsIdVerifyResponse]
-> String -> String
PostCustomersCustomerBankAccountsIdVerifyResponse -> String
(Int
 -> PostCustomersCustomerBankAccountsIdVerifyResponse
 -> String
 -> String)
-> (PostCustomersCustomerBankAccountsIdVerifyResponse -> String)
-> ([PostCustomersCustomerBankAccountsIdVerifyResponse]
    -> String -> String)
-> Show PostCustomersCustomerBankAccountsIdVerifyResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostCustomersCustomerBankAccountsIdVerifyResponse]
-> String -> String
$cshowList :: [PostCustomersCustomerBankAccountsIdVerifyResponse]
-> String -> String
show :: PostCustomersCustomerBankAccountsIdVerifyResponse -> String
$cshow :: PostCustomersCustomerBankAccountsIdVerifyResponse -> String
showsPrec :: Int
-> PostCustomersCustomerBankAccountsIdVerifyResponse
-> String
-> String
$cshowsPrec :: Int
-> PostCustomersCustomerBankAccountsIdVerifyResponse
-> String
-> String
GHC.Show.Show, PostCustomersCustomerBankAccountsIdVerifyResponse
-> PostCustomersCustomerBankAccountsIdVerifyResponse -> Bool
(PostCustomersCustomerBankAccountsIdVerifyResponse
 -> PostCustomersCustomerBankAccountsIdVerifyResponse -> Bool)
-> (PostCustomersCustomerBankAccountsIdVerifyResponse
    -> PostCustomersCustomerBankAccountsIdVerifyResponse -> Bool)
-> Eq PostCustomersCustomerBankAccountsIdVerifyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostCustomersCustomerBankAccountsIdVerifyResponse
-> PostCustomersCustomerBankAccountsIdVerifyResponse -> Bool
$c/= :: PostCustomersCustomerBankAccountsIdVerifyResponse
-> PostCustomersCustomerBankAccountsIdVerifyResponse -> Bool
== :: PostCustomersCustomerBankAccountsIdVerifyResponse
-> PostCustomersCustomerBankAccountsIdVerifyResponse -> Bool
$c== :: PostCustomersCustomerBankAccountsIdVerifyResponse
-> PostCustomersCustomerBankAccountsIdVerifyResponse -> Bool
GHC.Classes.Eq)