{-# 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 Identity_VerificationReport module StripeAPI.Types.Identity_VerificationReport 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.GelatoDocumentReport import {-# SOURCE #-} StripeAPI.Types.GelatoIdNumberReport import {-# SOURCE #-} StripeAPI.Types.GelatoSelfieReport import {-# SOURCE #-} StripeAPI.Types.GelatoVerificationReportOptions import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.identity.verification_report@ in the specification. -- -- A VerificationReport is the result of an attempt to collect and verify data from a user. -- The collection of verification checks performed is determined from the \`type\` and \`options\` -- parameters used. You can find the result of each verification check performed in the -- appropriate sub-resource: \`document\`, \`id_number\`, \`selfie\`. -- -- Each VerificationReport contains a copy of any data collected by the user as well as -- reference IDs which can be used to access collected images through the [FileUpload](https:\/\/stripe.com\/docs\/api\/files) -- API. To configure and create VerificationReports, use the -- [VerificationSession](https:\/\/stripe.com\/docs\/api\/identity\/verification_sessions) API. -- -- Related guides: [Accessing verification results](https:\/\/stripe.com\/docs\/identity\/verification-sessions\#results). data Identity'verificationReport = Identity'verificationReport { -- | created: Time at which the object was created. Measured in seconds since the Unix epoch. identity'verificationReportCreated :: GHC.Types.Int, -- | document: Result from a document check identity'verificationReportDocument :: (GHC.Maybe.Maybe GelatoDocumentReport), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 identity'verificationReportId :: Data.Text.Internal.Text, -- | id_number: Result from an id_number check identity'verificationReportIdNumber :: (GHC.Maybe.Maybe GelatoIdNumberReport), -- | livemode: Has the value \`true\` if the object exists in live mode or the value \`false\` if the object exists in test mode. identity'verificationReportLivemode :: GHC.Types.Bool, -- | options: identity'verificationReportOptions :: GelatoVerificationReportOptions, -- | selfie: Result from a selfie check identity'verificationReportSelfie :: (GHC.Maybe.Maybe GelatoSelfieReport), -- | type: Type of report. identity'verificationReportType :: Identity'verificationReportType', -- | verification_session: ID of the VerificationSession that created this report. -- -- Constraints: -- -- * Maximum length of 5000 identity'verificationReportVerificationSession :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON Identity'verificationReport where toJSON obj = Data.Aeson.Types.Internal.object ("created" Data.Aeson.Types.ToJSON..= identity'verificationReportCreated obj : "document" Data.Aeson.Types.ToJSON..= identity'verificationReportDocument obj : "id" Data.Aeson.Types.ToJSON..= identity'verificationReportId obj : "id_number" Data.Aeson.Types.ToJSON..= identity'verificationReportIdNumber obj : "livemode" Data.Aeson.Types.ToJSON..= identity'verificationReportLivemode obj : "options" Data.Aeson.Types.ToJSON..= identity'verificationReportOptions obj : "selfie" Data.Aeson.Types.ToJSON..= identity'verificationReportSelfie obj : "type" Data.Aeson.Types.ToJSON..= identity'verificationReportType obj : "verification_session" Data.Aeson.Types.ToJSON..= identity'verificationReportVerificationSession obj : "object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "identity.verification_report" : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("created" Data.Aeson.Types.ToJSON..= identity'verificationReportCreated obj) GHC.Base.<> (("document" Data.Aeson.Types.ToJSON..= identity'verificationReportDocument obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= identity'verificationReportId obj) GHC.Base.<> (("id_number" Data.Aeson.Types.ToJSON..= identity'verificationReportIdNumber obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= identity'verificationReportLivemode obj) GHC.Base.<> (("options" Data.Aeson.Types.ToJSON..= identity'verificationReportOptions obj) GHC.Base.<> (("selfie" Data.Aeson.Types.ToJSON..= identity'verificationReportSelfie obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= identity'verificationReportType obj) GHC.Base.<> (("verification_session" Data.Aeson.Types.ToJSON..= identity'verificationReportVerificationSession obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "identity.verification_report")))))))))) instance Data.Aeson.Types.FromJSON.FromJSON Identity'verificationReport where parseJSON = Data.Aeson.Types.FromJSON.withObject "Identity'verificationReport" (\obj -> ((((((((GHC.Base.pure Identity'verificationReport GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "created")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "document")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "id_number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "livemode")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "options")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "selfie")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "verification_session")) -- | Create a new 'Identity'verificationReport' with all required fields. mkIdentity'verificationReport :: -- | 'identity'verificationReportCreated' GHC.Types.Int -> -- | 'identity'verificationReportId' Data.Text.Internal.Text -> -- | 'identity'verificationReportLivemode' GHC.Types.Bool -> -- | 'identity'verificationReportOptions' GelatoVerificationReportOptions -> -- | 'identity'verificationReportType' Identity'verificationReportType' -> Identity'verificationReport mkIdentity'verificationReport identity'verificationReportCreated identity'verificationReportId identity'verificationReportLivemode identity'verificationReportOptions identity'verificationReportType = Identity'verificationReport { identity'verificationReportCreated = identity'verificationReportCreated, identity'verificationReportDocument = GHC.Maybe.Nothing, identity'verificationReportId = identity'verificationReportId, identity'verificationReportIdNumber = GHC.Maybe.Nothing, identity'verificationReportLivemode = identity'verificationReportLivemode, identity'verificationReportOptions = identity'verificationReportOptions, identity'verificationReportSelfie = GHC.Maybe.Nothing, identity'verificationReportType = identity'verificationReportType, identity'verificationReportVerificationSession = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.identity.verification_report.properties.type@ in the specification. -- -- Type of report. data Identity'verificationReportType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. Identity'verificationReportType'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. Identity'verificationReportType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"document"@ Identity'verificationReportType'EnumDocument | -- | Represents the JSON value @"id_number"@ Identity'verificationReportType'EnumIdNumber deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON Identity'verificationReportType' where toJSON (Identity'verificationReportType'Other val) = val toJSON (Identity'verificationReportType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (Identity'verificationReportType'EnumDocument) = "document" toJSON (Identity'verificationReportType'EnumIdNumber) = "id_number" instance Data.Aeson.Types.FromJSON.FromJSON Identity'verificationReportType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "document" -> Identity'verificationReportType'EnumDocument | val GHC.Classes.== "id_number" -> Identity'verificationReportType'EnumIdNumber | GHC.Base.otherwise -> Identity'verificationReportType'Other val )