{-# 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 types generated from the schema ThreeDSecureDetails module StripeAPI.Types.ThreeDSecureDetails where import qualified Control.Monad.Fail 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.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 GHC.Base import qualified GHC.Classes import qualified GHC.Int import qualified GHC.Show import qualified GHC.Types import qualified StripeAPI.Common import StripeAPI.TypeAlias import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.three_d_secure_details@ in the specification. data ThreeDSecureDetails = ThreeDSecureDetails { -- | authentication_flow: For authenticated transactions: how the customer was authenticated by -- the issuing bank. threeDSecureDetailsAuthenticationFlow :: (GHC.Maybe.Maybe ThreeDSecureDetailsAuthenticationFlow'), -- | result: Indicates the outcome of 3D Secure authentication. threeDSecureDetailsResult :: ThreeDSecureDetailsResult', -- | result_reason: Additional information about why 3D Secure succeeded or failed based -- on the \`result\`. threeDSecureDetailsResultReason :: (GHC.Maybe.Maybe ThreeDSecureDetailsResultReason'), -- | version: The version of 3D Secure that was used. threeDSecureDetailsVersion :: ThreeDSecureDetailsVersion' } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON ThreeDSecureDetails where toJSON obj = Data.Aeson.Types.Internal.object ("authentication_flow" Data.Aeson.Types.ToJSON..= threeDSecureDetailsAuthenticationFlow obj : "result" Data.Aeson.Types.ToJSON..= threeDSecureDetailsResult obj : "result_reason" Data.Aeson.Types.ToJSON..= threeDSecureDetailsResultReason obj : "version" Data.Aeson.Types.ToJSON..= threeDSecureDetailsVersion obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("authentication_flow" Data.Aeson.Types.ToJSON..= threeDSecureDetailsAuthenticationFlow obj) GHC.Base.<> (("result" Data.Aeson.Types.ToJSON..= threeDSecureDetailsResult obj) GHC.Base.<> (("result_reason" Data.Aeson.Types.ToJSON..= threeDSecureDetailsResultReason obj) GHC.Base.<> ("version" Data.Aeson.Types.ToJSON..= threeDSecureDetailsVersion obj)))) instance Data.Aeson.Types.FromJSON.FromJSON ThreeDSecureDetails where parseJSON = Data.Aeson.Types.FromJSON.withObject "ThreeDSecureDetails" (\obj -> (((GHC.Base.pure ThreeDSecureDetails GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "authentication_flow")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "result")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "result_reason")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "version")) -- | Create a new 'ThreeDSecureDetails' with all required fields. mkThreeDSecureDetails :: -- | 'threeDSecureDetailsResult' ThreeDSecureDetailsResult' -> -- | 'threeDSecureDetailsVersion' ThreeDSecureDetailsVersion' -> ThreeDSecureDetails mkThreeDSecureDetails threeDSecureDetailsResult threeDSecureDetailsVersion = ThreeDSecureDetails { threeDSecureDetailsAuthenticationFlow = GHC.Maybe.Nothing, threeDSecureDetailsResult = threeDSecureDetailsResult, threeDSecureDetailsResultReason = GHC.Maybe.Nothing, threeDSecureDetailsVersion = threeDSecureDetailsVersion } -- | Defines the enum schema located at @components.schemas.three_d_secure_details.properties.authentication_flow@ in the specification. -- -- For authenticated transactions: how the customer was authenticated by -- the issuing bank. data ThreeDSecureDetailsAuthenticationFlow' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. ThreeDSecureDetailsAuthenticationFlow'Other Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. ThreeDSecureDetailsAuthenticationFlow'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"challenge"@ ThreeDSecureDetailsAuthenticationFlow'EnumChallenge | -- | Represents the JSON value @"frictionless"@ ThreeDSecureDetailsAuthenticationFlow'EnumFrictionless deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ThreeDSecureDetailsAuthenticationFlow' where toJSON (ThreeDSecureDetailsAuthenticationFlow'Other val) = val toJSON (ThreeDSecureDetailsAuthenticationFlow'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (ThreeDSecureDetailsAuthenticationFlow'EnumChallenge) = "challenge" toJSON (ThreeDSecureDetailsAuthenticationFlow'EnumFrictionless) = "frictionless" instance Data.Aeson.Types.FromJSON.FromJSON ThreeDSecureDetailsAuthenticationFlow' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "challenge" -> ThreeDSecureDetailsAuthenticationFlow'EnumChallenge | val GHC.Classes.== "frictionless" -> ThreeDSecureDetailsAuthenticationFlow'EnumFrictionless | GHC.Base.otherwise -> ThreeDSecureDetailsAuthenticationFlow'Other val ) -- | Defines the enum schema located at @components.schemas.three_d_secure_details.properties.result@ in the specification. -- -- Indicates the outcome of 3D Secure authentication. data ThreeDSecureDetailsResult' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. ThreeDSecureDetailsResult'Other Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. ThreeDSecureDetailsResult'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"attempt_acknowledged"@ ThreeDSecureDetailsResult'EnumAttemptAcknowledged | -- | Represents the JSON value @"authenticated"@ ThreeDSecureDetailsResult'EnumAuthenticated | -- | Represents the JSON value @"failed"@ ThreeDSecureDetailsResult'EnumFailed | -- | Represents the JSON value @"not_supported"@ ThreeDSecureDetailsResult'EnumNotSupported | -- | Represents the JSON value @"processing_error"@ ThreeDSecureDetailsResult'EnumProcessingError deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ThreeDSecureDetailsResult' where toJSON (ThreeDSecureDetailsResult'Other val) = val toJSON (ThreeDSecureDetailsResult'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (ThreeDSecureDetailsResult'EnumAttemptAcknowledged) = "attempt_acknowledged" toJSON (ThreeDSecureDetailsResult'EnumAuthenticated) = "authenticated" toJSON (ThreeDSecureDetailsResult'EnumFailed) = "failed" toJSON (ThreeDSecureDetailsResult'EnumNotSupported) = "not_supported" toJSON (ThreeDSecureDetailsResult'EnumProcessingError) = "processing_error" instance Data.Aeson.Types.FromJSON.FromJSON ThreeDSecureDetailsResult' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "attempt_acknowledged" -> ThreeDSecureDetailsResult'EnumAttemptAcknowledged | val GHC.Classes.== "authenticated" -> ThreeDSecureDetailsResult'EnumAuthenticated | val GHC.Classes.== "failed" -> ThreeDSecureDetailsResult'EnumFailed | val GHC.Classes.== "not_supported" -> ThreeDSecureDetailsResult'EnumNotSupported | val GHC.Classes.== "processing_error" -> ThreeDSecureDetailsResult'EnumProcessingError | GHC.Base.otherwise -> ThreeDSecureDetailsResult'Other val ) -- | Defines the enum schema located at @components.schemas.three_d_secure_details.properties.result_reason@ in the specification. -- -- Additional information about why 3D Secure succeeded or failed based -- on the \`result\`. data ThreeDSecureDetailsResultReason' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. ThreeDSecureDetailsResultReason'Other Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. ThreeDSecureDetailsResultReason'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"abandoned"@ ThreeDSecureDetailsResultReason'EnumAbandoned | -- | Represents the JSON value @"bypassed"@ ThreeDSecureDetailsResultReason'EnumBypassed | -- | Represents the JSON value @"canceled"@ ThreeDSecureDetailsResultReason'EnumCanceled | -- | Represents the JSON value @"card_not_enrolled"@ ThreeDSecureDetailsResultReason'EnumCardNotEnrolled | -- | Represents the JSON value @"network_not_supported"@ ThreeDSecureDetailsResultReason'EnumNetworkNotSupported | -- | Represents the JSON value @"protocol_error"@ ThreeDSecureDetailsResultReason'EnumProtocolError | -- | Represents the JSON value @"rejected"@ ThreeDSecureDetailsResultReason'EnumRejected deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ThreeDSecureDetailsResultReason' where toJSON (ThreeDSecureDetailsResultReason'Other val) = val toJSON (ThreeDSecureDetailsResultReason'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (ThreeDSecureDetailsResultReason'EnumAbandoned) = "abandoned" toJSON (ThreeDSecureDetailsResultReason'EnumBypassed) = "bypassed" toJSON (ThreeDSecureDetailsResultReason'EnumCanceled) = "canceled" toJSON (ThreeDSecureDetailsResultReason'EnumCardNotEnrolled) = "card_not_enrolled" toJSON (ThreeDSecureDetailsResultReason'EnumNetworkNotSupported) = "network_not_supported" toJSON (ThreeDSecureDetailsResultReason'EnumProtocolError) = "protocol_error" toJSON (ThreeDSecureDetailsResultReason'EnumRejected) = "rejected" instance Data.Aeson.Types.FromJSON.FromJSON ThreeDSecureDetailsResultReason' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "abandoned" -> ThreeDSecureDetailsResultReason'EnumAbandoned | val GHC.Classes.== "bypassed" -> ThreeDSecureDetailsResultReason'EnumBypassed | val GHC.Classes.== "canceled" -> ThreeDSecureDetailsResultReason'EnumCanceled | val GHC.Classes.== "card_not_enrolled" -> ThreeDSecureDetailsResultReason'EnumCardNotEnrolled | val GHC.Classes.== "network_not_supported" -> ThreeDSecureDetailsResultReason'EnumNetworkNotSupported | val GHC.Classes.== "protocol_error" -> ThreeDSecureDetailsResultReason'EnumProtocolError | val GHC.Classes.== "rejected" -> ThreeDSecureDetailsResultReason'EnumRejected | GHC.Base.otherwise -> ThreeDSecureDetailsResultReason'Other val ) -- | Defines the enum schema located at @components.schemas.three_d_secure_details.properties.version@ in the specification. -- -- The version of 3D Secure that was used. data ThreeDSecureDetailsVersion' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. ThreeDSecureDetailsVersion'Other Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. ThreeDSecureDetailsVersion'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"1.0.2"@ ThreeDSecureDetailsVersion'Enum1'0'2 | -- | Represents the JSON value @"2.1.0"@ ThreeDSecureDetailsVersion'Enum2'1'0 | -- | Represents the JSON value @"2.2.0"@ ThreeDSecureDetailsVersion'Enum2'2'0 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON ThreeDSecureDetailsVersion' where toJSON (ThreeDSecureDetailsVersion'Other val) = val toJSON (ThreeDSecureDetailsVersion'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (ThreeDSecureDetailsVersion'Enum1'0'2) = "1.0.2" toJSON (ThreeDSecureDetailsVersion'Enum2'1'0) = "2.1.0" toJSON (ThreeDSecureDetailsVersion'Enum2'2'0) = "2.2.0" instance Data.Aeson.Types.FromJSON.FromJSON ThreeDSecureDetailsVersion' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "1.0.2" -> ThreeDSecureDetailsVersion'Enum1'0'2 | val GHC.Classes.== "2.1.0" -> ThreeDSecureDetailsVersion'Enum2'1'0 | val GHC.Classes.== "2.2.0" -> ThreeDSecureDetailsVersion'Enum2'2'0 | GHC.Base.otherwise -> ThreeDSecureDetailsVersion'Other val )