{-# 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 PaymentPagesCheckoutSessionCustomerDetails module StripeAPI.Types.PaymentPagesCheckoutSessionCustomerDetails 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.PaymentPagesCheckoutSessionTaxId import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.payment_pages_checkout_session_customer_details@ in the specification. data PaymentPagesCheckoutSessionCustomerDetails = PaymentPagesCheckoutSessionCustomerDetails { -- | address: The customer\'s address at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. paymentPagesCheckoutSessionCustomerDetailsAddress :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable)), -- | email: The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry. -- Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. -- -- Constraints: -- -- * Maximum length of 5000 paymentPagesCheckoutSessionCustomerDetailsEmail :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | name: The customer\'s name at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. -- -- Constraints: -- -- * Maximum length of 5000 paymentPagesCheckoutSessionCustomerDetailsName :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | phone: The customer\'s phone number at the time of checkout -- -- Constraints: -- -- * Maximum length of 5000 paymentPagesCheckoutSessionCustomerDetailsPhone :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | tax_exempt: The customer’s tax exempt status at time of checkout. paymentPagesCheckoutSessionCustomerDetailsTaxExempt :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullable)), -- | tax_ids: The customer’s tax IDs at time of checkout. paymentPagesCheckoutSessionCustomerDetailsTaxIds :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([PaymentPagesCheckoutSessionTaxId]))) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PaymentPagesCheckoutSessionCustomerDetails 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..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsEmail obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsPhone obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_exempt" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsTaxExempt obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_ids" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsTaxIds 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..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsEmail obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsPhone obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_exempt" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsTaxExempt obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_ids" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsTaxIds obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PaymentPagesCheckoutSessionCustomerDetails where parseJSON = Data.Aeson.Types.FromJSON.withObject "PaymentPagesCheckoutSessionCustomerDetails" (\obj -> (((((GHC.Base.pure PaymentPagesCheckoutSessionCustomerDetails GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "email")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "phone")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tax_exempt")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tax_ids")) -- | Create a new 'PaymentPagesCheckoutSessionCustomerDetails' with all required fields. mkPaymentPagesCheckoutSessionCustomerDetails :: PaymentPagesCheckoutSessionCustomerDetails mkPaymentPagesCheckoutSessionCustomerDetails = PaymentPagesCheckoutSessionCustomerDetails { paymentPagesCheckoutSessionCustomerDetailsAddress = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsEmail = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsName = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsPhone = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsTaxExempt = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsTaxIds = GHC.Maybe.Nothing } -- | Defines the object schema located at @components.schemas.payment_pages_checkout_session_customer_details.properties.address.anyOf@ in the specification. -- -- The customer\\\'s address at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022. data PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable = PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable { -- | city: City, district, suburb, town, or village. -- -- Constraints: -- -- * Maximum length of 5000 paymentPagesCheckoutSessionCustomerDetailsAddress'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 paymentPagesCheckoutSessionCustomerDetailsAddress'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 paymentPagesCheckoutSessionCustomerDetailsAddress'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 paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableLine2 :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | postal_code: ZIP or postal code. -- -- Constraints: -- -- * Maximum length of 5000 paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullablePostalCode :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | state: State, county, province, or region. -- -- Constraints: -- -- * Maximum length of 5000 paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableState :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PaymentPagesCheckoutSessionCustomerDetailsAddress'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..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableCity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableCountry obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableLine1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableLine2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullablePostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'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..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableCity obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableCountry obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableLine1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableLine2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullablePostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableState obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable where parseJSON = Data.Aeson.Types.FromJSON.withObject "PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable" (\obj -> (((((GHC.Base.pure PaymentPagesCheckoutSessionCustomerDetailsAddress'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 'PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable' with all required fields. mkPaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable :: PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable mkPaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable = PaymentPagesCheckoutSessionCustomerDetailsAddress'NonNullable { paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableCity = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableCountry = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableLine1 = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableLine2 = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullablePostalCode = GHC.Maybe.Nothing, paymentPagesCheckoutSessionCustomerDetailsAddress'NonNullableState = GHC.Maybe.Nothing } -- | Defines the enum schema located at @components.schemas.payment_pages_checkout_session_customer_details.properties.tax_exempt@ in the specification. -- -- The customer’s tax exempt status at time of checkout. data PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'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. PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"exempt"@ PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumExempt | -- | Represents the JSON value @"none"@ PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumNone | -- | Represents the JSON value @"reverse"@ PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumReverse deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullable where toJSON (PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableOther val) = val toJSON (PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumExempt) = "exempt" toJSON (PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumNone) = "none" toJSON (PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumReverse) = "reverse" instance Data.Aeson.Types.FromJSON.FromJSON PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "exempt" -> PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumExempt | val GHC.Classes.== "none" -> PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumNone | val GHC.Classes.== "reverse" -> PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableEnumReverse | GHC.Base.otherwise -> PaymentPagesCheckoutSessionCustomerDetailsTaxExempt'NonNullableOther val )