{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.GelatoSessionDocumentOptions where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Functor
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data GelatoSessionDocumentOptions = GelatoSessionDocumentOptions
{
GelatoSessionDocumentOptions
-> Maybe [GelatoSessionDocumentOptionsAllowedTypes']
gelatoSessionDocumentOptionsAllowedTypes :: (GHC.Maybe.Maybe ([GelatoSessionDocumentOptionsAllowedTypes'])),
GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireIdNumber :: (GHC.Maybe.Maybe GHC.Types.Bool),
GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireLiveCapture :: (GHC.Maybe.Maybe GHC.Types.Bool),
GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireMatchingSelfie :: (GHC.Maybe.Maybe GHC.Types.Bool)
}
deriving
( Int -> GelatoSessionDocumentOptions -> ShowS
[GelatoSessionDocumentOptions] -> ShowS
GelatoSessionDocumentOptions -> String
(Int -> GelatoSessionDocumentOptions -> ShowS)
-> (GelatoSessionDocumentOptions -> String)
-> ([GelatoSessionDocumentOptions] -> ShowS)
-> Show GelatoSessionDocumentOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoSessionDocumentOptions] -> ShowS
$cshowList :: [GelatoSessionDocumentOptions] -> ShowS
show :: GelatoSessionDocumentOptions -> String
$cshow :: GelatoSessionDocumentOptions -> String
showsPrec :: Int -> GelatoSessionDocumentOptions -> ShowS
$cshowsPrec :: Int -> GelatoSessionDocumentOptions -> ShowS
GHC.Show.Show,
GelatoSessionDocumentOptions
-> GelatoSessionDocumentOptions -> Bool
(GelatoSessionDocumentOptions
-> GelatoSessionDocumentOptions -> Bool)
-> (GelatoSessionDocumentOptions
-> GelatoSessionDocumentOptions -> Bool)
-> Eq GelatoSessionDocumentOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoSessionDocumentOptions
-> GelatoSessionDocumentOptions -> Bool
$c/= :: GelatoSessionDocumentOptions
-> GelatoSessionDocumentOptions -> Bool
== :: GelatoSessionDocumentOptions
-> GelatoSessionDocumentOptions -> Bool
$c== :: GelatoSessionDocumentOptions
-> GelatoSessionDocumentOptions -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON GelatoSessionDocumentOptions where
toJSON :: GelatoSessionDocumentOptions -> Value
toJSON GelatoSessionDocumentOptions
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"allowed_types" Text -> Maybe [GelatoSessionDocumentOptionsAllowedTypes'] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions
-> Maybe [GelatoSessionDocumentOptionsAllowedTypes']
gelatoSessionDocumentOptionsAllowedTypes GelatoSessionDocumentOptions
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"require_id_number" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireIdNumber GelatoSessionDocumentOptions
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"require_live_capture" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireLiveCapture GelatoSessionDocumentOptions
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"require_matching_selfie" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireMatchingSelfie GelatoSessionDocumentOptions
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: GelatoSessionDocumentOptions -> Encoding
toEncoding GelatoSessionDocumentOptions
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"allowed_types" Text -> Maybe [GelatoSessionDocumentOptionsAllowedTypes'] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions
-> Maybe [GelatoSessionDocumentOptionsAllowedTypes']
gelatoSessionDocumentOptionsAllowedTypes GelatoSessionDocumentOptions
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"require_id_number" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireIdNumber GelatoSessionDocumentOptions
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"require_live_capture" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireLiveCapture GelatoSessionDocumentOptions
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"require_matching_selfie" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GelatoSessionDocumentOptions -> Maybe Bool
gelatoSessionDocumentOptionsRequireMatchingSelfie GelatoSessionDocumentOptions
obj))))
instance Data.Aeson.Types.FromJSON.FromJSON GelatoSessionDocumentOptions where
parseJSON :: Value -> Parser GelatoSessionDocumentOptions
parseJSON = String
-> (Object -> Parser GelatoSessionDocumentOptions)
-> Value
-> Parser GelatoSessionDocumentOptions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GelatoSessionDocumentOptions" (\Object
obj -> ((((Maybe [GelatoSessionDocumentOptionsAllowedTypes']
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> GelatoSessionDocumentOptions)
-> Parser
(Maybe [GelatoSessionDocumentOptionsAllowedTypes']
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> GelatoSessionDocumentOptions)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe [GelatoSessionDocumentOptionsAllowedTypes']
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> GelatoSessionDocumentOptions
GelatoSessionDocumentOptions Parser
(Maybe [GelatoSessionDocumentOptionsAllowedTypes']
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> GelatoSessionDocumentOptions)
-> Parser (Maybe [GelatoSessionDocumentOptionsAllowedTypes'])
-> Parser
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> GelatoSessionDocumentOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe [GelatoSessionDocumentOptionsAllowedTypes'])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"allowed_types")) Parser
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> GelatoSessionDocumentOptions)
-> Parser (Maybe Bool)
-> Parser
(Maybe Bool -> Maybe Bool -> GelatoSessionDocumentOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"require_id_number")) Parser (Maybe Bool -> Maybe Bool -> GelatoSessionDocumentOptions)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> GelatoSessionDocumentOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"require_live_capture")) Parser (Maybe Bool -> GelatoSessionDocumentOptions)
-> Parser (Maybe Bool) -> Parser GelatoSessionDocumentOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"require_matching_selfie"))
mkGelatoSessionDocumentOptions :: GelatoSessionDocumentOptions
mkGelatoSessionDocumentOptions :: GelatoSessionDocumentOptions
mkGelatoSessionDocumentOptions =
GelatoSessionDocumentOptions :: Maybe [GelatoSessionDocumentOptionsAllowedTypes']
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> GelatoSessionDocumentOptions
GelatoSessionDocumentOptions
{ gelatoSessionDocumentOptionsAllowedTypes :: Maybe [GelatoSessionDocumentOptionsAllowedTypes']
gelatoSessionDocumentOptionsAllowedTypes = Maybe [GelatoSessionDocumentOptionsAllowedTypes']
forall a. Maybe a
GHC.Maybe.Nothing,
gelatoSessionDocumentOptionsRequireIdNumber :: Maybe Bool
gelatoSessionDocumentOptionsRequireIdNumber = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
gelatoSessionDocumentOptionsRequireLiveCapture :: Maybe Bool
gelatoSessionDocumentOptionsRequireLiveCapture = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
gelatoSessionDocumentOptionsRequireMatchingSelfie :: Maybe Bool
gelatoSessionDocumentOptionsRequireMatchingSelfie = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
}
data GelatoSessionDocumentOptionsAllowedTypes'
=
GelatoSessionDocumentOptionsAllowedTypes'Other Data.Aeson.Types.Internal.Value
|
GelatoSessionDocumentOptionsAllowedTypes'Typed Data.Text.Internal.Text
|
GelatoSessionDocumentOptionsAllowedTypes'EnumDrivingLicense
|
GelatoSessionDocumentOptionsAllowedTypes'EnumIdCard
|
GelatoSessionDocumentOptionsAllowedTypes'EnumPassport
deriving (Int -> GelatoSessionDocumentOptionsAllowedTypes' -> ShowS
[GelatoSessionDocumentOptionsAllowedTypes'] -> ShowS
GelatoSessionDocumentOptionsAllowedTypes' -> String
(Int -> GelatoSessionDocumentOptionsAllowedTypes' -> ShowS)
-> (GelatoSessionDocumentOptionsAllowedTypes' -> String)
-> ([GelatoSessionDocumentOptionsAllowedTypes'] -> ShowS)
-> Show GelatoSessionDocumentOptionsAllowedTypes'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GelatoSessionDocumentOptionsAllowedTypes'] -> ShowS
$cshowList :: [GelatoSessionDocumentOptionsAllowedTypes'] -> ShowS
show :: GelatoSessionDocumentOptionsAllowedTypes' -> String
$cshow :: GelatoSessionDocumentOptionsAllowedTypes' -> String
showsPrec :: Int -> GelatoSessionDocumentOptionsAllowedTypes' -> ShowS
$cshowsPrec :: Int -> GelatoSessionDocumentOptionsAllowedTypes' -> ShowS
GHC.Show.Show, GelatoSessionDocumentOptionsAllowedTypes'
-> GelatoSessionDocumentOptionsAllowedTypes' -> Bool
(GelatoSessionDocumentOptionsAllowedTypes'
-> GelatoSessionDocumentOptionsAllowedTypes' -> Bool)
-> (GelatoSessionDocumentOptionsAllowedTypes'
-> GelatoSessionDocumentOptionsAllowedTypes' -> Bool)
-> Eq GelatoSessionDocumentOptionsAllowedTypes'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GelatoSessionDocumentOptionsAllowedTypes'
-> GelatoSessionDocumentOptionsAllowedTypes' -> Bool
$c/= :: GelatoSessionDocumentOptionsAllowedTypes'
-> GelatoSessionDocumentOptionsAllowedTypes' -> Bool
== :: GelatoSessionDocumentOptionsAllowedTypes'
-> GelatoSessionDocumentOptionsAllowedTypes' -> Bool
$c== :: GelatoSessionDocumentOptionsAllowedTypes'
-> GelatoSessionDocumentOptionsAllowedTypes' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON GelatoSessionDocumentOptionsAllowedTypes' where
toJSON :: GelatoSessionDocumentOptionsAllowedTypes' -> Value
toJSON (GelatoSessionDocumentOptionsAllowedTypes'Other Value
val) = Value
val
toJSON (GelatoSessionDocumentOptionsAllowedTypes'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (GelatoSessionDocumentOptionsAllowedTypes'
GelatoSessionDocumentOptionsAllowedTypes'EnumDrivingLicense) = Value
"driving_license"
toJSON (GelatoSessionDocumentOptionsAllowedTypes'
GelatoSessionDocumentOptionsAllowedTypes'EnumIdCard) = Value
"id_card"
toJSON (GelatoSessionDocumentOptionsAllowedTypes'
GelatoSessionDocumentOptionsAllowedTypes'EnumPassport) = Value
"passport"
instance Data.Aeson.Types.FromJSON.FromJSON GelatoSessionDocumentOptionsAllowedTypes' where
parseJSON :: Value -> Parser GelatoSessionDocumentOptionsAllowedTypes'
parseJSON Value
val =
GelatoSessionDocumentOptionsAllowedTypes'
-> Parser GelatoSessionDocumentOptionsAllowedTypes'
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" -> GelatoSessionDocumentOptionsAllowedTypes'
GelatoSessionDocumentOptionsAllowedTypes'EnumDrivingLicense
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"id_card" -> GelatoSessionDocumentOptionsAllowedTypes'
GelatoSessionDocumentOptionsAllowedTypes'EnumIdCard
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"passport" -> GelatoSessionDocumentOptionsAllowedTypes'
GelatoSessionDocumentOptionsAllowedTypes'EnumPassport
| Bool
GHC.Base.otherwise -> Value -> GelatoSessionDocumentOptionsAllowedTypes'
GelatoSessionDocumentOptionsAllowedTypes'Other Value
val
)