{-# 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 GelatoSessionLastError module StripeAPI.Types.GelatoSessionLastError 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.gelato_session_last_error@ in the specification. -- -- Shows last VerificationSession error data GelatoSessionLastError = GelatoSessionLastError { -- | code: A short machine-readable string giving the reason for the verification or user-session failure. gelatoSessionLastErrorCode :: (GHC.Maybe.Maybe GelatoSessionLastErrorCode'), -- | reason: A message that explains the reason for verification or user-session failure. -- -- Constraints: -- -- * Maximum length of 5000 gelatoSessionLastErrorReason :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON GelatoSessionLastError where toJSON obj = Data.Aeson.Types.Internal.object ("code" Data.Aeson.Types.ToJSON..= gelatoSessionLastErrorCode obj : "reason" Data.Aeson.Types.ToJSON..= gelatoSessionLastErrorReason obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("code" Data.Aeson.Types.ToJSON..= gelatoSessionLastErrorCode obj) GHC.Base.<> ("reason" Data.Aeson.Types.ToJSON..= gelatoSessionLastErrorReason obj)) instance Data.Aeson.Types.FromJSON.FromJSON GelatoSessionLastError where parseJSON = Data.Aeson.Types.FromJSON.withObject "GelatoSessionLastError" (\obj -> (GHC.Base.pure GelatoSessionLastError GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "reason")) -- | Create a new 'GelatoSessionLastError' with all required fields. mkGelatoSessionLastError :: GelatoSessionLastError mkGelatoSessionLastError = GelatoSessionLastError { gelatoSessionLastErrorCode = GHC.Maybe.Nothing, gelatoSessionLastErrorReason = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.gelato_session_last_error.properties.code@ in the specification. -- -- A short machine-readable string giving the reason for the verification or user-session failure. data GelatoSessionLastErrorCode' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. GelatoSessionLastErrorCode'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. GelatoSessionLastErrorCode'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"abandoned"@ GelatoSessionLastErrorCode'EnumAbandoned | -- | Represents the JSON value @"consent_declined"@ GelatoSessionLastErrorCode'EnumConsentDeclined | -- | Represents the JSON value @"country_not_supported"@ GelatoSessionLastErrorCode'EnumCountryNotSupported | -- | Represents the JSON value @"device_not_supported"@ GelatoSessionLastErrorCode'EnumDeviceNotSupported | -- | Represents the JSON value @"document_expired"@ GelatoSessionLastErrorCode'EnumDocumentExpired | -- | Represents the JSON value @"document_type_not_supported"@ GelatoSessionLastErrorCode'EnumDocumentTypeNotSupported | -- | Represents the JSON value @"document_unverified_other"@ GelatoSessionLastErrorCode'EnumDocumentUnverifiedOther | -- | Represents the JSON value @"id_number_insufficient_document_data"@ GelatoSessionLastErrorCode'EnumIdNumberInsufficientDocumentData | -- | Represents the JSON value @"id_number_mismatch"@ GelatoSessionLastErrorCode'EnumIdNumberMismatch | -- | Represents the JSON value @"id_number_unverified_other"@ GelatoSessionLastErrorCode'EnumIdNumberUnverifiedOther | -- | Represents the JSON value @"selfie_document_missing_photo"@ GelatoSessionLastErrorCode'EnumSelfieDocumentMissingPhoto | -- | Represents the JSON value @"selfie_face_mismatch"@ GelatoSessionLastErrorCode'EnumSelfieFaceMismatch | -- | Represents the JSON value @"selfie_manipulated"@ GelatoSessionLastErrorCode'EnumSelfieManipulated | -- | Represents the JSON value @"selfie_unverified_other"@ GelatoSessionLastErrorCode'EnumSelfieUnverifiedOther | -- | Represents the JSON value @"under_supported_age"@ GelatoSessionLastErrorCode'EnumUnderSupportedAge deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON GelatoSessionLastErrorCode' where toJSON (GelatoSessionLastErrorCode'Other val) = val toJSON (GelatoSessionLastErrorCode'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (GelatoSessionLastErrorCode'EnumAbandoned) = "abandoned" toJSON (GelatoSessionLastErrorCode'EnumConsentDeclined) = "consent_declined" toJSON (GelatoSessionLastErrorCode'EnumCountryNotSupported) = "country_not_supported" toJSON (GelatoSessionLastErrorCode'EnumDeviceNotSupported) = "device_not_supported" toJSON (GelatoSessionLastErrorCode'EnumDocumentExpired) = "document_expired" toJSON (GelatoSessionLastErrorCode'EnumDocumentTypeNotSupported) = "document_type_not_supported" toJSON (GelatoSessionLastErrorCode'EnumDocumentUnverifiedOther) = "document_unverified_other" toJSON (GelatoSessionLastErrorCode'EnumIdNumberInsufficientDocumentData) = "id_number_insufficient_document_data" toJSON (GelatoSessionLastErrorCode'EnumIdNumberMismatch) = "id_number_mismatch" toJSON (GelatoSessionLastErrorCode'EnumIdNumberUnverifiedOther) = "id_number_unverified_other" toJSON (GelatoSessionLastErrorCode'EnumSelfieDocumentMissingPhoto) = "selfie_document_missing_photo" toJSON (GelatoSessionLastErrorCode'EnumSelfieFaceMismatch) = "selfie_face_mismatch" toJSON (GelatoSessionLastErrorCode'EnumSelfieManipulated) = "selfie_manipulated" toJSON (GelatoSessionLastErrorCode'EnumSelfieUnverifiedOther) = "selfie_unverified_other" toJSON (GelatoSessionLastErrorCode'EnumUnderSupportedAge) = "under_supported_age" instance Data.Aeson.Types.FromJSON.FromJSON GelatoSessionLastErrorCode' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "abandoned" -> GelatoSessionLastErrorCode'EnumAbandoned | val GHC.Classes.== "consent_declined" -> GelatoSessionLastErrorCode'EnumConsentDeclined | val GHC.Classes.== "country_not_supported" -> GelatoSessionLastErrorCode'EnumCountryNotSupported | val GHC.Classes.== "device_not_supported" -> GelatoSessionLastErrorCode'EnumDeviceNotSupported | val GHC.Classes.== "document_expired" -> GelatoSessionLastErrorCode'EnumDocumentExpired | val GHC.Classes.== "document_type_not_supported" -> GelatoSessionLastErrorCode'EnumDocumentTypeNotSupported | val GHC.Classes.== "document_unverified_other" -> GelatoSessionLastErrorCode'EnumDocumentUnverifiedOther | val GHC.Classes.== "id_number_insufficient_document_data" -> GelatoSessionLastErrorCode'EnumIdNumberInsufficientDocumentData | val GHC.Classes.== "id_number_mismatch" -> GelatoSessionLastErrorCode'EnumIdNumberMismatch | val GHC.Classes.== "id_number_unverified_other" -> GelatoSessionLastErrorCode'EnumIdNumberUnverifiedOther | val GHC.Classes.== "selfie_document_missing_photo" -> GelatoSessionLastErrorCode'EnumSelfieDocumentMissingPhoto | val GHC.Classes.== "selfie_face_mismatch" -> GelatoSessionLastErrorCode'EnumSelfieFaceMismatch | val GHC.Classes.== "selfie_manipulated" -> GelatoSessionLastErrorCode'EnumSelfieManipulated | val GHC.Classes.== "selfie_unverified_other" -> GelatoSessionLastErrorCode'EnumSelfieUnverifiedOther | val GHC.Classes.== "under_supported_age" -> GelatoSessionLastErrorCode'EnumUnderSupportedAge | GHC.Base.otherwise -> GelatoSessionLastErrorCode'Other val )