{-# 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 GelatoIdNumberReportError module StripeAPI.Types.GelatoIdNumberReportError 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.Foldable import qualified Data.Functor import qualified Data.Maybe 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_id_number_report_error@ in the specification. data GelatoIdNumberReportError = GelatoIdNumberReportError { -- | code: A short machine-readable string giving the reason for the verification failure. gelatoIdNumberReportErrorCode :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GelatoIdNumberReportErrorCode'NonNullable)), -- | reason: A human-readable message giving the reason for the failure. These messages can be shown to your users. -- -- Constraints: -- -- * Maximum length of 5000 gelatoIdNumberReportErrorReason :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON GelatoIdNumberReportError where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("code" Data.Aeson.Types.ToJSON..=)) (gelatoIdNumberReportErrorCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("reason" Data.Aeson.Types.ToJSON..=)) (gelatoIdNumberReportErrorReason obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("code" Data.Aeson.Types.ToJSON..=)) (gelatoIdNumberReportErrorCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("reason" Data.Aeson.Types.ToJSON..=)) (gelatoIdNumberReportErrorReason obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON GelatoIdNumberReportError where parseJSON = Data.Aeson.Types.FromJSON.withObject "GelatoIdNumberReportError" (\obj -> (GHC.Base.pure GelatoIdNumberReportError GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "reason")) -- | Create a new 'GelatoIdNumberReportError' with all required fields. mkGelatoIdNumberReportError :: GelatoIdNumberReportError mkGelatoIdNumberReportError = GelatoIdNumberReportError { gelatoIdNumberReportErrorCode = GHC.Maybe.Nothing, gelatoIdNumberReportErrorReason = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.gelato_id_number_report_error.properties.code@ in the specification. -- -- A short machine-readable string giving the reason for the verification failure. data GelatoIdNumberReportErrorCode'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. GelatoIdNumberReportErrorCode'NonNullableOther Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. GelatoIdNumberReportErrorCode'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"id_number_insufficient_document_data"@ GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberInsufficientDocumentData | -- | Represents the JSON value @"id_number_mismatch"@ GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberMismatch | -- | Represents the JSON value @"id_number_unverified_other"@ GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberUnverifiedOther deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON GelatoIdNumberReportErrorCode'NonNullable where toJSON (GelatoIdNumberReportErrorCode'NonNullableOther val) = val toJSON (GelatoIdNumberReportErrorCode'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberInsufficientDocumentData) = "id_number_insufficient_document_data" toJSON (GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberMismatch) = "id_number_mismatch" toJSON (GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberUnverifiedOther) = "id_number_unverified_other" instance Data.Aeson.Types.FromJSON.FromJSON GelatoIdNumberReportErrorCode'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "id_number_insufficient_document_data" -> GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberInsufficientDocumentData | val GHC.Classes.== "id_number_mismatch" -> GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberMismatch | val GHC.Classes.== "id_number_unverified_other" -> GelatoIdNumberReportErrorCode'NonNullableEnumIdNumberUnverifiedOther | GHC.Base.otherwise -> GelatoIdNumberReportErrorCode'NonNullableOther val )