{-# 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'verificationReport -> Int
identity'verificationReportCreated :: GHC.Types.Int,
    -- | document: Result from a document check
    Identity'verificationReport -> Maybe GelatoDocumentReport
identity'verificationReportDocument :: (GHC.Maybe.Maybe GelatoDocumentReport),
    -- | id: Unique identifier for the object.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Identity'verificationReport -> Text
identity'verificationReportId :: Data.Text.Internal.Text,
    -- | id_number: Result from an id_number check
    Identity'verificationReport -> Maybe GelatoIdNumberReport
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'verificationReport -> Bool
identity'verificationReportLivemode :: GHC.Types.Bool,
    -- | options:
    Identity'verificationReport -> GelatoVerificationReportOptions
identity'verificationReportOptions :: GelatoVerificationReportOptions,
    -- | selfie: Result from a selfie check
    Identity'verificationReport -> Maybe GelatoSelfieReport
identity'verificationReportSelfie :: (GHC.Maybe.Maybe GelatoSelfieReport),
    -- | type: Type of report.
    Identity'verificationReport -> Identity'verificationReportType'
identity'verificationReportType :: Identity'verificationReportType',
    -- | verification_session: ID of the VerificationSession that created this report.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Identity'verificationReport -> Maybe Text
identity'verificationReportVerificationSession :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> Identity'verificationReport -> ShowS
[Identity'verificationReport] -> ShowS
Identity'verificationReport -> String
(Int -> Identity'verificationReport -> ShowS)
-> (Identity'verificationReport -> String)
-> ([Identity'verificationReport] -> ShowS)
-> Show Identity'verificationReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Identity'verificationReport] -> ShowS
$cshowList :: [Identity'verificationReport] -> ShowS
show :: Identity'verificationReport -> String
$cshow :: Identity'verificationReport -> String
showsPrec :: Int -> Identity'verificationReport -> ShowS
$cshowsPrec :: Int -> Identity'verificationReport -> ShowS
GHC.Show.Show,
      Identity'verificationReport -> Identity'verificationReport -> Bool
(Identity'verificationReport
 -> Identity'verificationReport -> Bool)
-> (Identity'verificationReport
    -> Identity'verificationReport -> Bool)
-> Eq Identity'verificationReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Identity'verificationReport -> Identity'verificationReport -> Bool
$c/= :: Identity'verificationReport -> Identity'verificationReport -> Bool
== :: Identity'verificationReport -> Identity'verificationReport -> Bool
$c== :: Identity'verificationReport -> Identity'verificationReport -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON Identity'verificationReport where
  toJSON :: Identity'verificationReport -> Value
toJSON Identity'verificationReport
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"created" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Int
identity'verificationReportCreated Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"document" Text -> Maybe GelatoDocumentReport -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe GelatoDocumentReport
identity'verificationReportDocument Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Text
identity'verificationReportId Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id_number" Text -> Maybe GelatoIdNumberReport -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe GelatoIdNumberReport
identity'verificationReportIdNumber Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"livemode" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Bool
identity'verificationReportLivemode Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"options" Text -> GelatoVerificationReportOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> GelatoVerificationReportOptions
identity'verificationReportOptions Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"selfie" Text -> Maybe GelatoSelfieReport -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe GelatoSelfieReport
identity'verificationReportSelfie Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"type" Text -> Identity'verificationReportType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Identity'verificationReportType'
identity'verificationReportType Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"verification_session" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe Text
identity'verificationReportVerificationSession Identity'verificationReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"identity.verification_report" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: Identity'verificationReport -> Encoding
toEncoding Identity'verificationReport
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"created" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Int
identity'verificationReportCreated Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"document" Text -> Maybe GelatoDocumentReport -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe GelatoDocumentReport
identity'verificationReportDocument Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Text
identity'verificationReportId Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id_number" Text -> Maybe GelatoIdNumberReport -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe GelatoIdNumberReport
identity'verificationReportIdNumber Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"livemode" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Bool
identity'verificationReportLivemode Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"options" Text -> GelatoVerificationReportOptions -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> GelatoVerificationReportOptions
identity'verificationReportOptions Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"selfie" Text -> Maybe GelatoSelfieReport -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe GelatoSelfieReport
identity'verificationReportSelfie Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"type" Text -> Identity'verificationReportType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Identity'verificationReportType'
identity'verificationReportType Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"verification_session" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Identity'verificationReport -> Maybe Text
identity'verificationReportVerificationSession Identity'verificationReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"identity.verification_report"))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON Identity'verificationReport where
  parseJSON :: Value -> Parser Identity'verificationReport
parseJSON = String
-> (Object -> Parser Identity'verificationReport)
-> Value
-> Parser Identity'verificationReport
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Identity'verificationReport" (\Object
obj -> (((((((((Int
 -> Maybe GelatoDocumentReport
 -> Text
 -> Maybe GelatoIdNumberReport
 -> Bool
 -> GelatoVerificationReportOptions
 -> Maybe GelatoSelfieReport
 -> Identity'verificationReportType'
 -> Maybe Text
 -> Identity'verificationReport)
-> Parser
     (Int
      -> Maybe GelatoDocumentReport
      -> Text
      -> Maybe GelatoIdNumberReport
      -> Bool
      -> GelatoVerificationReportOptions
      -> Maybe GelatoSelfieReport
      -> Identity'verificationReportType'
      -> Maybe Text
      -> Identity'verificationReport)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int
-> Maybe GelatoDocumentReport
-> Text
-> Maybe GelatoIdNumberReport
-> Bool
-> GelatoVerificationReportOptions
-> Maybe GelatoSelfieReport
-> Identity'verificationReportType'
-> Maybe Text
-> Identity'verificationReport
Identity'verificationReport Parser
  (Int
   -> Maybe GelatoDocumentReport
   -> Text
   -> Maybe GelatoIdNumberReport
   -> Bool
   -> GelatoVerificationReportOptions
   -> Maybe GelatoSelfieReport
   -> Identity'verificationReportType'
   -> Maybe Text
   -> Identity'verificationReport)
-> Parser Int
-> Parser
     (Maybe GelatoDocumentReport
      -> Text
      -> Maybe GelatoIdNumberReport
      -> Bool
      -> GelatoVerificationReportOptions
      -> Maybe GelatoSelfieReport
      -> Identity'verificationReportType'
      -> Maybe Text
      -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"created")) Parser
  (Maybe GelatoDocumentReport
   -> Text
   -> Maybe GelatoIdNumberReport
   -> Bool
   -> GelatoVerificationReportOptions
   -> Maybe GelatoSelfieReport
   -> Identity'verificationReportType'
   -> Maybe Text
   -> Identity'verificationReport)
-> Parser (Maybe GelatoDocumentReport)
-> Parser
     (Text
      -> Maybe GelatoIdNumberReport
      -> Bool
      -> GelatoVerificationReportOptions
      -> Maybe GelatoSelfieReport
      -> Identity'verificationReportType'
      -> Maybe Text
      -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoDocumentReport)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"document")) Parser
  (Text
   -> Maybe GelatoIdNumberReport
   -> Bool
   -> GelatoVerificationReportOptions
   -> Maybe GelatoSelfieReport
   -> Identity'verificationReportType'
   -> Maybe Text
   -> Identity'verificationReport)
-> Parser Text
-> Parser
     (Maybe GelatoIdNumberReport
      -> Bool
      -> GelatoVerificationReportOptions
      -> Maybe GelatoSelfieReport
      -> Identity'verificationReportType'
      -> Maybe Text
      -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"id")) Parser
  (Maybe GelatoIdNumberReport
   -> Bool
   -> GelatoVerificationReportOptions
   -> Maybe GelatoSelfieReport
   -> Identity'verificationReportType'
   -> Maybe Text
   -> Identity'verificationReport)
-> Parser (Maybe GelatoIdNumberReport)
-> Parser
     (Bool
      -> GelatoVerificationReportOptions
      -> Maybe GelatoSelfieReport
      -> Identity'verificationReportType'
      -> Maybe Text
      -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoIdNumberReport)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"id_number")) Parser
  (Bool
   -> GelatoVerificationReportOptions
   -> Maybe GelatoSelfieReport
   -> Identity'verificationReportType'
   -> Maybe Text
   -> Identity'verificationReport)
-> Parser Bool
-> Parser
     (GelatoVerificationReportOptions
      -> Maybe GelatoSelfieReport
      -> Identity'verificationReportType'
      -> Maybe Text
      -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"livemode")) Parser
  (GelatoVerificationReportOptions
   -> Maybe GelatoSelfieReport
   -> Identity'verificationReportType'
   -> Maybe Text
   -> Identity'verificationReport)
-> Parser GelatoVerificationReportOptions
-> Parser
     (Maybe GelatoSelfieReport
      -> Identity'verificationReportType'
      -> Maybe Text
      -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser GelatoVerificationReportOptions
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"options")) Parser
  (Maybe GelatoSelfieReport
   -> Identity'verificationReportType'
   -> Maybe Text
   -> Identity'verificationReport)
-> Parser (Maybe GelatoSelfieReport)
-> Parser
     (Identity'verificationReportType'
      -> Maybe Text -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoSelfieReport)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"selfie")) Parser
  (Identity'verificationReportType'
   -> Maybe Text -> Identity'verificationReport)
-> Parser Identity'verificationReportType'
-> Parser (Maybe Text -> Identity'verificationReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Identity'verificationReportType'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"type")) Parser (Maybe Text -> Identity'verificationReport)
-> Parser (Maybe Text) -> Parser Identity'verificationReport
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"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 :: Int
-> Text
-> Bool
-> GelatoVerificationReportOptions
-> Identity'verificationReportType'
-> Identity'verificationReport
mkIdentity'verificationReport Int
identity'verificationReportCreated Text
identity'verificationReportId Bool
identity'verificationReportLivemode GelatoVerificationReportOptions
identity'verificationReportOptions Identity'verificationReportType'
identity'verificationReportType =
  Identity'verificationReport :: Int
-> Maybe GelatoDocumentReport
-> Text
-> Maybe GelatoIdNumberReport
-> Bool
-> GelatoVerificationReportOptions
-> Maybe GelatoSelfieReport
-> Identity'verificationReportType'
-> Maybe Text
-> Identity'verificationReport
Identity'verificationReport
    { identity'verificationReportCreated :: Int
identity'verificationReportCreated = Int
identity'verificationReportCreated,
      identity'verificationReportDocument :: Maybe GelatoDocumentReport
identity'verificationReportDocument = Maybe GelatoDocumentReport
forall a. Maybe a
GHC.Maybe.Nothing,
      identity'verificationReportId :: Text
identity'verificationReportId = Text
identity'verificationReportId,
      identity'verificationReportIdNumber :: Maybe GelatoIdNumberReport
identity'verificationReportIdNumber = Maybe GelatoIdNumberReport
forall a. Maybe a
GHC.Maybe.Nothing,
      identity'verificationReportLivemode :: Bool
identity'verificationReportLivemode = Bool
identity'verificationReportLivemode,
      identity'verificationReportOptions :: GelatoVerificationReportOptions
identity'verificationReportOptions = GelatoVerificationReportOptions
identity'verificationReportOptions,
      identity'verificationReportSelfie :: Maybe GelatoSelfieReport
identity'verificationReportSelfie = Maybe GelatoSelfieReport
forall a. Maybe a
GHC.Maybe.Nothing,
      identity'verificationReportType :: Identity'verificationReportType'
identity'verificationReportType = Identity'verificationReportType'
identity'verificationReportType,
      identity'verificationReportVerificationSession :: Maybe Text
identity'verificationReportVerificationSession = Maybe Text
forall a. Maybe a
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 (Int -> Identity'verificationReportType' -> ShowS
[Identity'verificationReportType'] -> ShowS
Identity'verificationReportType' -> String
(Int -> Identity'verificationReportType' -> ShowS)
-> (Identity'verificationReportType' -> String)
-> ([Identity'verificationReportType'] -> ShowS)
-> Show Identity'verificationReportType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Identity'verificationReportType'] -> ShowS
$cshowList :: [Identity'verificationReportType'] -> ShowS
show :: Identity'verificationReportType' -> String
$cshow :: Identity'verificationReportType' -> String
showsPrec :: Int -> Identity'verificationReportType' -> ShowS
$cshowsPrec :: Int -> Identity'verificationReportType' -> ShowS
GHC.Show.Show, Identity'verificationReportType'
-> Identity'verificationReportType' -> Bool
(Identity'verificationReportType'
 -> Identity'verificationReportType' -> Bool)
-> (Identity'verificationReportType'
    -> Identity'verificationReportType' -> Bool)
-> Eq Identity'verificationReportType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Identity'verificationReportType'
-> Identity'verificationReportType' -> Bool
$c/= :: Identity'verificationReportType'
-> Identity'verificationReportType' -> Bool
== :: Identity'verificationReportType'
-> Identity'verificationReportType' -> Bool
$c== :: Identity'verificationReportType'
-> Identity'verificationReportType' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON Identity'verificationReportType' where
  toJSON :: Identity'verificationReportType' -> Value
toJSON (Identity'verificationReportType'Other Value
val) = Value
val
  toJSON (Identity'verificationReportType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (Identity'verificationReportType'
Identity'verificationReportType'EnumDocument) = Value
"document"
  toJSON (Identity'verificationReportType'
Identity'verificationReportType'EnumIdNumber) = Value
"id_number"

instance Data.Aeson.Types.FromJSON.FromJSON Identity'verificationReportType' where
  parseJSON :: Value -> Parser Identity'verificationReportType'
parseJSON Value
val =
    Identity'verificationReportType'
-> Parser Identity'verificationReportType'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"document" -> Identity'verificationReportType'
Identity'verificationReportType'EnumDocument
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"id_number" -> Identity'verificationReportType'
Identity'verificationReportType'EnumIdNumber
            | Bool
GHC.Base.otherwise -> Value -> Identity'verificationReportType'
Identity'verificationReportType'Other Value
val
      )