{-# LANGUAGE ExplicitForAll #-} {-# 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 different functions to run the operation postCustomers module StripeAPI.Operations.PostCustomers where import qualified Control.Monad.Fail import qualified Control.Monad.Trans.Reader 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.Either 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 Data.Vector import qualified GHC.Base import qualified GHC.Classes import qualified GHC.Int import qualified GHC.Show import qualified GHC.Types import qualified Network.HTTP.Client import qualified Network.HTTP.Client as Network.HTTP.Client.Request import qualified Network.HTTP.Client as Network.HTTP.Client.Types import qualified Network.HTTP.Simple import qualified Network.HTTP.Types import qualified Network.HTTP.Types as Network.HTTP.Types.Status import qualified Network.HTTP.Types as Network.HTTP.Types.URI import qualified StripeAPI.Common import StripeAPI.Types import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | > POST /v1/customers -- -- \

Creates a new customer object.\<\/p> postCustomers :: forall m. StripeAPI.Common.MonadHTTP m => -- | The request body to send GHC.Maybe.Maybe PostCustomersRequestBody -> -- | Monadic computation which returns the result of the operation StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostCustomersResponse) postCustomers body = GHC.Base.fmap ( \response_0 -> GHC.Base.fmap ( Data.Either.either PostCustomersResponseError GHC.Base.id GHC.Base.. ( \response body -> if | (\status_1 -> Network.HTTP.Types.Status.statusCode status_1 GHC.Classes.== 200) (Network.HTTP.Client.Types.responseStatus response) -> PostCustomersResponse200 Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String Customer ) | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> PostCustomersResponseDefault Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body :: Data.Either.Either GHC.Base.String Error ) | GHC.Base.otherwise -> Data.Either.Left "Missing default response type" ) response_0 ) response_0 ) (StripeAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.pack "POST") (Data.Text.pack "/v1/customers") GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. data PostCustomersRequestBody = PostCustomersRequestBody { -- | address: The customer\'s address. postCustomersRequestBodyAddress :: (GHC.Maybe.Maybe PostCustomersRequestBodyAddress'Variants), -- | balance: An integer amount in cents (or local equivalent) that represents the customer\'s current balance, which affect the customer\'s future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. postCustomersRequestBodyBalance :: (GHC.Maybe.Maybe GHC.Types.Int), -- | cash_balance: Balance information and default balance settings for this customer. postCustomersRequestBodyCashBalance :: (GHC.Maybe.Maybe PostCustomersRequestBodyCashBalance'), -- | coupon -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyCoupon :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | description: An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | email: Customer\'s email address. It\'s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. -- -- Constraints: -- -- * Maximum length of 512 postCustomersRequestBodyEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | expand: Specifies which fields in the response should be expanded. postCustomersRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])), -- | invoice_prefix: The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyInvoicePrefix :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | invoice_settings: Default invoice settings for this customer. postCustomersRequestBodyInvoiceSettings :: (GHC.Maybe.Maybe PostCustomersRequestBodyInvoiceSettings'), -- | metadata: Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`. postCustomersRequestBodyMetadata :: (GHC.Maybe.Maybe PostCustomersRequestBodyMetadata'Variants), -- | name: The customer\'s full name or business name. -- -- Constraints: -- -- * Maximum length of 256 postCustomersRequestBodyName :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | next_invoice_sequence: The sequence to be used on the customer\'s next invoice. Defaults to 1. postCustomersRequestBodyNextInvoiceSequence :: (GHC.Maybe.Maybe GHC.Types.Int), -- | payment_method -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | phone: The customer\'s phone number. -- -- Constraints: -- -- * Maximum length of 20 postCustomersRequestBodyPhone :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | preferred_locales: Customer\'s preferred languages, ordered by preference. postCustomersRequestBodyPreferredLocales :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])), -- | promotion_code: The API ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyPromotionCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | shipping: The customer\'s shipping information. Appears on invoices emailed to this customer. postCustomersRequestBodyShipping :: (GHC.Maybe.Maybe PostCustomersRequestBodyShipping'Variants), -- | source -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodySource :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | tax: Tax details about the customer. postCustomersRequestBodyTax :: (GHC.Maybe.Maybe PostCustomersRequestBodyTax'), -- | tax_exempt: The customer\'s tax exemption. One of \`none\`, \`exempt\`, or \`reverse\`. postCustomersRequestBodyTaxExempt :: (GHC.Maybe.Maybe PostCustomersRequestBodyTaxExempt'), -- | tax_id_data: The customer\'s tax IDs. postCustomersRequestBodyTaxIdData :: (GHC.Maybe.Maybe ([PostCustomersRequestBodyTaxIdData'])), -- | test_clock: ID of the test clock to attach to the customer. -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyTestClock :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBody 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..=)) (postCustomersRequestBodyAddress obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("balance" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyBalance obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("cash_balance" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCashBalance obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("coupon" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCoupon obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("description" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyDescription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyEmail obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("expand" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyExpand obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("invoice_prefix" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoicePrefix obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("invoice_settings" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("metadata" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyMetadata obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("next_invoice_sequence" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyNextInvoiceSequence obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("payment_method" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPaymentMethod obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPhone obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("preferred_locales" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPreferredLocales obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("promotion_code" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPromotionCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("shipping" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("source" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodySource obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTax obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_exempt" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTaxExempt obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_id_data" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTaxIdData obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("test_clock" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTestClock 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..=)) (postCustomersRequestBodyAddress obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("balance" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyBalance obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("cash_balance" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCashBalance obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("coupon" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCoupon obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("description" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyDescription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("email" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyEmail obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("expand" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyExpand obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("invoice_prefix" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoicePrefix obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("invoice_settings" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("metadata" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyMetadata obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("name" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyName obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("next_invoice_sequence" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyNextInvoiceSequence obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("payment_method" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPaymentMethod obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPhone obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("preferred_locales" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPreferredLocales obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("promotion_code" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyPromotionCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("shipping" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("source" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodySource obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTax obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_exempt" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTaxExempt obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tax_id_data" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTaxIdData obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("test_clock" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTestClock obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBody where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBody" (\obj -> (((((((((((((((((((((GHC.Base.pure PostCustomersRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "balance")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "cash_balance")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "coupon")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "email")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "invoice_prefix")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "invoice_settings")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "next_invoice_sequence")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "phone")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "preferred_locales")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "promotion_code")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "shipping")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "source")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tax")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tax_exempt")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tax_id_data")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "test_clock")) -- | Create a new 'PostCustomersRequestBody' with all required fields. mkPostCustomersRequestBody :: PostCustomersRequestBody mkPostCustomersRequestBody = PostCustomersRequestBody { postCustomersRequestBodyAddress = GHC.Maybe.Nothing, postCustomersRequestBodyBalance = GHC.Maybe.Nothing, postCustomersRequestBodyCashBalance = GHC.Maybe.Nothing, postCustomersRequestBodyCoupon = GHC.Maybe.Nothing, postCustomersRequestBodyDescription = GHC.Maybe.Nothing, postCustomersRequestBodyEmail = GHC.Maybe.Nothing, postCustomersRequestBodyExpand = GHC.Maybe.Nothing, postCustomersRequestBodyInvoicePrefix = GHC.Maybe.Nothing, postCustomersRequestBodyInvoiceSettings = GHC.Maybe.Nothing, postCustomersRequestBodyMetadata = GHC.Maybe.Nothing, postCustomersRequestBodyName = GHC.Maybe.Nothing, postCustomersRequestBodyNextInvoiceSequence = GHC.Maybe.Nothing, postCustomersRequestBodyPaymentMethod = GHC.Maybe.Nothing, postCustomersRequestBodyPhone = GHC.Maybe.Nothing, postCustomersRequestBodyPreferredLocales = GHC.Maybe.Nothing, postCustomersRequestBodyPromotionCode = GHC.Maybe.Nothing, postCustomersRequestBodyShipping = GHC.Maybe.Nothing, postCustomersRequestBodySource = GHC.Maybe.Nothing, postCustomersRequestBodyTax = GHC.Maybe.Nothing, postCustomersRequestBodyTaxExempt = GHC.Maybe.Nothing, postCustomersRequestBodyTaxIdData = GHC.Maybe.Nothing, postCustomersRequestBodyTestClock = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.address.anyOf@ in the specification. data PostCustomersRequestBodyAddress'OneOf1 = PostCustomersRequestBodyAddress'OneOf1 { -- | city -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyAddress'OneOf1City :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | country -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyAddress'OneOf1Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | line1 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyAddress'OneOf1Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | line2 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyAddress'OneOf1Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | postal_code -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyAddress'OneOf1PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | state -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyAddress'OneOf1State :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyAddress'OneOf1 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..=)) (postCustomersRequestBodyAddress'OneOf1City obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1Country obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1Line1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1Line2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1PostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1State 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..=)) (postCustomersRequestBodyAddress'OneOf1City obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1Country obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1Line1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1Line2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1PostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyAddress'OneOf1State obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyAddress'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyAddress'OneOf1" (\obj -> (((((GHC.Base.pure PostCustomersRequestBodyAddress'OneOf1 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 'PostCustomersRequestBodyAddress'OneOf1' with all required fields. mkPostCustomersRequestBodyAddress'OneOf1 :: PostCustomersRequestBodyAddress'OneOf1 mkPostCustomersRequestBodyAddress'OneOf1 = PostCustomersRequestBodyAddress'OneOf1 { postCustomersRequestBodyAddress'OneOf1City = GHC.Maybe.Nothing, postCustomersRequestBodyAddress'OneOf1Country = GHC.Maybe.Nothing, postCustomersRequestBodyAddress'OneOf1Line1 = GHC.Maybe.Nothing, postCustomersRequestBodyAddress'OneOf1Line2 = GHC.Maybe.Nothing, postCustomersRequestBodyAddress'OneOf1PostalCode = GHC.Maybe.Nothing, postCustomersRequestBodyAddress'OneOf1State = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.address.anyOf@ in the specification. -- -- The customer\'s address. data PostCustomersRequestBodyAddress'Variants = -- | Represents the JSON value @""@ PostCustomersRequestBodyAddress'EmptyString | PostCustomersRequestBodyAddress'PostCustomersRequestBodyAddress'OneOf1 PostCustomersRequestBodyAddress'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyAddress'Variants where toJSON (PostCustomersRequestBodyAddress'PostCustomersRequestBodyAddress'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersRequestBodyAddress'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyAddress'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersRequestBodyAddress'EmptyString | GHC.Base.otherwise -> case (PostCustomersRequestBodyAddress'PostCustomersRequestBodyAddress'OneOf1 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.cash_balance@ in the specification. -- -- Balance information and default balance settings for this customer. data PostCustomersRequestBodyCashBalance' = PostCustomersRequestBodyCashBalance' { -- | settings postCustomersRequestBodyCashBalance'Settings :: (GHC.Maybe.Maybe PostCustomersRequestBodyCashBalance'Settings') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyCashBalance' where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("settings" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCashBalance'Settings 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.. ("settings" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCashBalance'Settings obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyCashBalance' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyCashBalance'" (\obj -> GHC.Base.pure PostCustomersRequestBodyCashBalance' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "settings")) -- | Create a new 'PostCustomersRequestBodyCashBalance'' with all required fields. mkPostCustomersRequestBodyCashBalance' :: PostCustomersRequestBodyCashBalance' mkPostCustomersRequestBodyCashBalance' = PostCustomersRequestBodyCashBalance' {postCustomersRequestBodyCashBalance'Settings = GHC.Maybe.Nothing} -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.cash_balance.properties.settings@ in the specification. data PostCustomersRequestBodyCashBalance'Settings' = PostCustomersRequestBodyCashBalance'Settings' { -- | reconciliation_mode postCustomersRequestBodyCashBalance'Settings'ReconciliationMode :: (GHC.Maybe.Maybe PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyCashBalance'Settings' where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("reconciliation_mode" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCashBalance'Settings'ReconciliationMode 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.. ("reconciliation_mode" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyCashBalance'Settings'ReconciliationMode obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyCashBalance'Settings' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyCashBalance'Settings'" (\obj -> GHC.Base.pure PostCustomersRequestBodyCashBalance'Settings' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "reconciliation_mode")) -- | Create a new 'PostCustomersRequestBodyCashBalance'Settings'' with all required fields. mkPostCustomersRequestBodyCashBalance'Settings' :: PostCustomersRequestBodyCashBalance'Settings' mkPostCustomersRequestBodyCashBalance'Settings' = PostCustomersRequestBodyCashBalance'Settings' {postCustomersRequestBodyCashBalance'Settings'ReconciliationMode = GHC.Maybe.Nothing} -- | Defines the enum schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.cash_balance.properties.settings.properties.reconciliation_mode@ in the specification. data PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'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. PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"automatic"@ PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'EnumAutomatic | -- | Represents the JSON value @"manual"@ PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'EnumManual deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode' where toJSON (PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'Other val) = val toJSON (PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'EnumAutomatic) = "automatic" toJSON (PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'EnumManual) = "manual" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "automatic" -> PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'EnumAutomatic | val GHC.Classes.== "manual" -> PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'EnumManual | GHC.Base.otherwise -> PostCustomersRequestBodyCashBalance'Settings'ReconciliationMode'Other val ) -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings@ in the specification. -- -- Default invoice settings for this customer. data PostCustomersRequestBodyInvoiceSettings' = PostCustomersRequestBodyInvoiceSettings' { -- | custom_fields postCustomersRequestBodyInvoiceSettings'CustomFields :: (GHC.Maybe.Maybe PostCustomersRequestBodyInvoiceSettings'CustomFields'Variants), -- | default_payment_method -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyInvoiceSettings'DefaultPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | footer -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyInvoiceSettings'Footer :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | rendering_options postCustomersRequestBodyInvoiceSettings'RenderingOptions :: (GHC.Maybe.Maybe PostCustomersRequestBodyInvoiceSettings'RenderingOptions'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyInvoiceSettings' where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("custom_fields" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'CustomFields obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("default_payment_method" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'DefaultPaymentMethod obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("footer" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'Footer obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("rendering_options" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'RenderingOptions 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.. ("custom_fields" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'CustomFields obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("default_payment_method" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'DefaultPaymentMethod obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("footer" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'Footer obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("rendering_options" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'RenderingOptions obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyInvoiceSettings' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyInvoiceSettings'" (\obj -> (((GHC.Base.pure PostCustomersRequestBodyInvoiceSettings' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "custom_fields")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "default_payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "footer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "rendering_options")) -- | Create a new 'PostCustomersRequestBodyInvoiceSettings'' with all required fields. mkPostCustomersRequestBodyInvoiceSettings' :: PostCustomersRequestBodyInvoiceSettings' mkPostCustomersRequestBodyInvoiceSettings' = PostCustomersRequestBodyInvoiceSettings' { postCustomersRequestBodyInvoiceSettings'CustomFields = GHC.Maybe.Nothing, postCustomersRequestBodyInvoiceSettings'DefaultPaymentMethod = GHC.Maybe.Nothing, postCustomersRequestBodyInvoiceSettings'Footer = GHC.Maybe.Nothing, postCustomersRequestBodyInvoiceSettings'RenderingOptions = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings.properties.custom_fields.anyOf.items@ in the specification. data PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 = PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 { -- | name -- -- Constraints: -- -- * Maximum length of 30 postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Name :: Data.Text.Internal.Text, -- | value -- -- Constraints: -- -- * Maximum length of 30 postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Value :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["name" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Name obj] : ["value" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Value obj] : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["name" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Name obj] : ["value" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Value obj] : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1" (\obj -> (GHC.Base.pure PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "value")) -- | Create a new 'PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1' with all required fields. mkPostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 :: -- | 'postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Name' Data.Text.Internal.Text -> -- | 'postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Value' Data.Text.Internal.Text -> PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 mkPostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Name postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Value = PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 { postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Name = postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Name, postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Value = postCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1Value } -- | Defines the oneOf schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings.properties.custom_fields.anyOf@ in the specification. data PostCustomersRequestBodyInvoiceSettings'CustomFields'Variants = -- | Represents the JSON value @""@ PostCustomersRequestBodyInvoiceSettings'CustomFields'EmptyString | PostCustomersRequestBodyInvoiceSettings'CustomFields'ListTPostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 ([PostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyInvoiceSettings'CustomFields'Variants where toJSON (PostCustomersRequestBodyInvoiceSettings'CustomFields'ListTPostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersRequestBodyInvoiceSettings'CustomFields'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyInvoiceSettings'CustomFields'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersRequestBodyInvoiceSettings'CustomFields'EmptyString | GHC.Base.otherwise -> case (PostCustomersRequestBodyInvoiceSettings'CustomFields'ListTPostCustomersRequestBodyInvoiceSettings'CustomFields'OneOf1 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings.properties.rendering_options.anyOf@ in the specification. data PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 = PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 { -- | amount_tax_display postCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay :: (GHC.Maybe.Maybe PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("amount_tax_display" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay 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.. ("amount_tax_display" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1" (\obj -> GHC.Base.pure PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "amount_tax_display")) -- | Create a new 'PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1' with all required fields. mkPostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 :: PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 mkPostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 = PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 {postCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay = GHC.Maybe.Nothing} -- | Defines the enum schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings.properties.rendering_options.anyOf.properties.amount_tax_display@ in the specification. data PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'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. PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'Typed Data.Text.Internal.Text | -- | Represents the JSON value @""@ PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumEmptyString | -- | Represents the JSON value @"exclude_tax"@ PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumExcludeTax | -- | Represents the JSON value @"include_inclusive_tax"@ PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumIncludeInclusiveTax deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay' where toJSON (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'Other val) = val toJSON (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumEmptyString) = "" toJSON (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumExcludeTax) = "exclude_tax" toJSON (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumIncludeInclusiveTax) = "include_inclusive_tax" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "" -> PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumEmptyString | val GHC.Classes.== "exclude_tax" -> PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumExcludeTax | val GHC.Classes.== "include_inclusive_tax" -> PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'EnumIncludeInclusiveTax | GHC.Base.otherwise -> PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1AmountTaxDisplay'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings.properties.rendering_options.anyOf@ in the specification. data PostCustomersRequestBodyInvoiceSettings'RenderingOptions'Variants = -- | Represents the JSON value @""@ PostCustomersRequestBodyInvoiceSettings'RenderingOptions'EmptyString | PostCustomersRequestBodyInvoiceSettings'RenderingOptions'PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyInvoiceSettings'RenderingOptions'Variants where toJSON (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyInvoiceSettings'RenderingOptions'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersRequestBodyInvoiceSettings'RenderingOptions'EmptyString | GHC.Base.otherwise -> case (PostCustomersRequestBodyInvoiceSettings'RenderingOptions'PostCustomersRequestBodyInvoiceSettings'RenderingOptions'OneOf1 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the oneOf schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.metadata.anyOf@ in the specification. -- -- Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \`metadata\`. data PostCustomersRequestBodyMetadata'Variants = -- | Represents the JSON value @""@ PostCustomersRequestBodyMetadata'EmptyString | PostCustomersRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyMetadata'Variants where toJSON (PostCustomersRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersRequestBodyMetadata'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyMetadata'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersRequestBodyMetadata'EmptyString | GHC.Base.otherwise -> case (PostCustomersRequestBodyMetadata'Object Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.shipping.anyOf@ in the specification. data PostCustomersRequestBodyShipping'OneOf1 = PostCustomersRequestBodyShipping'OneOf1 { -- | address postCustomersRequestBodyShipping'OneOf1Address :: PostCustomersRequestBodyShipping'OneOf1Address', -- | name -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Name :: Data.Text.Internal.Text, -- | phone -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Phone :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyShipping'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["address" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyShipping'OneOf1Address obj] : ["name" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyShipping'OneOf1Name obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Phone obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["address" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyShipping'OneOf1Address obj] : ["name" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyShipping'OneOf1Name obj] : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("phone" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Phone obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyShipping'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyShipping'OneOf1" (\obj -> ((GHC.Base.pure PostCustomersRequestBodyShipping'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "phone")) -- | Create a new 'PostCustomersRequestBodyShipping'OneOf1' with all required fields. mkPostCustomersRequestBodyShipping'OneOf1 :: -- | 'postCustomersRequestBodyShipping'OneOf1Address' PostCustomersRequestBodyShipping'OneOf1Address' -> -- | 'postCustomersRequestBodyShipping'OneOf1Name' Data.Text.Internal.Text -> PostCustomersRequestBodyShipping'OneOf1 mkPostCustomersRequestBodyShipping'OneOf1 postCustomersRequestBodyShipping'OneOf1Address postCustomersRequestBodyShipping'OneOf1Name = PostCustomersRequestBodyShipping'OneOf1 { postCustomersRequestBodyShipping'OneOf1Address = postCustomersRequestBodyShipping'OneOf1Address, postCustomersRequestBodyShipping'OneOf1Name = postCustomersRequestBodyShipping'OneOf1Name, postCustomersRequestBodyShipping'OneOf1Phone = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.shipping.anyOf.properties.address@ in the specification. data PostCustomersRequestBodyShipping'OneOf1Address' = PostCustomersRequestBodyShipping'OneOf1Address' { -- | city -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Address'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | country -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Address'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | line1 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Address'Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | line2 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Address'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | postal_code -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Address'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | state -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyShipping'OneOf1Address'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyShipping'OneOf1Address' 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..=)) (postCustomersRequestBodyShipping'OneOf1Address'City obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'Country obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'Line1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'Line2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'PostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'State 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..=)) (postCustomersRequestBodyShipping'OneOf1Address'City obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("country" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'Country obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line1" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'Line1 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("line2" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'Line2 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("postal_code" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'PostalCode obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("state" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyShipping'OneOf1Address'State obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyShipping'OneOf1Address' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyShipping'OneOf1Address'" (\obj -> (((((GHC.Base.pure PostCustomersRequestBodyShipping'OneOf1Address' 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 'PostCustomersRequestBodyShipping'OneOf1Address'' with all required fields. mkPostCustomersRequestBodyShipping'OneOf1Address' :: PostCustomersRequestBodyShipping'OneOf1Address' mkPostCustomersRequestBodyShipping'OneOf1Address' = PostCustomersRequestBodyShipping'OneOf1Address' { postCustomersRequestBodyShipping'OneOf1Address'City = GHC.Maybe.Nothing, postCustomersRequestBodyShipping'OneOf1Address'Country = GHC.Maybe.Nothing, postCustomersRequestBodyShipping'OneOf1Address'Line1 = GHC.Maybe.Nothing, postCustomersRequestBodyShipping'OneOf1Address'Line2 = GHC.Maybe.Nothing, postCustomersRequestBodyShipping'OneOf1Address'PostalCode = GHC.Maybe.Nothing, postCustomersRequestBodyShipping'OneOf1Address'State = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.shipping.anyOf@ in the specification. -- -- The customer\'s shipping information. Appears on invoices emailed to this customer. data PostCustomersRequestBodyShipping'Variants = -- | Represents the JSON value @""@ PostCustomersRequestBodyShipping'EmptyString | PostCustomersRequestBodyShipping'PostCustomersRequestBodyShipping'OneOf1 PostCustomersRequestBodyShipping'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyShipping'Variants where toJSON (PostCustomersRequestBodyShipping'PostCustomersRequestBodyShipping'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersRequestBodyShipping'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyShipping'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersRequestBodyShipping'EmptyString | GHC.Base.otherwise -> case (PostCustomersRequestBodyShipping'PostCustomersRequestBodyShipping'OneOf1 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax@ in the specification. -- -- Tax details about the customer. data PostCustomersRequestBodyTax' = PostCustomersRequestBodyTax' { -- | ip_address postCustomersRequestBodyTax'IpAddress :: (GHC.Maybe.Maybe PostCustomersRequestBodyTax'IpAddress'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyTax' where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("ip_address" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTax'IpAddress 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.. ("ip_address" Data.Aeson.Types.ToJSON..=)) (postCustomersRequestBodyTax'IpAddress obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyTax' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyTax'" (\obj -> GHC.Base.pure PostCustomersRequestBodyTax' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "ip_address")) -- | Create a new 'PostCustomersRequestBodyTax'' with all required fields. mkPostCustomersRequestBodyTax' :: PostCustomersRequestBodyTax' mkPostCustomersRequestBodyTax' = PostCustomersRequestBodyTax' {postCustomersRequestBodyTax'IpAddress = GHC.Maybe.Nothing} -- | Defines the oneOf schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax.properties.ip_address.anyOf@ in the specification. data PostCustomersRequestBodyTax'IpAddress'Variants = -- | Represents the JSON value @""@ PostCustomersRequestBodyTax'IpAddress'EmptyString | PostCustomersRequestBodyTax'IpAddress'Text Data.Text.Internal.Text deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyTax'IpAddress'Variants where toJSON (PostCustomersRequestBodyTax'IpAddress'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersRequestBodyTax'IpAddress'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyTax'IpAddress'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersRequestBodyTax'IpAddress'EmptyString | GHC.Base.otherwise -> case (PostCustomersRequestBodyTax'IpAddress'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched" of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a -- | Defines the enum schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax_exempt@ in the specification. -- -- The customer\'s tax exemption. One of \`none\`, \`exempt\`, or \`reverse\`. data PostCustomersRequestBodyTaxExempt' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersRequestBodyTaxExempt'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. PostCustomersRequestBodyTaxExempt'Typed Data.Text.Internal.Text | -- | Represents the JSON value @""@ PostCustomersRequestBodyTaxExempt'EnumEmptyString | -- | Represents the JSON value @"exempt"@ PostCustomersRequestBodyTaxExempt'EnumExempt | -- | Represents the JSON value @"none"@ PostCustomersRequestBodyTaxExempt'EnumNone | -- | Represents the JSON value @"reverse"@ PostCustomersRequestBodyTaxExempt'EnumReverse deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyTaxExempt' where toJSON (PostCustomersRequestBodyTaxExempt'Other val) = val toJSON (PostCustomersRequestBodyTaxExempt'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersRequestBodyTaxExempt'EnumEmptyString) = "" toJSON (PostCustomersRequestBodyTaxExempt'EnumExempt) = "exempt" toJSON (PostCustomersRequestBodyTaxExempt'EnumNone) = "none" toJSON (PostCustomersRequestBodyTaxExempt'EnumReverse) = "reverse" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyTaxExempt' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "" -> PostCustomersRequestBodyTaxExempt'EnumEmptyString | val GHC.Classes.== "exempt" -> PostCustomersRequestBodyTaxExempt'EnumExempt | val GHC.Classes.== "none" -> PostCustomersRequestBodyTaxExempt'EnumNone | val GHC.Classes.== "reverse" -> PostCustomersRequestBodyTaxExempt'EnumReverse | GHC.Base.otherwise -> PostCustomersRequestBodyTaxExempt'Other val ) -- | Defines the object schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax_id_data.items@ in the specification. data PostCustomersRequestBodyTaxIdData' = PostCustomersRequestBodyTaxIdData' { -- | type -- -- Constraints: -- -- * Maximum length of 5000 postCustomersRequestBodyTaxIdData'Type :: PostCustomersRequestBodyTaxIdData'Type', -- | value postCustomersRequestBodyTaxIdData'Value :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyTaxIdData' where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (["type" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyTaxIdData'Type obj] : ["value" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyTaxIdData'Value obj] : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (["type" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyTaxIdData'Type obj] : ["value" Data.Aeson.Types.ToJSON..= postCustomersRequestBodyTaxIdData'Value obj] : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyTaxIdData' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersRequestBodyTaxIdData'" (\obj -> (GHC.Base.pure PostCustomersRequestBodyTaxIdData' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "value")) -- | Create a new 'PostCustomersRequestBodyTaxIdData'' with all required fields. mkPostCustomersRequestBodyTaxIdData' :: -- | 'postCustomersRequestBodyTaxIdData'Type' PostCustomersRequestBodyTaxIdData'Type' -> -- | 'postCustomersRequestBodyTaxIdData'Value' Data.Text.Internal.Text -> PostCustomersRequestBodyTaxIdData' mkPostCustomersRequestBodyTaxIdData' postCustomersRequestBodyTaxIdData'Type postCustomersRequestBodyTaxIdData'Value = PostCustomersRequestBodyTaxIdData' { postCustomersRequestBodyTaxIdData'Type = postCustomersRequestBodyTaxIdData'Type, postCustomersRequestBodyTaxIdData'Value = postCustomersRequestBodyTaxIdData'Value } -- | Defines the enum schema located at @paths.\/v1\/customers.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax_id_data.items.properties.type@ in the specification. data PostCustomersRequestBodyTaxIdData'Type' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersRequestBodyTaxIdData'Type'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. PostCustomersRequestBodyTaxIdData'Type'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"ae_trn"@ PostCustomersRequestBodyTaxIdData'Type'EnumAeTrn | -- | Represents the JSON value @"au_abn"@ PostCustomersRequestBodyTaxIdData'Type'EnumAuAbn | -- | Represents the JSON value @"au_arn"@ PostCustomersRequestBodyTaxIdData'Type'EnumAuArn | -- | Represents the JSON value @"bg_uic"@ PostCustomersRequestBodyTaxIdData'Type'EnumBgUic | -- | Represents the JSON value @"br_cnpj"@ PostCustomersRequestBodyTaxIdData'Type'EnumBrCnpj | -- | Represents the JSON value @"br_cpf"@ PostCustomersRequestBodyTaxIdData'Type'EnumBrCpf | -- | Represents the JSON value @"ca_bn"@ PostCustomersRequestBodyTaxIdData'Type'EnumCaBn | -- | Represents the JSON value @"ca_gst_hst"@ PostCustomersRequestBodyTaxIdData'Type'EnumCaGstHst | -- | Represents the JSON value @"ca_pst_bc"@ PostCustomersRequestBodyTaxIdData'Type'EnumCaPstBc | -- | Represents the JSON value @"ca_pst_mb"@ PostCustomersRequestBodyTaxIdData'Type'EnumCaPstMb | -- | Represents the JSON value @"ca_pst_sk"@ PostCustomersRequestBodyTaxIdData'Type'EnumCaPstSk | -- | Represents the JSON value @"ca_qst"@ PostCustomersRequestBodyTaxIdData'Type'EnumCaQst | -- | Represents the JSON value @"ch_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumChVat | -- | Represents the JSON value @"cl_tin"@ PostCustomersRequestBodyTaxIdData'Type'EnumClTin | -- | Represents the JSON value @"es_cif"@ PostCustomersRequestBodyTaxIdData'Type'EnumEsCif | -- | Represents the JSON value @"eu_oss_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumEuOssVat | -- | Represents the JSON value @"eu_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumEuVat | -- | Represents the JSON value @"gb_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumGbVat | -- | Represents the JSON value @"ge_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumGeVat | -- | Represents the JSON value @"hk_br"@ PostCustomersRequestBodyTaxIdData'Type'EnumHkBr | -- | Represents the JSON value @"hu_tin"@ PostCustomersRequestBodyTaxIdData'Type'EnumHuTin | -- | Represents the JSON value @"id_npwp"@ PostCustomersRequestBodyTaxIdData'Type'EnumIdNpwp | -- | Represents the JSON value @"il_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumIlVat | -- | Represents the JSON value @"in_gst"@ PostCustomersRequestBodyTaxIdData'Type'EnumInGst | -- | Represents the JSON value @"is_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumIsVat | -- | Represents the JSON value @"jp_cn"@ PostCustomersRequestBodyTaxIdData'Type'EnumJpCn | -- | Represents the JSON value @"jp_rn"@ PostCustomersRequestBodyTaxIdData'Type'EnumJpRn | -- | Represents the JSON value @"kr_brn"@ PostCustomersRequestBodyTaxIdData'Type'EnumKrBrn | -- | Represents the JSON value @"li_uid"@ PostCustomersRequestBodyTaxIdData'Type'EnumLiUid | -- | Represents the JSON value @"mx_rfc"@ PostCustomersRequestBodyTaxIdData'Type'EnumMxRfc | -- | Represents the JSON value @"my_frp"@ PostCustomersRequestBodyTaxIdData'Type'EnumMyFrp | -- | Represents the JSON value @"my_itn"@ PostCustomersRequestBodyTaxIdData'Type'EnumMyItn | -- | Represents the JSON value @"my_sst"@ PostCustomersRequestBodyTaxIdData'Type'EnumMySst | -- | Represents the JSON value @"no_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumNoVat | -- | Represents the JSON value @"nz_gst"@ PostCustomersRequestBodyTaxIdData'Type'EnumNzGst | -- | Represents the JSON value @"ru_inn"@ PostCustomersRequestBodyTaxIdData'Type'EnumRuInn | -- | Represents the JSON value @"ru_kpp"@ PostCustomersRequestBodyTaxIdData'Type'EnumRuKpp | -- | Represents the JSON value @"sa_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumSaVat | -- | Represents the JSON value @"sg_gst"@ PostCustomersRequestBodyTaxIdData'Type'EnumSgGst | -- | Represents the JSON value @"sg_uen"@ PostCustomersRequestBodyTaxIdData'Type'EnumSgUen | -- | Represents the JSON value @"si_tin"@ PostCustomersRequestBodyTaxIdData'Type'EnumSiTin | -- | Represents the JSON value @"th_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumThVat | -- | Represents the JSON value @"tw_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumTwVat | -- | Represents the JSON value @"ua_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumUaVat | -- | Represents the JSON value @"us_ein"@ PostCustomersRequestBodyTaxIdData'Type'EnumUsEin | -- | Represents the JSON value @"za_vat"@ PostCustomersRequestBodyTaxIdData'Type'EnumZaVat deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersRequestBodyTaxIdData'Type' where toJSON (PostCustomersRequestBodyTaxIdData'Type'Other val) = val toJSON (PostCustomersRequestBodyTaxIdData'Type'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumAeTrn) = "ae_trn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumAuAbn) = "au_abn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumAuArn) = "au_arn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumBgUic) = "bg_uic" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumBrCnpj) = "br_cnpj" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumBrCpf) = "br_cpf" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumCaBn) = "ca_bn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumCaGstHst) = "ca_gst_hst" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumCaPstBc) = "ca_pst_bc" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumCaPstMb) = "ca_pst_mb" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumCaPstSk) = "ca_pst_sk" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumCaQst) = "ca_qst" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumChVat) = "ch_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumClTin) = "cl_tin" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumEsCif) = "es_cif" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumEuOssVat) = "eu_oss_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumEuVat) = "eu_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumGbVat) = "gb_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumGeVat) = "ge_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumHkBr) = "hk_br" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumHuTin) = "hu_tin" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumIdNpwp) = "id_npwp" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumIlVat) = "il_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumInGst) = "in_gst" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumIsVat) = "is_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumJpCn) = "jp_cn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumJpRn) = "jp_rn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumKrBrn) = "kr_brn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumLiUid) = "li_uid" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumMxRfc) = "mx_rfc" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumMyFrp) = "my_frp" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumMyItn) = "my_itn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumMySst) = "my_sst" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumNoVat) = "no_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumNzGst) = "nz_gst" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumRuInn) = "ru_inn" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumRuKpp) = "ru_kpp" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumSaVat) = "sa_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumSgGst) = "sg_gst" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumSgUen) = "sg_uen" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumSiTin) = "si_tin" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumThVat) = "th_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumTwVat) = "tw_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumUaVat) = "ua_vat" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumUsEin) = "us_ein" toJSON (PostCustomersRequestBodyTaxIdData'Type'EnumZaVat) = "za_vat" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersRequestBodyTaxIdData'Type' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "ae_trn" -> PostCustomersRequestBodyTaxIdData'Type'EnumAeTrn | val GHC.Classes.== "au_abn" -> PostCustomersRequestBodyTaxIdData'Type'EnumAuAbn | val GHC.Classes.== "au_arn" -> PostCustomersRequestBodyTaxIdData'Type'EnumAuArn | val GHC.Classes.== "bg_uic" -> PostCustomersRequestBodyTaxIdData'Type'EnumBgUic | val GHC.Classes.== "br_cnpj" -> PostCustomersRequestBodyTaxIdData'Type'EnumBrCnpj | val GHC.Classes.== "br_cpf" -> PostCustomersRequestBodyTaxIdData'Type'EnumBrCpf | val GHC.Classes.== "ca_bn" -> PostCustomersRequestBodyTaxIdData'Type'EnumCaBn | val GHC.Classes.== "ca_gst_hst" -> PostCustomersRequestBodyTaxIdData'Type'EnumCaGstHst | val GHC.Classes.== "ca_pst_bc" -> PostCustomersRequestBodyTaxIdData'Type'EnumCaPstBc | val GHC.Classes.== "ca_pst_mb" -> PostCustomersRequestBodyTaxIdData'Type'EnumCaPstMb | val GHC.Classes.== "ca_pst_sk" -> PostCustomersRequestBodyTaxIdData'Type'EnumCaPstSk | val GHC.Classes.== "ca_qst" -> PostCustomersRequestBodyTaxIdData'Type'EnumCaQst | val GHC.Classes.== "ch_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumChVat | val GHC.Classes.== "cl_tin" -> PostCustomersRequestBodyTaxIdData'Type'EnumClTin | val GHC.Classes.== "es_cif" -> PostCustomersRequestBodyTaxIdData'Type'EnumEsCif | val GHC.Classes.== "eu_oss_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumEuOssVat | val GHC.Classes.== "eu_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumEuVat | val GHC.Classes.== "gb_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumGbVat | val GHC.Classes.== "ge_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumGeVat | val GHC.Classes.== "hk_br" -> PostCustomersRequestBodyTaxIdData'Type'EnumHkBr | val GHC.Classes.== "hu_tin" -> PostCustomersRequestBodyTaxIdData'Type'EnumHuTin | val GHC.Classes.== "id_npwp" -> PostCustomersRequestBodyTaxIdData'Type'EnumIdNpwp | val GHC.Classes.== "il_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumIlVat | val GHC.Classes.== "in_gst" -> PostCustomersRequestBodyTaxIdData'Type'EnumInGst | val GHC.Classes.== "is_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumIsVat | val GHC.Classes.== "jp_cn" -> PostCustomersRequestBodyTaxIdData'Type'EnumJpCn | val GHC.Classes.== "jp_rn" -> PostCustomersRequestBodyTaxIdData'Type'EnumJpRn | val GHC.Classes.== "kr_brn" -> PostCustomersRequestBodyTaxIdData'Type'EnumKrBrn | val GHC.Classes.== "li_uid" -> PostCustomersRequestBodyTaxIdData'Type'EnumLiUid | val GHC.Classes.== "mx_rfc" -> PostCustomersRequestBodyTaxIdData'Type'EnumMxRfc | val GHC.Classes.== "my_frp" -> PostCustomersRequestBodyTaxIdData'Type'EnumMyFrp | val GHC.Classes.== "my_itn" -> PostCustomersRequestBodyTaxIdData'Type'EnumMyItn | val GHC.Classes.== "my_sst" -> PostCustomersRequestBodyTaxIdData'Type'EnumMySst | val GHC.Classes.== "no_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumNoVat | val GHC.Classes.== "nz_gst" -> PostCustomersRequestBodyTaxIdData'Type'EnumNzGst | val GHC.Classes.== "ru_inn" -> PostCustomersRequestBodyTaxIdData'Type'EnumRuInn | val GHC.Classes.== "ru_kpp" -> PostCustomersRequestBodyTaxIdData'Type'EnumRuKpp | val GHC.Classes.== "sa_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumSaVat | val GHC.Classes.== "sg_gst" -> PostCustomersRequestBodyTaxIdData'Type'EnumSgGst | val GHC.Classes.== "sg_uen" -> PostCustomersRequestBodyTaxIdData'Type'EnumSgUen | val GHC.Classes.== "si_tin" -> PostCustomersRequestBodyTaxIdData'Type'EnumSiTin | val GHC.Classes.== "th_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumThVat | val GHC.Classes.== "tw_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumTwVat | val GHC.Classes.== "ua_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumUaVat | val GHC.Classes.== "us_ein" -> PostCustomersRequestBodyTaxIdData'Type'EnumUsEin | val GHC.Classes.== "za_vat" -> PostCustomersRequestBodyTaxIdData'Type'EnumZaVat | GHC.Base.otherwise -> PostCustomersRequestBodyTaxIdData'Type'Other val ) -- | Represents a response of the operation 'postCustomers'. -- -- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'PostCustomersResponseError' is used. data PostCustomersResponse = -- | Means either no matching case available or a parse error PostCustomersResponseError GHC.Base.String | -- | Successful response. PostCustomersResponse200 Customer | -- | Error response. PostCustomersResponseDefault Error deriving (GHC.Show.Show, GHC.Classes.Eq)