{-# 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 postCustomersCustomerSourcesIdVerify
module StripeAPI.Operations.PostCustomersCustomerSourcesIdVerify 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}/sources/{id}/verify
--
-- \<p>Verify a specified bank account for a given customer.\<\/p>
postCustomersCustomerSourcesIdVerify ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | Contains all available parameters of this operation (query and path parameters)
  PostCustomersCustomerSourcesIdVerifyParameters ->
  -- | The request body to send
  GHC.Maybe.Maybe PostCustomersCustomerSourcesIdVerifyRequestBody ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response PostCustomersCustomerSourcesIdVerifyResponse)
postCustomersCustomerSourcesIdVerify :: PostCustomersCustomerSourcesIdVerifyParameters
-> Maybe PostCustomersCustomerSourcesIdVerifyRequestBody
-> StripeT
     m (Response PostCustomersCustomerSourcesIdVerifyResponse)
postCustomersCustomerSourcesIdVerify
  PostCustomersCustomerSourcesIdVerifyParameters
parameters
  Maybe PostCustomersCustomerSourcesIdVerifyRequestBody
body =
    (Response ByteString
 -> Response PostCustomersCustomerSourcesIdVerifyResponse)
-> StripeT m (Response ByteString)
-> StripeT
     m (Response PostCustomersCustomerSourcesIdVerifyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
      ( \Response ByteString
response_0 ->
          (ByteString -> PostCustomersCustomerSourcesIdVerifyResponse)
-> Response ByteString
-> Response PostCustomersCustomerSourcesIdVerifyResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
            ( (String -> PostCustomersCustomerSourcesIdVerifyResponse)
-> (PostCustomersCustomerSourcesIdVerifyResponse
    -> PostCustomersCustomerSourcesIdVerifyResponse)
-> Either String PostCustomersCustomerSourcesIdVerifyResponse
-> PostCustomersCustomerSourcesIdVerifyResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostCustomersCustomerSourcesIdVerifyResponse
PostCustomersCustomerSourcesIdVerifyResponseError PostCustomersCustomerSourcesIdVerifyResponse
-> PostCustomersCustomerSourcesIdVerifyResponse
forall a. a -> a
GHC.Base.id
                (Either String PostCustomersCustomerSourcesIdVerifyResponse
 -> PostCustomersCustomerSourcesIdVerifyResponse)
-> (ByteString
    -> Either String PostCustomersCustomerSourcesIdVerifyResponse)
-> ByteString
-> PostCustomersCustomerSourcesIdVerifyResponse
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 -> PostCustomersCustomerSourcesIdVerifyResponse
PostCustomersCustomerSourcesIdVerifyResponse200
                                       (BankAccount -> PostCustomersCustomerSourcesIdVerifyResponse)
-> Either String BankAccount
-> Either String PostCustomersCustomerSourcesIdVerifyResponse
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 -> PostCustomersCustomerSourcesIdVerifyResponse
PostCustomersCustomerSourcesIdVerifyResponseDefault
                                       (Error -> PostCustomersCustomerSourcesIdVerifyResponse)
-> Either String Error
-> Either String PostCustomersCustomerSourcesIdVerifyResponse
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 PostCustomersCustomerSourcesIdVerifyResponse
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 PostCustomersCustomerSourcesIdVerifyRequestBody
-> 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 (PostCustomersCustomerSourcesIdVerifyParameters -> Text
postCustomersCustomerSourcesIdVerifyParametersPathCustomer PostCustomersCustomerSourcesIdVerifyParameters
parameters))) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ (String
"/sources/" 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 (PostCustomersCustomerSourcesIdVerifyParameters -> Text
postCustomersCustomerSourcesIdVerifyParametersPathId PostCustomersCustomerSourcesIdVerifyParameters
parameters))) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
"/verify"))))) [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty Maybe PostCustomersCustomerSourcesIdVerifyRequestBody
body RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)

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

instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSourcesIdVerifyParameters where
  toJSON :: PostCustomersCustomerSourcesIdVerifyParameters -> Value
toJSON PostCustomersCustomerSourcesIdVerifyParameters
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..= PostCustomersCustomerSourcesIdVerifyParameters -> Text
postCustomersCustomerSourcesIdVerifyParametersPathCustomer PostCustomersCustomerSourcesIdVerifyParameters
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..= PostCustomersCustomerSourcesIdVerifyParameters -> Text
postCustomersCustomerSourcesIdVerifyParametersPathId PostCustomersCustomerSourcesIdVerifyParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostCustomersCustomerSourcesIdVerifyParameters -> Encoding
toEncoding PostCustomersCustomerSourcesIdVerifyParameters
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..= PostCustomersCustomerSourcesIdVerifyParameters -> Text
postCustomersCustomerSourcesIdVerifyParametersPathCustomer PostCustomersCustomerSourcesIdVerifyParameters
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..= PostCustomersCustomerSourcesIdVerifyParameters -> Text
postCustomersCustomerSourcesIdVerifyParametersPathId PostCustomersCustomerSourcesIdVerifyParameters
obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSourcesIdVerifyParameters where
  parseJSON :: Value -> Parser PostCustomersCustomerSourcesIdVerifyParameters
parseJSON = String
-> (Object
    -> Parser PostCustomersCustomerSourcesIdVerifyParameters)
-> Value
-> Parser PostCustomersCustomerSourcesIdVerifyParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostCustomersCustomerSourcesIdVerifyParameters" (\Object
obj -> ((Text -> Text -> PostCustomersCustomerSourcesIdVerifyParameters)
-> Parser
     (Text -> Text -> PostCustomersCustomerSourcesIdVerifyParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text -> Text -> PostCustomersCustomerSourcesIdVerifyParameters
PostCustomersCustomerSourcesIdVerifyParameters Parser
  (Text -> Text -> PostCustomersCustomerSourcesIdVerifyParameters)
-> Parser Text
-> Parser (Text -> PostCustomersCustomerSourcesIdVerifyParameters)
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 -> PostCustomersCustomerSourcesIdVerifyParameters)
-> Parser Text
-> Parser PostCustomersCustomerSourcesIdVerifyParameters
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 'PostCustomersCustomerSourcesIdVerifyParameters' with all required fields.
mkPostCustomersCustomerSourcesIdVerifyParameters ::
  -- | 'postCustomersCustomerSourcesIdVerifyParametersPathCustomer'
  Data.Text.Internal.Text ->
  -- | 'postCustomersCustomerSourcesIdVerifyParametersPathId'
  Data.Text.Internal.Text ->
  PostCustomersCustomerSourcesIdVerifyParameters
mkPostCustomersCustomerSourcesIdVerifyParameters :: Text -> Text -> PostCustomersCustomerSourcesIdVerifyParameters
mkPostCustomersCustomerSourcesIdVerifyParameters Text
postCustomersCustomerSourcesIdVerifyParametersPathCustomer Text
postCustomersCustomerSourcesIdVerifyParametersPathId =
  PostCustomersCustomerSourcesIdVerifyParameters :: Text -> Text -> PostCustomersCustomerSourcesIdVerifyParameters
PostCustomersCustomerSourcesIdVerifyParameters
    { postCustomersCustomerSourcesIdVerifyParametersPathCustomer :: Text
postCustomersCustomerSourcesIdVerifyParametersPathCustomer = Text
postCustomersCustomerSourcesIdVerifyParametersPathCustomer,
      postCustomersCustomerSourcesIdVerifyParametersPathId :: Text
postCustomersCustomerSourcesIdVerifyParametersPathId = Text
postCustomersCustomerSourcesIdVerifyParametersPathId
    }

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

instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerSourcesIdVerifyRequestBody where
  toJSON :: PostCustomersCustomerSourcesIdVerifyRequestBody -> Value
toJSON PostCustomersCustomerSourcesIdVerifyRequestBody
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..= PostCustomersCustomerSourcesIdVerifyRequestBody -> Maybe [Int]
postCustomersCustomerSourcesIdVerifyRequestBodyAmounts PostCustomersCustomerSourcesIdVerifyRequestBody
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..= PostCustomersCustomerSourcesIdVerifyRequestBody -> Maybe [Text]
postCustomersCustomerSourcesIdVerifyRequestBodyExpand PostCustomersCustomerSourcesIdVerifyRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostCustomersCustomerSourcesIdVerifyRequestBody -> Encoding
toEncoding PostCustomersCustomerSourcesIdVerifyRequestBody
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..= PostCustomersCustomerSourcesIdVerifyRequestBody -> Maybe [Int]
postCustomersCustomerSourcesIdVerifyRequestBodyAmounts PostCustomersCustomerSourcesIdVerifyRequestBody
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..= PostCustomersCustomerSourcesIdVerifyRequestBody -> Maybe [Text]
postCustomersCustomerSourcesIdVerifyRequestBodyExpand PostCustomersCustomerSourcesIdVerifyRequestBody
obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerSourcesIdVerifyRequestBody where
  parseJSON :: Value -> Parser PostCustomersCustomerSourcesIdVerifyRequestBody
parseJSON = String
-> (Object
    -> Parser PostCustomersCustomerSourcesIdVerifyRequestBody)
-> Value
-> Parser PostCustomersCustomerSourcesIdVerifyRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostCustomersCustomerSourcesIdVerifyRequestBody" (\Object
obj -> ((Maybe [Int]
 -> Maybe [Text] -> PostCustomersCustomerSourcesIdVerifyRequestBody)
-> Parser
     (Maybe [Int]
      -> Maybe [Text] -> PostCustomersCustomerSourcesIdVerifyRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe [Int]
-> Maybe [Text] -> PostCustomersCustomerSourcesIdVerifyRequestBody
PostCustomersCustomerSourcesIdVerifyRequestBody Parser
  (Maybe [Int]
   -> Maybe [Text] -> PostCustomersCustomerSourcesIdVerifyRequestBody)
-> Parser (Maybe [Int])
-> Parser
     (Maybe [Text] -> PostCustomersCustomerSourcesIdVerifyRequestBody)
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] -> PostCustomersCustomerSourcesIdVerifyRequestBody)
-> Parser (Maybe [Text])
-> Parser PostCustomersCustomerSourcesIdVerifyRequestBody
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 'PostCustomersCustomerSourcesIdVerifyRequestBody' with all required fields.
mkPostCustomersCustomerSourcesIdVerifyRequestBody :: PostCustomersCustomerSourcesIdVerifyRequestBody
mkPostCustomersCustomerSourcesIdVerifyRequestBody :: PostCustomersCustomerSourcesIdVerifyRequestBody
mkPostCustomersCustomerSourcesIdVerifyRequestBody =
  PostCustomersCustomerSourcesIdVerifyRequestBody :: Maybe [Int]
-> Maybe [Text] -> PostCustomersCustomerSourcesIdVerifyRequestBody
PostCustomersCustomerSourcesIdVerifyRequestBody
    { postCustomersCustomerSourcesIdVerifyRequestBodyAmounts :: Maybe [Int]
postCustomersCustomerSourcesIdVerifyRequestBodyAmounts = Maybe [Int]
forall a. Maybe a
GHC.Maybe.Nothing,
      postCustomersCustomerSourcesIdVerifyRequestBodyExpand :: Maybe [Text]
postCustomersCustomerSourcesIdVerifyRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Represents a response of the operation 'postCustomersCustomerSourcesIdVerify'.
--
-- 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), 'PostCustomersCustomerSourcesIdVerifyResponseError' is used.
data PostCustomersCustomerSourcesIdVerifyResponse
  = -- | Means either no matching case available or a parse error
    PostCustomersCustomerSourcesIdVerifyResponseError GHC.Base.String
  | -- | Successful response.
    PostCustomersCustomerSourcesIdVerifyResponse200 BankAccount
  | -- | Error response.
    PostCustomersCustomerSourcesIdVerifyResponseDefault Error
  deriving (Int
-> PostCustomersCustomerSourcesIdVerifyResponse -> String -> String
[PostCustomersCustomerSourcesIdVerifyResponse] -> String -> String
PostCustomersCustomerSourcesIdVerifyResponse -> String
(Int
 -> PostCustomersCustomerSourcesIdVerifyResponse
 -> String
 -> String)
-> (PostCustomersCustomerSourcesIdVerifyResponse -> String)
-> ([PostCustomersCustomerSourcesIdVerifyResponse]
    -> String -> String)
-> Show PostCustomersCustomerSourcesIdVerifyResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostCustomersCustomerSourcesIdVerifyResponse] -> String -> String
$cshowList :: [PostCustomersCustomerSourcesIdVerifyResponse] -> String -> String
show :: PostCustomersCustomerSourcesIdVerifyResponse -> String
$cshow :: PostCustomersCustomerSourcesIdVerifyResponse -> String
showsPrec :: Int
-> PostCustomersCustomerSourcesIdVerifyResponse -> String -> String
$cshowsPrec :: Int
-> PostCustomersCustomerSourcesIdVerifyResponse -> String -> String
GHC.Show.Show, PostCustomersCustomerSourcesIdVerifyResponse
-> PostCustomersCustomerSourcesIdVerifyResponse -> Bool
(PostCustomersCustomerSourcesIdVerifyResponse
 -> PostCustomersCustomerSourcesIdVerifyResponse -> Bool)
-> (PostCustomersCustomerSourcesIdVerifyResponse
    -> PostCustomersCustomerSourcesIdVerifyResponse -> Bool)
-> Eq PostCustomersCustomerSourcesIdVerifyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostCustomersCustomerSourcesIdVerifyResponse
-> PostCustomersCustomerSourcesIdVerifyResponse -> Bool
$c/= :: PostCustomersCustomerSourcesIdVerifyResponse
-> PostCustomersCustomerSourcesIdVerifyResponse -> Bool
== :: PostCustomersCustomerSourcesIdVerifyResponse
-> PostCustomersCustomerSourcesIdVerifyResponse -> Bool
$c== :: PostCustomersCustomerSourcesIdVerifyResponse
-> PostCustomersCustomerSourcesIdVerifyResponse -> Bool
GHC.Classes.Eq)