{-# 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 GelatoDocumentReport
module StripeAPI.Types.GelatoDocumentReport 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.Address
import {-# SOURCE #-} StripeAPI.Types.GelatoDataDocumentReportDateOfBirth
import {-# SOURCE #-} StripeAPI.Types.GelatoDataDocumentReportExpirationDate
import {-# SOURCE #-} StripeAPI.Types.GelatoDataDocumentReportIssuedDate
import {-# SOURCE #-} StripeAPI.Types.GelatoDocumentReportError
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.gelato_document_report@ in the specification.
--
-- Result from a document check
data GelatoDocumentReport = GelatoDocumentReport
  { -- | address: Address as it appears in the document.
    GelatoDocumentReport -> Maybe GelatoDocumentReportAddress'
gelatoDocumentReportAddress :: (GHC.Maybe.Maybe GelatoDocumentReportAddress'),
    -- | dob: Date of birth as it appears in the document.
    GelatoDocumentReport -> Maybe GelatoDocumentReportDob'
gelatoDocumentReportDob :: (GHC.Maybe.Maybe GelatoDocumentReportDob'),
    -- | error: Details on the verification error. Present when status is \`unverified\`.
    GelatoDocumentReport -> Maybe GelatoDocumentReportError'
gelatoDocumentReportError :: (GHC.Maybe.Maybe GelatoDocumentReportError'),
    -- | expiration_date: Expiration date of the document.
    GelatoDocumentReport -> Maybe GelatoDocumentReportExpirationDate'
gelatoDocumentReportExpirationDate :: (GHC.Maybe.Maybe GelatoDocumentReportExpirationDate'),
    -- | files: Array of [File](https:\/\/stripe.com\/docs\/api\/files) ids containing images for this document.
    GelatoDocumentReport -> Maybe [Text]
gelatoDocumentReportFiles :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
    -- | first_name: First name as it appears in the document.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReport -> Maybe Text
gelatoDocumentReportFirstName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | issued_date: Issued date of the document.
    GelatoDocumentReport -> Maybe GelatoDocumentReportIssuedDate'
gelatoDocumentReportIssuedDate :: (GHC.Maybe.Maybe GelatoDocumentReportIssuedDate'),
    -- | issuing_country: Issuing country of the document.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReport -> Maybe Text
gelatoDocumentReportIssuingCountry :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | last_name: Last name as it appears in the document.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReport -> Maybe Text
gelatoDocumentReportLastName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | number: Document ID number.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReport -> Maybe Text
gelatoDocumentReportNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | status: Status of this \`document\` check.
    GelatoDocumentReport -> GelatoDocumentReportStatus'
gelatoDocumentReportStatus :: GelatoDocumentReportStatus',
    -- | type: Type of the document.
    GelatoDocumentReport -> Maybe GelatoDocumentReportType'
gelatoDocumentReportType :: (GHC.Maybe.Maybe GelatoDocumentReportType')
  }
  deriving
    ( Int -> GelatoDocumentReport -> ShowS
[GelatoDocumentReport] -> ShowS
GelatoDocumentReport -> String
(Int -> GelatoDocumentReport -> ShowS)
-> (GelatoDocumentReport -> String)
-> ([GelatoDocumentReport] -> ShowS)
-> Show GelatoDocumentReport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReport] -> ShowS
$cshowList :: [GelatoDocumentReport] -> ShowS
show :: GelatoDocumentReport -> String
$cshow :: GelatoDocumentReport -> String
showsPrec :: Int -> GelatoDocumentReport -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReport -> ShowS
GHC.Show.Show,
      GelatoDocumentReport -> GelatoDocumentReport -> Bool
(GelatoDocumentReport -> GelatoDocumentReport -> Bool)
-> (GelatoDocumentReport -> GelatoDocumentReport -> Bool)
-> Eq GelatoDocumentReport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReport -> GelatoDocumentReport -> Bool
$c/= :: GelatoDocumentReport -> GelatoDocumentReport -> Bool
== :: GelatoDocumentReport -> GelatoDocumentReport -> Bool
$c== :: GelatoDocumentReport -> GelatoDocumentReport -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReport where
  toJSON :: GelatoDocumentReport -> Value
toJSON GelatoDocumentReport
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"address" Text -> Maybe GelatoDocumentReportAddress' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportAddress'
gelatoDocumentReportAddress GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"dob" Text -> Maybe GelatoDocumentReportDob' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportDob'
gelatoDocumentReportDob GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"error" Text -> Maybe GelatoDocumentReportError' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportError'
gelatoDocumentReportError GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"expiration_date" Text -> Maybe GelatoDocumentReportExpirationDate' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportExpirationDate'
gelatoDocumentReportExpirationDate GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"files" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe [Text]
gelatoDocumentReportFiles GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"first_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportFirstName GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"issued_date" Text -> Maybe GelatoDocumentReportIssuedDate' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportIssuedDate'
gelatoDocumentReportIssuedDate GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"issuing_country" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportIssuingCountry GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"last_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportLastName GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"number" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportNumber GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"status" Text -> GelatoDocumentReportStatus' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> GelatoDocumentReportStatus'
gelatoDocumentReportStatus GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"type" Text -> Maybe GelatoDocumentReportType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportType'
gelatoDocumentReportType GelatoDocumentReport
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GelatoDocumentReport -> Encoding
toEncoding GelatoDocumentReport
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"address" Text -> Maybe GelatoDocumentReportAddress' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportAddress'
gelatoDocumentReportAddress GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"dob" Text -> Maybe GelatoDocumentReportDob' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportDob'
gelatoDocumentReportDob GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"error" Text -> Maybe GelatoDocumentReportError' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportError'
gelatoDocumentReportError GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"expiration_date" Text -> Maybe GelatoDocumentReportExpirationDate' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportExpirationDate'
gelatoDocumentReportExpirationDate GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"files" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe [Text]
gelatoDocumentReportFiles GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"first_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportFirstName GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"issued_date" Text -> Maybe GelatoDocumentReportIssuedDate' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportIssuedDate'
gelatoDocumentReportIssuedDate GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"issuing_country" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportIssuingCountry GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"last_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportLastName GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"number" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe Text
gelatoDocumentReportNumber GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"status" Text -> GelatoDocumentReportStatus' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> GelatoDocumentReportStatus'
gelatoDocumentReportStatus GelatoDocumentReport
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"type" Text -> Maybe GelatoDocumentReportType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReport -> Maybe GelatoDocumentReportType'
gelatoDocumentReportType GelatoDocumentReport
obj))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReport where
  parseJSON :: Value -> Parser GelatoDocumentReport
parseJSON = String
-> (Object -> Parser GelatoDocumentReport)
-> Value
-> Parser GelatoDocumentReport
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GelatoDocumentReport" (\Object
obj -> ((((((((((((Maybe GelatoDocumentReportAddress'
 -> Maybe GelatoDocumentReportDob'
 -> Maybe GelatoDocumentReportError'
 -> Maybe GelatoDocumentReportExpirationDate'
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe GelatoDocumentReportIssuedDate'
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> GelatoDocumentReportStatus'
 -> Maybe GelatoDocumentReportType'
 -> GelatoDocumentReport)
-> Parser
     (Maybe GelatoDocumentReportAddress'
      -> Maybe GelatoDocumentReportDob'
      -> Maybe GelatoDocumentReportError'
      -> Maybe GelatoDocumentReportExpirationDate'
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe GelatoDocumentReportIssuedDate'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe GelatoDocumentReportAddress'
-> Maybe GelatoDocumentReportDob'
-> Maybe GelatoDocumentReportError'
-> Maybe GelatoDocumentReportExpirationDate'
-> Maybe [Text]
-> Maybe Text
-> Maybe GelatoDocumentReportIssuedDate'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GelatoDocumentReportStatus'
-> Maybe GelatoDocumentReportType'
-> GelatoDocumentReport
GelatoDocumentReport Parser
  (Maybe GelatoDocumentReportAddress'
   -> Maybe GelatoDocumentReportDob'
   -> Maybe GelatoDocumentReportError'
   -> Maybe GelatoDocumentReportExpirationDate'
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe GelatoDocumentReportIssuedDate'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe GelatoDocumentReportAddress')
-> Parser
     (Maybe GelatoDocumentReportDob'
      -> Maybe GelatoDocumentReportError'
      -> Maybe GelatoDocumentReportExpirationDate'
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe GelatoDocumentReportIssuedDate'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoDocumentReportAddress')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address")) Parser
  (Maybe GelatoDocumentReportDob'
   -> Maybe GelatoDocumentReportError'
   -> Maybe GelatoDocumentReportExpirationDate'
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe GelatoDocumentReportIssuedDate'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe GelatoDocumentReportDob')
-> Parser
     (Maybe GelatoDocumentReportError'
      -> Maybe GelatoDocumentReportExpirationDate'
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe GelatoDocumentReportIssuedDate'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoDocumentReportDob')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"dob")) Parser
  (Maybe GelatoDocumentReportError'
   -> Maybe GelatoDocumentReportExpirationDate'
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe GelatoDocumentReportIssuedDate'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe GelatoDocumentReportError')
-> Parser
     (Maybe GelatoDocumentReportExpirationDate'
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe GelatoDocumentReportIssuedDate'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoDocumentReportError')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"error")) Parser
  (Maybe GelatoDocumentReportExpirationDate'
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe GelatoDocumentReportIssuedDate'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe GelatoDocumentReportExpirationDate')
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe GelatoDocumentReportIssuedDate'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe GelatoDocumentReportExpirationDate')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"expiration_date")) Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe GelatoDocumentReportIssuedDate'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe GelatoDocumentReportIssuedDate'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
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
"files")) Parser
  (Maybe Text
   -> Maybe GelatoDocumentReportIssuedDate'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe Text)
-> Parser
     (Maybe GelatoDocumentReportIssuedDate'
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
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
"first_name")) Parser
  (Maybe GelatoDocumentReportIssuedDate'
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe GelatoDocumentReportIssuedDate')
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoDocumentReportIssuedDate')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"issued_date")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
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
"issuing_country")) Parser
  (Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType'
      -> GelatoDocumentReport)
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
"last_name")) Parser
  (Maybe Text
   -> GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType'
   -> GelatoDocumentReport)
-> Parser (Maybe Text)
-> Parser
     (GelatoDocumentReportStatus'
      -> Maybe GelatoDocumentReportType' -> GelatoDocumentReport)
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
"number")) Parser
  (GelatoDocumentReportStatus'
   -> Maybe GelatoDocumentReportType' -> GelatoDocumentReport)
-> Parser GelatoDocumentReportStatus'
-> Parser (Maybe GelatoDocumentReportType' -> GelatoDocumentReport)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser GelatoDocumentReportStatus'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"status")) Parser (Maybe GelatoDocumentReportType' -> GelatoDocumentReport)
-> Parser (Maybe GelatoDocumentReportType')
-> Parser GelatoDocumentReport
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoDocumentReportType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"type"))

-- | Create a new 'GelatoDocumentReport' with all required fields.
mkGelatoDocumentReport ::
  -- | 'gelatoDocumentReportStatus'
  GelatoDocumentReportStatus' ->
  GelatoDocumentReport
mkGelatoDocumentReport :: GelatoDocumentReportStatus' -> GelatoDocumentReport
mkGelatoDocumentReport GelatoDocumentReportStatus'
gelatoDocumentReportStatus =
  GelatoDocumentReport :: Maybe GelatoDocumentReportAddress'
-> Maybe GelatoDocumentReportDob'
-> Maybe GelatoDocumentReportError'
-> Maybe GelatoDocumentReportExpirationDate'
-> Maybe [Text]
-> Maybe Text
-> Maybe GelatoDocumentReportIssuedDate'
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GelatoDocumentReportStatus'
-> Maybe GelatoDocumentReportType'
-> GelatoDocumentReport
GelatoDocumentReport
    { gelatoDocumentReportAddress :: Maybe GelatoDocumentReportAddress'
gelatoDocumentReportAddress = Maybe GelatoDocumentReportAddress'
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportDob :: Maybe GelatoDocumentReportDob'
gelatoDocumentReportDob = Maybe GelatoDocumentReportDob'
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportError :: Maybe GelatoDocumentReportError'
gelatoDocumentReportError = Maybe GelatoDocumentReportError'
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportExpirationDate :: Maybe GelatoDocumentReportExpirationDate'
gelatoDocumentReportExpirationDate = Maybe GelatoDocumentReportExpirationDate'
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportFiles :: Maybe [Text]
gelatoDocumentReportFiles = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportFirstName :: Maybe Text
gelatoDocumentReportFirstName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportIssuedDate :: Maybe GelatoDocumentReportIssuedDate'
gelatoDocumentReportIssuedDate = Maybe GelatoDocumentReportIssuedDate'
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportIssuingCountry :: Maybe Text
gelatoDocumentReportIssuingCountry = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportLastName :: Maybe Text
gelatoDocumentReportLastName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportNumber :: Maybe Text
gelatoDocumentReportNumber = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportStatus :: GelatoDocumentReportStatus'
gelatoDocumentReportStatus = GelatoDocumentReportStatus'
gelatoDocumentReportStatus,
      gelatoDocumentReportType :: Maybe GelatoDocumentReportType'
gelatoDocumentReportType = Maybe GelatoDocumentReportType'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.gelato_document_report.properties.address.anyOf@ in the specification.
--
-- Address as it appears in the document.
data GelatoDocumentReportAddress' = GelatoDocumentReportAddress'
  { -- | city: City, district, suburb, town, or village.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | country: Two-letter country code ([ISO 3166-1 alpha-2](https:\/\/en.wikipedia.org\/wiki\/ISO_3166-1_alpha-2)).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line1: Address line 1 (e.g., street, PO Box, or company name).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | line2: Address line 2 (e.g., apartment, suite, unit, or building).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | postal_code: ZIP or postal code.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | state: State, county, province, or region.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> GelatoDocumentReportAddress' -> ShowS
[GelatoDocumentReportAddress'] -> ShowS
GelatoDocumentReportAddress' -> String
(Int -> GelatoDocumentReportAddress' -> ShowS)
-> (GelatoDocumentReportAddress' -> String)
-> ([GelatoDocumentReportAddress'] -> ShowS)
-> Show GelatoDocumentReportAddress'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportAddress'] -> ShowS
$cshowList :: [GelatoDocumentReportAddress'] -> ShowS
show :: GelatoDocumentReportAddress' -> String
$cshow :: GelatoDocumentReportAddress' -> String
showsPrec :: Int -> GelatoDocumentReportAddress' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportAddress' -> ShowS
GHC.Show.Show,
      GelatoDocumentReportAddress'
-> GelatoDocumentReportAddress' -> Bool
(GelatoDocumentReportAddress'
 -> GelatoDocumentReportAddress' -> Bool)
-> (GelatoDocumentReportAddress'
    -> GelatoDocumentReportAddress' -> Bool)
-> Eq GelatoDocumentReportAddress'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportAddress'
-> GelatoDocumentReportAddress' -> Bool
$c/= :: GelatoDocumentReportAddress'
-> GelatoDocumentReportAddress' -> Bool
== :: GelatoDocumentReportAddress'
-> GelatoDocumentReportAddress' -> Bool
$c== :: GelatoDocumentReportAddress'
-> GelatoDocumentReportAddress' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportAddress' where
  toJSON :: GelatoDocumentReportAddress' -> Value
toJSON GelatoDocumentReportAddress'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"city" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'City GelatoDocumentReportAddress'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"country" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Country GelatoDocumentReportAddress'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"line1" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Line1 GelatoDocumentReportAddress'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"line2" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Line2 GelatoDocumentReportAddress'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"postal_code" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'PostalCode GelatoDocumentReportAddress'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"state" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'State GelatoDocumentReportAddress'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GelatoDocumentReportAddress' -> Encoding
toEncoding GelatoDocumentReportAddress'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"city" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'City GelatoDocumentReportAddress'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"country" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Country GelatoDocumentReportAddress'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"line1" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Line1 GelatoDocumentReportAddress'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"line2" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'Line2 GelatoDocumentReportAddress'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"postal_code" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'PostalCode GelatoDocumentReportAddress'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"state" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportAddress' -> Maybe Text
gelatoDocumentReportAddress'State GelatoDocumentReportAddress'
obj))))))

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportAddress' where
  parseJSON :: Value -> Parser GelatoDocumentReportAddress'
parseJSON = String
-> (Object -> Parser GelatoDocumentReportAddress')
-> Value
-> Parser GelatoDocumentReportAddress'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GelatoDocumentReportAddress'" (\Object
obj -> ((((((Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> GelatoDocumentReportAddress')
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportAddress')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GelatoDocumentReportAddress'
GelatoDocumentReportAddress' Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportAddress')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportAddress')
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
"city")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportAddress')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GelatoDocumentReportAddress')
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
"country")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GelatoDocumentReportAddress')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> GelatoDocumentReportAddress')
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
"line1")) Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> GelatoDocumentReportAddress')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> GelatoDocumentReportAddress')
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
"line2")) Parser (Maybe Text -> Maybe Text -> GelatoDocumentReportAddress')
-> Parser (Maybe Text)
-> Parser (Maybe Text -> GelatoDocumentReportAddress')
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
"postal_code")) Parser (Maybe Text -> GelatoDocumentReportAddress')
-> Parser (Maybe Text) -> Parser GelatoDocumentReportAddress'
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
"state"))

-- | Create a new 'GelatoDocumentReportAddress'' with all required fields.
mkGelatoDocumentReportAddress' :: GelatoDocumentReportAddress'
mkGelatoDocumentReportAddress' :: GelatoDocumentReportAddress'
mkGelatoDocumentReportAddress' =
  GelatoDocumentReportAddress' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GelatoDocumentReportAddress'
GelatoDocumentReportAddress'
    { gelatoDocumentReportAddress'City :: Maybe Text
gelatoDocumentReportAddress'City = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportAddress'Country :: Maybe Text
gelatoDocumentReportAddress'Country = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportAddress'Line1 :: Maybe Text
gelatoDocumentReportAddress'Line1 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportAddress'Line2 :: Maybe Text
gelatoDocumentReportAddress'Line2 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportAddress'PostalCode :: Maybe Text
gelatoDocumentReportAddress'PostalCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportAddress'State :: Maybe Text
gelatoDocumentReportAddress'State = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.gelato_document_report.properties.dob.anyOf@ in the specification.
--
-- Date of birth as it appears in the document.
data GelatoDocumentReportDob' = GelatoDocumentReportDob'
  { -- | day: Numerical day between 1 and 31.
    GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Day :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | month: Numerical month between 1 and 12.
    GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Month :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | year: The four-digit year.
    GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Year :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int -> GelatoDocumentReportDob' -> ShowS
[GelatoDocumentReportDob'] -> ShowS
GelatoDocumentReportDob' -> String
(Int -> GelatoDocumentReportDob' -> ShowS)
-> (GelatoDocumentReportDob' -> String)
-> ([GelatoDocumentReportDob'] -> ShowS)
-> Show GelatoDocumentReportDob'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportDob'] -> ShowS
$cshowList :: [GelatoDocumentReportDob'] -> ShowS
show :: GelatoDocumentReportDob' -> String
$cshow :: GelatoDocumentReportDob' -> String
showsPrec :: Int -> GelatoDocumentReportDob' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportDob' -> ShowS
GHC.Show.Show,
      GelatoDocumentReportDob' -> GelatoDocumentReportDob' -> Bool
(GelatoDocumentReportDob' -> GelatoDocumentReportDob' -> Bool)
-> (GelatoDocumentReportDob' -> GelatoDocumentReportDob' -> Bool)
-> Eq GelatoDocumentReportDob'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportDob' -> GelatoDocumentReportDob' -> Bool
$c/= :: GelatoDocumentReportDob' -> GelatoDocumentReportDob' -> Bool
== :: GelatoDocumentReportDob' -> GelatoDocumentReportDob' -> Bool
$c== :: GelatoDocumentReportDob' -> GelatoDocumentReportDob' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportDob' where
  toJSON :: GelatoDocumentReportDob' -> Value
toJSON GelatoDocumentReportDob'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"day" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Day GelatoDocumentReportDob'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"month" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Month GelatoDocumentReportDob'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"year" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Year GelatoDocumentReportDob'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GelatoDocumentReportDob' -> Encoding
toEncoding GelatoDocumentReportDob'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"day" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Day GelatoDocumentReportDob'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"month" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Month GelatoDocumentReportDob'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"year" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportDob' -> Maybe Int
gelatoDocumentReportDob'Year GelatoDocumentReportDob'
obj)))

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportDob' where
  parseJSON :: Value -> Parser GelatoDocumentReportDob'
parseJSON = String
-> (Object -> Parser GelatoDocumentReportDob')
-> Value
-> Parser GelatoDocumentReportDob'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GelatoDocumentReportDob'" (\Object
obj -> (((Maybe Int -> Maybe Int -> Maybe Int -> GelatoDocumentReportDob')
-> Parser
     (Maybe Int -> Maybe Int -> Maybe Int -> GelatoDocumentReportDob')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int -> Maybe Int -> Maybe Int -> GelatoDocumentReportDob'
GelatoDocumentReportDob' Parser
  (Maybe Int -> Maybe Int -> Maybe Int -> GelatoDocumentReportDob')
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> GelatoDocumentReportDob')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"day")) Parser (Maybe Int -> Maybe Int -> GelatoDocumentReportDob')
-> Parser (Maybe Int)
-> Parser (Maybe Int -> GelatoDocumentReportDob')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"month")) Parser (Maybe Int -> GelatoDocumentReportDob')
-> Parser (Maybe Int) -> Parser GelatoDocumentReportDob'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"year"))

-- | Create a new 'GelatoDocumentReportDob'' with all required fields.
mkGelatoDocumentReportDob' :: GelatoDocumentReportDob'
mkGelatoDocumentReportDob' :: GelatoDocumentReportDob'
mkGelatoDocumentReportDob' =
  GelatoDocumentReportDob' :: Maybe Int -> Maybe Int -> Maybe Int -> GelatoDocumentReportDob'
GelatoDocumentReportDob'
    { gelatoDocumentReportDob'Day :: Maybe Int
gelatoDocumentReportDob'Day = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportDob'Month :: Maybe Int
gelatoDocumentReportDob'Month = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportDob'Year :: Maybe Int
gelatoDocumentReportDob'Year = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.gelato_document_report.properties.error.anyOf@ in the specification.
--
-- Details on the verification error. Present when status is \\\`unverified\\\`.
data GelatoDocumentReportError' = GelatoDocumentReportError'
  { -- | code: A short machine-readable string giving the reason for the verification failure.
    GelatoDocumentReportError' -> Maybe GelatoDocumentReportError'Code'
gelatoDocumentReportError'Code :: (GHC.Maybe.Maybe GelatoDocumentReportError'Code'),
    -- | reason: A human-readable message giving the reason for the failure. These messages can be shown to your users.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GelatoDocumentReportError' -> Maybe Text
gelatoDocumentReportError'Reason :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> GelatoDocumentReportError' -> ShowS
[GelatoDocumentReportError'] -> ShowS
GelatoDocumentReportError' -> String
(Int -> GelatoDocumentReportError' -> ShowS)
-> (GelatoDocumentReportError' -> String)
-> ([GelatoDocumentReportError'] -> ShowS)
-> Show GelatoDocumentReportError'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportError'] -> ShowS
$cshowList :: [GelatoDocumentReportError'] -> ShowS
show :: GelatoDocumentReportError' -> String
$cshow :: GelatoDocumentReportError' -> String
showsPrec :: Int -> GelatoDocumentReportError' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportError' -> ShowS
GHC.Show.Show,
      GelatoDocumentReportError' -> GelatoDocumentReportError' -> Bool
(GelatoDocumentReportError' -> GelatoDocumentReportError' -> Bool)
-> (GelatoDocumentReportError'
    -> GelatoDocumentReportError' -> Bool)
-> Eq GelatoDocumentReportError'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportError' -> GelatoDocumentReportError' -> Bool
$c/= :: GelatoDocumentReportError' -> GelatoDocumentReportError' -> Bool
== :: GelatoDocumentReportError' -> GelatoDocumentReportError' -> Bool
$c== :: GelatoDocumentReportError' -> GelatoDocumentReportError' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportError' where
  toJSON :: GelatoDocumentReportError' -> Value
toJSON GelatoDocumentReportError'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"code" Text -> Maybe GelatoDocumentReportError'Code' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportError' -> Maybe GelatoDocumentReportError'Code'
gelatoDocumentReportError'Code GelatoDocumentReportError'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"reason" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportError' -> Maybe Text
gelatoDocumentReportError'Reason GelatoDocumentReportError'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GelatoDocumentReportError' -> Encoding
toEncoding GelatoDocumentReportError'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"code" Text -> Maybe GelatoDocumentReportError'Code' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportError' -> Maybe GelatoDocumentReportError'Code'
gelatoDocumentReportError'Code GelatoDocumentReportError'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"reason" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportError' -> Maybe Text
gelatoDocumentReportError'Reason GelatoDocumentReportError'
obj))

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportError' where
  parseJSON :: Value -> Parser GelatoDocumentReportError'
parseJSON = String
-> (Object -> Parser GelatoDocumentReportError')
-> Value
-> Parser GelatoDocumentReportError'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GelatoDocumentReportError'" (\Object
obj -> ((Maybe GelatoDocumentReportError'Code'
 -> Maybe Text -> GelatoDocumentReportError')
-> Parser
     (Maybe GelatoDocumentReportError'Code'
      -> Maybe Text -> GelatoDocumentReportError')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe GelatoDocumentReportError'Code'
-> Maybe Text -> GelatoDocumentReportError'
GelatoDocumentReportError' Parser
  (Maybe GelatoDocumentReportError'Code'
   -> Maybe Text -> GelatoDocumentReportError')
-> Parser (Maybe GelatoDocumentReportError'Code')
-> Parser (Maybe Text -> GelatoDocumentReportError')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GelatoDocumentReportError'Code')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"code")) Parser (Maybe Text -> GelatoDocumentReportError')
-> Parser (Maybe Text) -> Parser GelatoDocumentReportError'
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
"reason"))

-- | Create a new 'GelatoDocumentReportError'' with all required fields.
mkGelatoDocumentReportError' :: GelatoDocumentReportError'
mkGelatoDocumentReportError' :: GelatoDocumentReportError'
mkGelatoDocumentReportError' =
  GelatoDocumentReportError' :: Maybe GelatoDocumentReportError'Code'
-> Maybe Text -> GelatoDocumentReportError'
GelatoDocumentReportError'
    { gelatoDocumentReportError'Code :: Maybe GelatoDocumentReportError'Code'
gelatoDocumentReportError'Code = Maybe GelatoDocumentReportError'Code'
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportError'Reason :: Maybe Text
gelatoDocumentReportError'Reason = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.gelato_document_report.properties.error.anyOf.properties.code@ in the specification.
--
-- A short machine-readable string giving the reason for the verification failure.
data GelatoDocumentReportError'Code'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    GelatoDocumentReportError'Code'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.
    GelatoDocumentReportError'Code'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"document_expired"@
    GelatoDocumentReportError'Code'EnumDocumentExpired
  | -- | Represents the JSON value @"document_type_not_supported"@
    GelatoDocumentReportError'Code'EnumDocumentTypeNotSupported
  | -- | Represents the JSON value @"document_unverified_other"@
    GelatoDocumentReportError'Code'EnumDocumentUnverifiedOther
  deriving (Int -> GelatoDocumentReportError'Code' -> ShowS
[GelatoDocumentReportError'Code'] -> ShowS
GelatoDocumentReportError'Code' -> String
(Int -> GelatoDocumentReportError'Code' -> ShowS)
-> (GelatoDocumentReportError'Code' -> String)
-> ([GelatoDocumentReportError'Code'] -> ShowS)
-> Show GelatoDocumentReportError'Code'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportError'Code'] -> ShowS
$cshowList :: [GelatoDocumentReportError'Code'] -> ShowS
show :: GelatoDocumentReportError'Code' -> String
$cshow :: GelatoDocumentReportError'Code' -> String
showsPrec :: Int -> GelatoDocumentReportError'Code' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportError'Code' -> ShowS
GHC.Show.Show, GelatoDocumentReportError'Code'
-> GelatoDocumentReportError'Code' -> Bool
(GelatoDocumentReportError'Code'
 -> GelatoDocumentReportError'Code' -> Bool)
-> (GelatoDocumentReportError'Code'
    -> GelatoDocumentReportError'Code' -> Bool)
-> Eq GelatoDocumentReportError'Code'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportError'Code'
-> GelatoDocumentReportError'Code' -> Bool
$c/= :: GelatoDocumentReportError'Code'
-> GelatoDocumentReportError'Code' -> Bool
== :: GelatoDocumentReportError'Code'
-> GelatoDocumentReportError'Code' -> Bool
$c== :: GelatoDocumentReportError'Code'
-> GelatoDocumentReportError'Code' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportError'Code' where
  toJSON :: GelatoDocumentReportError'Code' -> Value
toJSON (GelatoDocumentReportError'Code'Other Value
val) = Value
val
  toJSON (GelatoDocumentReportError'Code'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (GelatoDocumentReportError'Code'
GelatoDocumentReportError'Code'EnumDocumentExpired) = Value
"document_expired"
  toJSON (GelatoDocumentReportError'Code'
GelatoDocumentReportError'Code'EnumDocumentTypeNotSupported) = Value
"document_type_not_supported"
  toJSON (GelatoDocumentReportError'Code'
GelatoDocumentReportError'Code'EnumDocumentUnverifiedOther) = Value
"document_unverified_other"

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportError'Code' where
  parseJSON :: Value -> Parser GelatoDocumentReportError'Code'
parseJSON Value
val =
    GelatoDocumentReportError'Code'
-> Parser GelatoDocumentReportError'Code'
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_expired" -> GelatoDocumentReportError'Code'
GelatoDocumentReportError'Code'EnumDocumentExpired
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"document_type_not_supported" -> GelatoDocumentReportError'Code'
GelatoDocumentReportError'Code'EnumDocumentTypeNotSupported
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"document_unverified_other" -> GelatoDocumentReportError'Code'
GelatoDocumentReportError'Code'EnumDocumentUnverifiedOther
            | Bool
GHC.Base.otherwise -> Value -> GelatoDocumentReportError'Code'
GelatoDocumentReportError'Code'Other Value
val
      )

-- | Defines the object schema located at @components.schemas.gelato_document_report.properties.expiration_date.anyOf@ in the specification.
--
-- Expiration date of the document.
data GelatoDocumentReportExpirationDate' = GelatoDocumentReportExpirationDate'
  { -- | day: Numerical day between 1 and 31.
    GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Day :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | month: Numerical month between 1 and 12.
    GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Month :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | year: The four-digit year.
    GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Year :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int -> GelatoDocumentReportExpirationDate' -> ShowS
[GelatoDocumentReportExpirationDate'] -> ShowS
GelatoDocumentReportExpirationDate' -> String
(Int -> GelatoDocumentReportExpirationDate' -> ShowS)
-> (GelatoDocumentReportExpirationDate' -> String)
-> ([GelatoDocumentReportExpirationDate'] -> ShowS)
-> Show GelatoDocumentReportExpirationDate'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportExpirationDate'] -> ShowS
$cshowList :: [GelatoDocumentReportExpirationDate'] -> ShowS
show :: GelatoDocumentReportExpirationDate' -> String
$cshow :: GelatoDocumentReportExpirationDate' -> String
showsPrec :: Int -> GelatoDocumentReportExpirationDate' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportExpirationDate' -> ShowS
GHC.Show.Show,
      GelatoDocumentReportExpirationDate'
-> GelatoDocumentReportExpirationDate' -> Bool
(GelatoDocumentReportExpirationDate'
 -> GelatoDocumentReportExpirationDate' -> Bool)
-> (GelatoDocumentReportExpirationDate'
    -> GelatoDocumentReportExpirationDate' -> Bool)
-> Eq GelatoDocumentReportExpirationDate'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportExpirationDate'
-> GelatoDocumentReportExpirationDate' -> Bool
$c/= :: GelatoDocumentReportExpirationDate'
-> GelatoDocumentReportExpirationDate' -> Bool
== :: GelatoDocumentReportExpirationDate'
-> GelatoDocumentReportExpirationDate' -> Bool
$c== :: GelatoDocumentReportExpirationDate'
-> GelatoDocumentReportExpirationDate' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportExpirationDate' where
  toJSON :: GelatoDocumentReportExpirationDate' -> Value
toJSON GelatoDocumentReportExpirationDate'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"day" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Day GelatoDocumentReportExpirationDate'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"month" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Month GelatoDocumentReportExpirationDate'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"year" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Year GelatoDocumentReportExpirationDate'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GelatoDocumentReportExpirationDate' -> Encoding
toEncoding GelatoDocumentReportExpirationDate'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"day" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Day GelatoDocumentReportExpirationDate'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"month" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Month GelatoDocumentReportExpirationDate'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"year" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportExpirationDate' -> Maybe Int
gelatoDocumentReportExpirationDate'Year GelatoDocumentReportExpirationDate'
obj)))

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportExpirationDate' where
  parseJSON :: Value -> Parser GelatoDocumentReportExpirationDate'
parseJSON = String
-> (Object -> Parser GelatoDocumentReportExpirationDate')
-> Value
-> Parser GelatoDocumentReportExpirationDate'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GelatoDocumentReportExpirationDate'" (\Object
obj -> (((Maybe Int
 -> Maybe Int -> Maybe Int -> GelatoDocumentReportExpirationDate')
-> Parser
     (Maybe Int
      -> Maybe Int -> Maybe Int -> GelatoDocumentReportExpirationDate')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe Int -> Maybe Int -> GelatoDocumentReportExpirationDate'
GelatoDocumentReportExpirationDate' Parser
  (Maybe Int
   -> Maybe Int -> Maybe Int -> GelatoDocumentReportExpirationDate')
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> Maybe Int -> GelatoDocumentReportExpirationDate')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"day")) Parser
  (Maybe Int -> Maybe Int -> GelatoDocumentReportExpirationDate')
-> Parser (Maybe Int)
-> Parser (Maybe Int -> GelatoDocumentReportExpirationDate')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"month")) Parser (Maybe Int -> GelatoDocumentReportExpirationDate')
-> Parser (Maybe Int) -> Parser GelatoDocumentReportExpirationDate'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"year"))

-- | Create a new 'GelatoDocumentReportExpirationDate'' with all required fields.
mkGelatoDocumentReportExpirationDate' :: GelatoDocumentReportExpirationDate'
mkGelatoDocumentReportExpirationDate' :: GelatoDocumentReportExpirationDate'
mkGelatoDocumentReportExpirationDate' =
  GelatoDocumentReportExpirationDate' :: Maybe Int
-> Maybe Int -> Maybe Int -> GelatoDocumentReportExpirationDate'
GelatoDocumentReportExpirationDate'
    { gelatoDocumentReportExpirationDate'Day :: Maybe Int
gelatoDocumentReportExpirationDate'Day = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportExpirationDate'Month :: Maybe Int
gelatoDocumentReportExpirationDate'Month = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportExpirationDate'Year :: Maybe Int
gelatoDocumentReportExpirationDate'Year = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @components.schemas.gelato_document_report.properties.issued_date.anyOf@ in the specification.
--
-- Issued date of the document.
data GelatoDocumentReportIssuedDate' = GelatoDocumentReportIssuedDate'
  { -- | day: Numerical day between 1 and 31.
    GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Day :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | month: Numerical month between 1 and 12.
    GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Month :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | year: The four-digit year.
    GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Year :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int -> GelatoDocumentReportIssuedDate' -> ShowS
[GelatoDocumentReportIssuedDate'] -> ShowS
GelatoDocumentReportIssuedDate' -> String
(Int -> GelatoDocumentReportIssuedDate' -> ShowS)
-> (GelatoDocumentReportIssuedDate' -> String)
-> ([GelatoDocumentReportIssuedDate'] -> ShowS)
-> Show GelatoDocumentReportIssuedDate'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportIssuedDate'] -> ShowS
$cshowList :: [GelatoDocumentReportIssuedDate'] -> ShowS
show :: GelatoDocumentReportIssuedDate' -> String
$cshow :: GelatoDocumentReportIssuedDate' -> String
showsPrec :: Int -> GelatoDocumentReportIssuedDate' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportIssuedDate' -> ShowS
GHC.Show.Show,
      GelatoDocumentReportIssuedDate'
-> GelatoDocumentReportIssuedDate' -> Bool
(GelatoDocumentReportIssuedDate'
 -> GelatoDocumentReportIssuedDate' -> Bool)
-> (GelatoDocumentReportIssuedDate'
    -> GelatoDocumentReportIssuedDate' -> Bool)
-> Eq GelatoDocumentReportIssuedDate'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportIssuedDate'
-> GelatoDocumentReportIssuedDate' -> Bool
$c/= :: GelatoDocumentReportIssuedDate'
-> GelatoDocumentReportIssuedDate' -> Bool
== :: GelatoDocumentReportIssuedDate'
-> GelatoDocumentReportIssuedDate' -> Bool
$c== :: GelatoDocumentReportIssuedDate'
-> GelatoDocumentReportIssuedDate' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportIssuedDate' where
  toJSON :: GelatoDocumentReportIssuedDate' -> Value
toJSON GelatoDocumentReportIssuedDate'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"day" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Day GelatoDocumentReportIssuedDate'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"month" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Month GelatoDocumentReportIssuedDate'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"year" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Year GelatoDocumentReportIssuedDate'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GelatoDocumentReportIssuedDate' -> Encoding
toEncoding GelatoDocumentReportIssuedDate'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"day" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Day GelatoDocumentReportIssuedDate'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"month" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Month GelatoDocumentReportIssuedDate'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"year" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoDocumentReportIssuedDate' -> Maybe Int
gelatoDocumentReportIssuedDate'Year GelatoDocumentReportIssuedDate'
obj)))

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportIssuedDate' where
  parseJSON :: Value -> Parser GelatoDocumentReportIssuedDate'
parseJSON = String
-> (Object -> Parser GelatoDocumentReportIssuedDate')
-> Value
-> Parser GelatoDocumentReportIssuedDate'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GelatoDocumentReportIssuedDate'" (\Object
obj -> (((Maybe Int
 -> Maybe Int -> Maybe Int -> GelatoDocumentReportIssuedDate')
-> Parser
     (Maybe Int
      -> Maybe Int -> Maybe Int -> GelatoDocumentReportIssuedDate')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe Int -> Maybe Int -> GelatoDocumentReportIssuedDate'
GelatoDocumentReportIssuedDate' Parser
  (Maybe Int
   -> Maybe Int -> Maybe Int -> GelatoDocumentReportIssuedDate')
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> Maybe Int -> GelatoDocumentReportIssuedDate')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"day")) Parser (Maybe Int -> Maybe Int -> GelatoDocumentReportIssuedDate')
-> Parser (Maybe Int)
-> Parser (Maybe Int -> GelatoDocumentReportIssuedDate')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"month")) Parser (Maybe Int -> GelatoDocumentReportIssuedDate')
-> Parser (Maybe Int) -> Parser GelatoDocumentReportIssuedDate'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"year"))

-- | Create a new 'GelatoDocumentReportIssuedDate'' with all required fields.
mkGelatoDocumentReportIssuedDate' :: GelatoDocumentReportIssuedDate'
mkGelatoDocumentReportIssuedDate' :: GelatoDocumentReportIssuedDate'
mkGelatoDocumentReportIssuedDate' =
  GelatoDocumentReportIssuedDate' :: Maybe Int
-> Maybe Int -> Maybe Int -> GelatoDocumentReportIssuedDate'
GelatoDocumentReportIssuedDate'
    { gelatoDocumentReportIssuedDate'Day :: Maybe Int
gelatoDocumentReportIssuedDate'Day = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportIssuedDate'Month :: Maybe Int
gelatoDocumentReportIssuedDate'Month = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      gelatoDocumentReportIssuedDate'Year :: Maybe Int
gelatoDocumentReportIssuedDate'Year = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @components.schemas.gelato_document_report.properties.status@ in the specification.
--
-- Status of this \`document\` check.
data GelatoDocumentReportStatus'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    GelatoDocumentReportStatus'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.
    GelatoDocumentReportStatus'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"unverified"@
    GelatoDocumentReportStatus'EnumUnverified
  | -- | Represents the JSON value @"verified"@
    GelatoDocumentReportStatus'EnumVerified
  deriving (Int -> GelatoDocumentReportStatus' -> ShowS
[GelatoDocumentReportStatus'] -> ShowS
GelatoDocumentReportStatus' -> String
(Int -> GelatoDocumentReportStatus' -> ShowS)
-> (GelatoDocumentReportStatus' -> String)
-> ([GelatoDocumentReportStatus'] -> ShowS)
-> Show GelatoDocumentReportStatus'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportStatus'] -> ShowS
$cshowList :: [GelatoDocumentReportStatus'] -> ShowS
show :: GelatoDocumentReportStatus' -> String
$cshow :: GelatoDocumentReportStatus' -> String
showsPrec :: Int -> GelatoDocumentReportStatus' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportStatus' -> ShowS
GHC.Show.Show, GelatoDocumentReportStatus' -> GelatoDocumentReportStatus' -> Bool
(GelatoDocumentReportStatus'
 -> GelatoDocumentReportStatus' -> Bool)
-> (GelatoDocumentReportStatus'
    -> GelatoDocumentReportStatus' -> Bool)
-> Eq GelatoDocumentReportStatus'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportStatus' -> GelatoDocumentReportStatus' -> Bool
$c/= :: GelatoDocumentReportStatus' -> GelatoDocumentReportStatus' -> Bool
== :: GelatoDocumentReportStatus' -> GelatoDocumentReportStatus' -> Bool
$c== :: GelatoDocumentReportStatus' -> GelatoDocumentReportStatus' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportStatus' where
  toJSON :: GelatoDocumentReportStatus' -> Value
toJSON (GelatoDocumentReportStatus'Other Value
val) = Value
val
  toJSON (GelatoDocumentReportStatus'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (GelatoDocumentReportStatus'
GelatoDocumentReportStatus'EnumUnverified) = Value
"unverified"
  toJSON (GelatoDocumentReportStatus'
GelatoDocumentReportStatus'EnumVerified) = Value
"verified"

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportStatus' where
  parseJSON :: Value -> Parser GelatoDocumentReportStatus'
parseJSON Value
val =
    GelatoDocumentReportStatus' -> Parser GelatoDocumentReportStatus'
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
"unverified" -> GelatoDocumentReportStatus'
GelatoDocumentReportStatus'EnumUnverified
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"verified" -> GelatoDocumentReportStatus'
GelatoDocumentReportStatus'EnumVerified
            | Bool
GHC.Base.otherwise -> Value -> GelatoDocumentReportStatus'
GelatoDocumentReportStatus'Other Value
val
      )

-- | Defines the enum schema located at @components.schemas.gelato_document_report.properties.type@ in the specification.
--
-- Type of the document.
data GelatoDocumentReportType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    GelatoDocumentReportType'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.
    GelatoDocumentReportType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"driving_license"@
    GelatoDocumentReportType'EnumDrivingLicense
  | -- | Represents the JSON value @"id_card"@
    GelatoDocumentReportType'EnumIdCard
  | -- | Represents the JSON value @"passport"@
    GelatoDocumentReportType'EnumPassport
  deriving (Int -> GelatoDocumentReportType' -> ShowS
[GelatoDocumentReportType'] -> ShowS
GelatoDocumentReportType' -> String
(Int -> GelatoDocumentReportType' -> ShowS)
-> (GelatoDocumentReportType' -> String)
-> ([GelatoDocumentReportType'] -> ShowS)
-> Show GelatoDocumentReportType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoDocumentReportType'] -> ShowS
$cshowList :: [GelatoDocumentReportType'] -> ShowS
show :: GelatoDocumentReportType' -> String
$cshow :: GelatoDocumentReportType' -> String
showsPrec :: Int -> GelatoDocumentReportType' -> ShowS
$cshowsPrec :: Int -> GelatoDocumentReportType' -> ShowS
GHC.Show.Show, GelatoDocumentReportType' -> GelatoDocumentReportType' -> Bool
(GelatoDocumentReportType' -> GelatoDocumentReportType' -> Bool)
-> (GelatoDocumentReportType' -> GelatoDocumentReportType' -> Bool)
-> Eq GelatoDocumentReportType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoDocumentReportType' -> GelatoDocumentReportType' -> Bool
$c/= :: GelatoDocumentReportType' -> GelatoDocumentReportType' -> Bool
== :: GelatoDocumentReportType' -> GelatoDocumentReportType' -> Bool
$c== :: GelatoDocumentReportType' -> GelatoDocumentReportType' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GelatoDocumentReportType' where
  toJSON :: GelatoDocumentReportType' -> Value
toJSON (GelatoDocumentReportType'Other Value
val) = Value
val
  toJSON (GelatoDocumentReportType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (GelatoDocumentReportType'
GelatoDocumentReportType'EnumDrivingLicense) = Value
"driving_license"
  toJSON (GelatoDocumentReportType'
GelatoDocumentReportType'EnumIdCard) = Value
"id_card"
  toJSON (GelatoDocumentReportType'
GelatoDocumentReportType'EnumPassport) = Value
"passport"

instance Data.Aeson.Types.FromJSON.FromJSON GelatoDocumentReportType' where
  parseJSON :: Value -> Parser GelatoDocumentReportType'
parseJSON Value
val =
    GelatoDocumentReportType' -> Parser GelatoDocumentReportType'
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
"driving_license" -> GelatoDocumentReportType'
GelatoDocumentReportType'EnumDrivingLicense
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"id_card" -> GelatoDocumentReportType'
GelatoDocumentReportType'EnumIdCard
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"passport" -> GelatoDocumentReportType'
GelatoDocumentReportType'EnumPassport
            | Bool
GHC.Base.otherwise -> Value -> GelatoDocumentReportType'
GelatoDocumentReportType'Other Value
val
      )