{-# 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 GelatoVerifiedOutputs module StripeAPI.Types.GelatoVerifiedOutputs where import qualified Control.Monad.Fail import qualified Data.Aeson import qualified Data.Aeson as Data.Aeson.Encoding.Internal import qualified Data.Aeson as Data.Aeson.Types import qualified Data.Aeson as Data.Aeson.Types.FromJSON import qualified Data.Aeson as Data.Aeson.Types.Internal import qualified Data.Aeson as Data.Aeson.Types.ToJSON import qualified Data.ByteString.Char8 import qualified Data.ByteString.Char8 as Data.ByteString.Internal import qualified Data.Foldable import qualified Data.Functor import qualified Data.Maybe import qualified Data.Scientific import qualified Data.Text import qualified Data.Text.Internal import qualified Data.Time.Calendar as Data.Time.Calendar.Days import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime import qualified GHC.Base import qualified GHC.Classes import qualified GHC.Int import qualified GHC.Show import qualified GHC.Types import qualified StripeAPI.Common import StripeAPI.TypeAlias import {-# SOURCE #-} StripeAPI.Types.Address import {-# SOURCE #-} StripeAPI.Types.GelatoDataVerifiedOutputsDate import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.gelato_verified_outputs@ in the specification. data GelatoVerifiedOutputs = GelatoVerifiedOutputs { -- | address: The user\'s verified address. gelatoVerifiedOutputsAddress :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GelatoVerifiedOutputsAddress'NonNullable)), -- | dob: The user’s verified date of birth. gelatoVerifiedOutputsDob :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GelatoVerifiedOutputsDob'NonNullable)), -- | first_name: The user\'s verified first name. -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsFirstName :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | id_number: The user\'s verified id number. -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsIdNumber :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | id_number_type: The user\'s verified id number type. gelatoVerifiedOutputsIdNumberType :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GelatoVerifiedOutputsIdNumberType'NonNullable)), -- | last_name: The user\'s verified last name. -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsLastName :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON GelatoVerifiedOutputs where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("address" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("dob" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("first_name" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsFirstName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id_number" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsIdNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id_number_type" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsIdNumberType obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("last_name" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsLastName obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("address" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("dob" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("first_name" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsFirstName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id_number" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsIdNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("id_number_type" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsIdNumberType obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("last_name" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsLastName obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON GelatoVerifiedOutputs where parseJSON = Data.Aeson.Types.FromJSON.withObject "GelatoVerifiedOutputs" (\obj -> (((((GHC.Base.pure GelatoVerifiedOutputs GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "dob")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "first_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id_number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "id_number_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "last_name")) -- | Create a new 'GelatoVerifiedOutputs' with all required fields. mkGelatoVerifiedOutputs :: GelatoVerifiedOutputs mkGelatoVerifiedOutputs = GelatoVerifiedOutputs { gelatoVerifiedOutputsAddress = GHC.Maybe.Nothing, gelatoVerifiedOutputsDob = GHC.Maybe.Nothing, gelatoVerifiedOutputsFirstName = GHC.Maybe.Nothing, gelatoVerifiedOutputsIdNumber = GHC.Maybe.Nothing, gelatoVerifiedOutputsIdNumberType = GHC.Maybe.Nothing, gelatoVerifiedOutputsLastName = GHC.Maybe.Nothing } -- | Defines the object schema located at @components.schemas.gelato_verified_outputs.properties.address.anyOf@ in the specification. -- -- The user\\\'s verified address. data GelatoVerifiedOutputsAddress'NonNullable = GelatoVerifiedOutputsAddress'NonNullable { -- | city: City, district, suburb, town, or village. -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsAddress'NonNullableCity :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable 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 gelatoVerifiedOutputsAddress'NonNullableCountry :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | line1: Address line 1 (e.g., street, PO Box, or company name). -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsAddress'NonNullableLine1 :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | line2: Address line 2 (e.g., apartment, suite, unit, or building). -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsAddress'NonNullableLine2 :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | postal_code: ZIP or postal code. -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsAddress'NonNullablePostalCode :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | state: State, county, province, or region. -- -- Constraints: -- -- * Maximum length of 5000 gelatoVerifiedOutputsAddress'NonNullableState :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON GelatoVerifiedOutputsAddress'NonNullable where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("city" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableCity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableCountry obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableLine1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableLine2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullablePostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableState obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("city" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableCity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableCountry obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableLine1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableLine2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullablePostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsAddress'NonNullableState obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON GelatoVerifiedOutputsAddress'NonNullable where parseJSON = Data.Aeson.Types.FromJSON.withObject "GelatoVerifiedOutputsAddress'NonNullable" (\obj -> (((((GHC.Base.pure GelatoVerifiedOutputsAddress'NonNullable GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "city")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "country")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "line1")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "line2")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "postal_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "state")) -- | Create a new 'GelatoVerifiedOutputsAddress'NonNullable' with all required fields. mkGelatoVerifiedOutputsAddress'NonNullable :: GelatoVerifiedOutputsAddress'NonNullable mkGelatoVerifiedOutputsAddress'NonNullable = GelatoVerifiedOutputsAddress'NonNullable { gelatoVerifiedOutputsAddress'NonNullableCity = GHC.Maybe.Nothing, gelatoVerifiedOutputsAddress'NonNullableCountry = GHC.Maybe.Nothing, gelatoVerifiedOutputsAddress'NonNullableLine1 = GHC.Maybe.Nothing, gelatoVerifiedOutputsAddress'NonNullableLine2 = GHC.Maybe.Nothing, gelatoVerifiedOutputsAddress'NonNullablePostalCode = GHC.Maybe.Nothing, gelatoVerifiedOutputsAddress'NonNullableState = GHC.Maybe.Nothing } -- | Defines the object schema located at @components.schemas.gelato_verified_outputs.properties.dob.anyOf@ in the specification. -- -- The user’s verified date of birth. data GelatoVerifiedOutputsDob'NonNullable = GelatoVerifiedOutputsDob'NonNullable { -- | day: Numerical day between 1 and 31. gelatoVerifiedOutputsDob'NonNullableDay :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | month: Numerical month between 1 and 12. gelatoVerifiedOutputsDob'NonNullableMonth :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | year: The four-digit year. gelatoVerifiedOutputsDob'NonNullableYear :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON GelatoVerifiedOutputsDob'NonNullable where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("day" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob'NonNullableDay obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("month" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob'NonNullableMonth obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("year" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob'NonNullableYear obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("day" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob'NonNullableDay obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("month" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob'NonNullableMonth obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("year" Data.Aeson.Types.ToJSON..=)) (gelatoVerifiedOutputsDob'NonNullableYear obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON GelatoVerifiedOutputsDob'NonNullable where parseJSON = Data.Aeson.Types.FromJSON.withObject "GelatoVerifiedOutputsDob'NonNullable" (\obj -> ((GHC.Base.pure GelatoVerifiedOutputsDob'NonNullable GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "day")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "month")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "year")) -- | Create a new 'GelatoVerifiedOutputsDob'NonNullable' with all required fields. mkGelatoVerifiedOutputsDob'NonNullable :: GelatoVerifiedOutputsDob'NonNullable mkGelatoVerifiedOutputsDob'NonNullable = GelatoVerifiedOutputsDob'NonNullable { gelatoVerifiedOutputsDob'NonNullableDay = GHC.Maybe.Nothing, gelatoVerifiedOutputsDob'NonNullableMonth = GHC.Maybe.Nothing, gelatoVerifiedOutputsDob'NonNullableYear = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.gelato_verified_outputs.properties.id_number_type@ in the specification. -- -- The user\'s verified id number type. data GelatoVerifiedOutputsIdNumberType'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. GelatoVerifiedOutputsIdNumberType'NonNullableOther Data.Aeson.Types.Internal.Value | -- | This constructor can be used to send values to the server which are not present in the specification yet. GelatoVerifiedOutputsIdNumberType'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"br_cpf"@ GelatoVerifiedOutputsIdNumberType'NonNullableEnumBrCpf | -- | Represents the JSON value @"sg_nric"@ GelatoVerifiedOutputsIdNumberType'NonNullableEnumSgNric | -- | Represents the JSON value @"us_ssn"@ GelatoVerifiedOutputsIdNumberType'NonNullableEnumUsSsn deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON GelatoVerifiedOutputsIdNumberType'NonNullable where toJSON (GelatoVerifiedOutputsIdNumberType'NonNullableOther val) = val toJSON (GelatoVerifiedOutputsIdNumberType'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (GelatoVerifiedOutputsIdNumberType'NonNullableEnumBrCpf) = "br_cpf" toJSON (GelatoVerifiedOutputsIdNumberType'NonNullableEnumSgNric) = "sg_nric" toJSON (GelatoVerifiedOutputsIdNumberType'NonNullableEnumUsSsn) = "us_ssn" instance Data.Aeson.Types.FromJSON.FromJSON GelatoVerifiedOutputsIdNumberType'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "br_cpf" -> GelatoVerifiedOutputsIdNumberType'NonNullableEnumBrCpf | val GHC.Classes.== "sg_nric" -> GelatoVerifiedOutputsIdNumberType'NonNullableEnumSgNric | val GHC.Classes.== "us_ssn" -> GelatoVerifiedOutputsIdNumberType'NonNullableEnumUsSsn | GHC.Base.otherwise -> GelatoVerifiedOutputsIdNumberType'NonNullableOther val )