{-# 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 SetupAttemptPaymentMethodDetailsCard module StripeAPI.Types.SetupAttemptPaymentMethodDetailsCard 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 {-# SOURCE #-} StripeAPI.Types.ThreeDSecureDetails import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.setup_attempt_payment_method_details_card@ in the specification. data SetupAttemptPaymentMethodDetailsCard = SetupAttemptPaymentMethodDetailsCard { -- | three_d_secure: Populated if this authorization used 3D Secure authentication. setupAttemptPaymentMethodDetailsCardThreeDSecure :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsCardThreeDSecure') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsCard where toJSON obj = Data.Aeson.Types.Internal.object ("three_d_secure" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("three_d_secure" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure obj) instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsCard where parseJSON = Data.Aeson.Types.FromJSON.withObject "SetupAttemptPaymentMethodDetailsCard" (\obj -> GHC.Base.pure SetupAttemptPaymentMethodDetailsCard GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "three_d_secure")) -- | Create a new 'SetupAttemptPaymentMethodDetailsCard' with all required fields. mkSetupAttemptPaymentMethodDetailsCard :: SetupAttemptPaymentMethodDetailsCard mkSetupAttemptPaymentMethodDetailsCard = SetupAttemptPaymentMethodDetailsCard {setupAttemptPaymentMethodDetailsCardThreeDSecure = GHC.Maybe.Nothing} -- | Defines the object schema located at @components.schemas.setup_attempt_payment_method_details_card.properties.three_d_secure.anyOf@ in the specification. -- -- Populated if this authorization used 3D Secure authentication. data SetupAttemptPaymentMethodDetailsCardThreeDSecure' = SetupAttemptPaymentMethodDetailsCardThreeDSecure' { -- | authentication_flow: For authenticated transactions: how the customer was authenticated by -- the issuing bank. setupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'), -- | result: Indicates the outcome of 3D Secure authentication. setupAttemptPaymentMethodDetailsCardThreeDSecure'Result :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'), -- | result_reason: Additional information about why 3D Secure succeeded or failed based -- on the \`result\`. setupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'), -- | version: The version of 3D Secure that was used. setupAttemptPaymentMethodDetailsCardThreeDSecure'Version :: (GHC.Maybe.Maybe SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure' where toJSON obj = Data.Aeson.Types.Internal.object ("authentication_flow" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow obj : "result" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'Result obj : "result_reason" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason obj : "version" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'Version obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("authentication_flow" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow obj) GHC.Base.<> (("result" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'Result obj) GHC.Base.<> (("result_reason" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason obj) GHC.Base.<> ("version" Data.Aeson.Types.ToJSON..= setupAttemptPaymentMethodDetailsCardThreeDSecure'Version obj)))) instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure' where parseJSON = Data.Aeson.Types.FromJSON.withObject "SetupAttemptPaymentMethodDetailsCardThreeDSecure'" (\obj -> (((GHC.Base.pure SetupAttemptPaymentMethodDetailsCardThreeDSecure' 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 'SetupAttemptPaymentMethodDetailsCardThreeDSecure'' with all required fields. mkSetupAttemptPaymentMethodDetailsCardThreeDSecure' :: SetupAttemptPaymentMethodDetailsCardThreeDSecure' mkSetupAttemptPaymentMethodDetailsCardThreeDSecure' = SetupAttemptPaymentMethodDetailsCardThreeDSecure' { setupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsCardThreeDSecure'Result = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason = GHC.Maybe.Nothing, setupAttemptPaymentMethodDetailsCardThreeDSecure'Version = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.setup_attempt_payment_method_details_card.properties.three_d_secure.anyOf.properties.authentication_flow@ in the specification. -- -- For authenticated transactions: how the customer was authenticated by -- the issuing bank. data SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'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. SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"challenge"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'EnumChallenge | -- | Represents the JSON value @"frictionless"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'EnumFrictionless deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow' where toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'Other val) = val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'EnumChallenge) = "challenge" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'EnumFrictionless) = "frictionless" instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "challenge" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'EnumChallenge | val GHC.Classes.== "frictionless" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'EnumFrictionless | GHC.Base.otherwise -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'AuthenticationFlow'Other val ) -- | Defines the enum schema located at @components.schemas.setup_attempt_payment_method_details_card.properties.three_d_secure.anyOf.properties.result@ in the specification. -- -- Indicates the outcome of 3D Secure authentication. data SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'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. SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"attempt_acknowledged"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumAttemptAcknowledged | -- | Represents the JSON value @"authenticated"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumAuthenticated | -- | Represents the JSON value @"failed"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumFailed | -- | Represents the JSON value @"not_supported"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumNotSupported | -- | Represents the JSON value @"processing_error"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumProcessingError deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result' where toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'Other val) = val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumAttemptAcknowledged) = "attempt_acknowledged" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumAuthenticated) = "authenticated" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumFailed) = "failed" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumNotSupported) = "not_supported" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumProcessingError) = "processing_error" instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "attempt_acknowledged" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumAttemptAcknowledged | val GHC.Classes.== "authenticated" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumAuthenticated | val GHC.Classes.== "failed" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumFailed | val GHC.Classes.== "not_supported" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumNotSupported | val GHC.Classes.== "processing_error" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'EnumProcessingError | GHC.Base.otherwise -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Result'Other val ) -- | Defines the enum schema located at @components.schemas.setup_attempt_payment_method_details_card.properties.three_d_secure.anyOf.properties.result_reason@ in the specification. -- -- Additional information about why 3D Secure succeeded or failed based -- on the \`result\`. data SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'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. SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"abandoned"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumAbandoned | -- | Represents the JSON value @"bypassed"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumBypassed | -- | Represents the JSON value @"canceled"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumCanceled | -- | Represents the JSON value @"card_not_enrolled"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumCardNotEnrolled | -- | Represents the JSON value @"network_not_supported"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumNetworkNotSupported | -- | Represents the JSON value @"protocol_error"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumProtocolError | -- | Represents the JSON value @"rejected"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumRejected deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason' where toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'Other val) = val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumAbandoned) = "abandoned" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumBypassed) = "bypassed" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumCanceled) = "canceled" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumCardNotEnrolled) = "card_not_enrolled" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumNetworkNotSupported) = "network_not_supported" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumProtocolError) = "protocol_error" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumRejected) = "rejected" instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "abandoned" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumAbandoned | val GHC.Classes.== "bypassed" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumBypassed | val GHC.Classes.== "canceled" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumCanceled | val GHC.Classes.== "card_not_enrolled" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumCardNotEnrolled | val GHC.Classes.== "network_not_supported" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumNetworkNotSupported | val GHC.Classes.== "protocol_error" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumProtocolError | val GHC.Classes.== "rejected" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'EnumRejected | GHC.Base.otherwise -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'ResultReason'Other val ) -- | Defines the enum schema located at @components.schemas.setup_attempt_payment_method_details_card.properties.three_d_secure.anyOf.properties.version@ in the specification. -- -- The version of 3D Secure that was used. data SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'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. SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"1.0.2"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum1'0'2 | -- | Represents the JSON value @"2.1.0"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum2'1'0 | -- | Represents the JSON value @"2.2.0"@ SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum2'2'0 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version' where toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Other val) = val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum1'0'2) = "1.0.2" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum2'1'0) = "2.1.0" toJSON (SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum2'2'0) = "2.2.0" instance Data.Aeson.Types.FromJSON.FromJSON SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "1.0.2" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum1'0'2 | val GHC.Classes.== "2.1.0" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum2'1'0 | val GHC.Classes.== "2.2.0" -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Enum2'2'0 | GHC.Base.otherwise -> SetupAttemptPaymentMethodDetailsCardThreeDSecure'Version'Other val )