status\<\/a>.\<\/p>
--
-- \Once canceled, future submission attempts are disabled. This cannot be undone. \Learn more\<\/a>.\<\/p>
postIdentityVerificationSessionsSessionCancel ::
forall m.
StripeAPI.Common.MonadHTTP m =>
-- | session | Constraints: Maximum length of 5000
Data.Text.Internal.Text ->
-- | The request body to send
GHC.Maybe.Maybe PostIdentityVerificationSessionsSessionCancelRequestBody ->
-- | Monadic computation which returns the result of the operation
StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostIdentityVerificationSessionsSessionCancelResponse)
postIdentityVerificationSessionsSessionCancel
session
body =
GHC.Base.fmap
( \response_0 ->
GHC.Base.fmap
( Data.Either.either PostIdentityVerificationSessionsSessionCancelResponseError GHC.Base.id
GHC.Base.. ( \response body ->
if
| (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) ->
PostIdentityVerificationSessionsSessionCancelResponse200
Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
Data.Either.Either
GHC.Base.String
Identity'verificationSession
)
| GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) ->
PostIdentityVerificationSessionsSessionCancelResponseDefault
Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
Data.Either.Either
GHC.Base.String
Error
)
| GHC.Base.otherwise -> Data.Either.Left "Missing default response type"
)
response_0
)
response_0
)
(StripeAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack ("/v1/identity/verification_sessions/" GHC.Base.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel session)) GHC.Base.++ "/cancel"))) GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData)
-- | Defines the object schema located at @paths.\/v1\/identity\/verification_sessions\/{session}\/cancel.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification.
data PostIdentityVerificationSessionsSessionCancelRequestBody = PostIdentityVerificationSessionsSessionCancelRequestBody
{ -- | expand: Specifies which fields in the response should be expanded.
postIdentityVerificationSessionsSessionCancelRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text]))
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostIdentityVerificationSessionsSessionCancelRequestBody where
toJSON obj = Data.Aeson.Types.Internal.object ("expand" Data.Aeson.Types.ToJSON..= postIdentityVerificationSessionsSessionCancelRequestBodyExpand obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("expand" Data.Aeson.Types.ToJSON..= postIdentityVerificationSessionsSessionCancelRequestBodyExpand obj)
instance Data.Aeson.Types.FromJSON.FromJSON PostIdentityVerificationSessionsSessionCancelRequestBody where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostIdentityVerificationSessionsSessionCancelRequestBody" (\obj -> GHC.Base.pure PostIdentityVerificationSessionsSessionCancelRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand"))
-- | Create a new 'PostIdentityVerificationSessionsSessionCancelRequestBody' with all required fields.
mkPostIdentityVerificationSessionsSessionCancelRequestBody :: PostIdentityVerificationSessionsSessionCancelRequestBody
mkPostIdentityVerificationSessionsSessionCancelRequestBody = PostIdentityVerificationSessionsSessionCancelRequestBody {postIdentityVerificationSessionsSessionCancelRequestBodyExpand = GHC.Maybe.Nothing}
-- | Represents a response of the operation 'postIdentityVerificationSessionsSessionCancel'.
--
-- 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), 'PostIdentityVerificationSessionsSessionCancelResponseError' is used.
data PostIdentityVerificationSessionsSessionCancelResponse
= -- | Means either no matching case available or a parse error
PostIdentityVerificationSessionsSessionCancelResponseError GHC.Base.String
| -- | Successful response.
PostIdentityVerificationSessionsSessionCancelResponse200 Identity'verificationSession
| -- | Error response.
PostIdentityVerificationSessionsSessionCancelResponseDefault Error
deriving (GHC.Show.Show, GHC.Classes.Eq)