{-# 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 postCustomersCustomer module StripeAPI.Operations.PostCustomersCustomer 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.Functor import qualified Data.Scientific import qualified Data.Text import qualified Data.Text.Internal import qualified Data.Time.Calendar as Data.Time.Calendar.Days import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime import qualified 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/{customer} -- -- \

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the \source\<\/strong> parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the \source\<\/strong> parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the \past_due\<\/code> state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the \default_source\<\/strong> for a customer will not trigger this behavior.\<\/p> -- -- \

This request accepts mostly the same arguments as the customer creation call.\<\/p> postCustomersCustomer :: forall m. StripeAPI.Common.MonadHTTP m => -- | customer | Constraints: Maximum length of 5000 Data.Text.Internal.Text -> -- | The request body to send GHC.Maybe.Maybe PostCustomersCustomerRequestBody -> -- | Monadic computation which returns the result of the operation StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostCustomersCustomerResponse) postCustomersCustomer customer body = GHC.Base.fmap ( \response_0 -> GHC.Base.fmap ( Data.Either.either PostCustomersCustomerResponseError 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) -> PostCustomersCustomerResponse200 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) -> PostCustomersCustomerResponseDefault 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.++ (Data.ByteString.Char8.unpack (Network.HTTP.Types.URI.urlEncode GHC.Types.True GHC.Base.$ (Data.ByteString.Char8.pack GHC.Base.$ StripeAPI.Common.stringifyModel customer)) GHC.Base.++ ""))) GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData) -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification. data PostCustomersCustomerRequestBody = PostCustomersCustomerRequestBody { -- | address: The customer\'s address. postCustomersCustomerRequestBodyAddress :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyAddress'Variants), -- | balance: An integer amount in %s 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. postCustomersCustomerRequestBodyBalance :: (GHC.Maybe.Maybe GHC.Types.Int), -- | bank_account: Either a token, like the ones returned by [Stripe.js](https:\/\/stripe.com\/docs\/stripe.js), or a dictionary containing a user\'s bank account details. postCustomersCustomerRequestBodyBankAccount :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyBankAccount'Variants), -- | card: A token, like the ones returned by [Stripe.js](https:\/\/stripe.com\/docs\/stripe.js). postCustomersCustomerRequestBodyCard :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyCard'Variants), -- | coupon -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCoupon :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_alipay_account: ID of Alipay account to make the customer\'s new default for invoice payments. -- -- Constraints: -- -- * Maximum length of 500 postCustomersCustomerRequestBodyDefaultAlipayAccount :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_bank_account: ID of bank account to make the customer\'s new default for invoice payments. -- -- Constraints: -- -- * Maximum length of 500 postCustomersCustomerRequestBodyDefaultBankAccount :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_card: ID of card to make the customer\'s new default for invoice payments. -- -- Constraints: -- -- * Maximum length of 500 postCustomersCustomerRequestBodyDefaultCard :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | default_source: If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https:\/\/stripe.com\/docs\/api\/customers\/update\#update_customer-invoice_settings-default_payment_method) parameter. -- -- Provide the ID of a payment source already attached to this customer to make it this customer\'s default payment source. -- -- If you want to add a new payment source and make it the default, see the [source](https:\/\/stripe.com\/docs\/api\/customers\/update\#update_customer-source) property. -- -- Constraints: -- -- * Maximum length of 500 postCustomersCustomerRequestBodyDefaultSource :: (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 postCustomersCustomerRequestBodyDescription :: (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 postCustomersCustomerRequestBodyEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | expand: Specifies which fields in the response should be expanded. postCustomersCustomerRequestBodyExpand :: (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 postCustomersCustomerRequestBodyInvoicePrefix :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | invoice_settings: Default invoice settings for this customer. postCustomersCustomerRequestBodyInvoiceSettings :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyInvoiceSettings'), -- | 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\`. postCustomersCustomerRequestBodyMetadata :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyMetadata'Variants), -- | name: The customer\'s full name or business name. -- -- Constraints: -- -- * Maximum length of 256 postCustomersCustomerRequestBodyName :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | next_invoice_sequence: The sequence to be used on the customer\'s next invoice. Defaults to 1. postCustomersCustomerRequestBodyNextInvoiceSequence :: (GHC.Maybe.Maybe GHC.Types.Int), -- | phone: The customer\'s phone number. -- -- Constraints: -- -- * Maximum length of 20 postCustomersCustomerRequestBodyPhone :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | preferred_locales: Customer\'s preferred languages, ordered by preference. postCustomersCustomerRequestBodyPreferredLocales :: (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 postCustomersCustomerRequestBodyPromotionCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | shipping: The customer\'s shipping information. Appears on invoices emailed to this customer. postCustomersCustomerRequestBodyShipping :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyShipping'Variants), -- | source -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodySource :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | tax: Tax details about the customer. postCustomersCustomerRequestBodyTax :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyTax'), -- | tax_exempt: The customer\'s tax exemption. One of \`none\`, \`exempt\`, or \`reverse\`. postCustomersCustomerRequestBodyTaxExempt :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyTaxExempt'), -- | trial_end: Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value \`now\` can be provided to end the customer\'s trial immediately. Can be at most two years from \`billing_cycle_anchor\`. postCustomersCustomerRequestBodyTrialEnd :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyTrialEnd'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBody where toJSON obj = Data.Aeson.Types.Internal.object ("address" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress obj : "balance" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBalance obj : "bank_account" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount obj : "card" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard obj : "coupon" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCoupon obj : "default_alipay_account" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultAlipayAccount obj : "default_bank_account" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultBankAccount obj : "default_card" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultCard obj : "default_source" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultSource obj : "description" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDescription obj : "email" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyEmail obj : "expand" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyExpand obj : "invoice_prefix" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoicePrefix obj : "invoice_settings" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings obj : "metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyMetadata obj : "name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyName obj : "next_invoice_sequence" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyNextInvoiceSequence obj : "phone" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyPhone obj : "preferred_locales" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyPreferredLocales obj : "promotion_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyPromotionCode obj : "shipping" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping obj : "source" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodySource obj : "tax" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTax obj : "tax_exempt" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTaxExempt obj : "trial_end" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTrialEnd obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("address" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress obj) GHC.Base.<> (("balance" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBalance obj) GHC.Base.<> (("bank_account" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount obj) GHC.Base.<> (("card" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard obj) GHC.Base.<> (("coupon" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCoupon obj) GHC.Base.<> (("default_alipay_account" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultAlipayAccount obj) GHC.Base.<> (("default_bank_account" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultBankAccount obj) GHC.Base.<> (("default_card" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultCard obj) GHC.Base.<> (("default_source" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDefaultSource obj) GHC.Base.<> (("description" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyDescription obj) GHC.Base.<> (("email" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyEmail obj) GHC.Base.<> (("expand" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyExpand obj) GHC.Base.<> (("invoice_prefix" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoicePrefix obj) GHC.Base.<> (("invoice_settings" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyMetadata obj) GHC.Base.<> (("name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyName obj) GHC.Base.<> (("next_invoice_sequence" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyNextInvoiceSequence obj) GHC.Base.<> (("phone" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyPhone obj) GHC.Base.<> (("preferred_locales" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyPreferredLocales obj) GHC.Base.<> (("promotion_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyPromotionCode obj) GHC.Base.<> (("shipping" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping obj) GHC.Base.<> (("source" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodySource obj) GHC.Base.<> (("tax" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTax obj) GHC.Base.<> (("tax_exempt" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTaxExempt obj) GHC.Base.<> ("trial_end" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTrialEnd obj))))))))))))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBody where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBody" (\obj -> ((((((((((((((((((((((((GHC.Base.pure PostCustomersCustomerRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "balance")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bank_account")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "card")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "coupon")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_alipay_account")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_bank_account")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_card")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_source")) 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..:? "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..:? "trial_end")) -- | Create a new 'PostCustomersCustomerRequestBody' with all required fields. mkPostCustomersCustomerRequestBody :: PostCustomersCustomerRequestBody mkPostCustomersCustomerRequestBody = PostCustomersCustomerRequestBody { postCustomersCustomerRequestBodyAddress = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyBalance = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyBankAccount = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCoupon = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyDefaultAlipayAccount = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyDefaultBankAccount = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyDefaultCard = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyDefaultSource = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyDescription = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyEmail = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyExpand = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyInvoicePrefix = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyInvoiceSettings = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyMetadata = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyName = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyNextInvoiceSequence = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyPhone = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyPreferredLocales = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyPromotionCode = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyShipping = GHC.Maybe.Nothing, postCustomersCustomerRequestBodySource = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyTax = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyTaxExempt = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyTrialEnd = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.address.anyOf@ in the specification. data PostCustomersCustomerRequestBodyAddress'OneOf1 = PostCustomersCustomerRequestBodyAddress'OneOf1 { -- | city -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyAddress'OneOf1City :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | country -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyAddress'OneOf1Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | line1 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyAddress'OneOf1Line1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | line2 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyAddress'OneOf1Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | postal_code -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyAddress'OneOf1PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | state -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyAddress'OneOf1State :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyAddress'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("city" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1City obj : "country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1Country obj : "line1" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1Line1 obj : "line2" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1Line2 obj : "postal_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1PostalCode obj : "state" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1State obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("city" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1City obj) GHC.Base.<> (("country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1Country obj) GHC.Base.<> (("line1" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1Line1 obj) GHC.Base.<> (("line2" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1Line2 obj) GHC.Base.<> (("postal_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1PostalCode obj) GHC.Base.<> ("state" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyAddress'OneOf1State obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyAddress'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyAddress'OneOf1" (\obj -> (((((GHC.Base.pure PostCustomersCustomerRequestBodyAddress'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 'PostCustomersCustomerRequestBodyAddress'OneOf1' with all required fields. mkPostCustomersCustomerRequestBodyAddress'OneOf1 :: PostCustomersCustomerRequestBodyAddress'OneOf1 mkPostCustomersCustomerRequestBodyAddress'OneOf1 = PostCustomersCustomerRequestBodyAddress'OneOf1 { postCustomersCustomerRequestBodyAddress'OneOf1City = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyAddress'OneOf1Country = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyAddress'OneOf1Line1 = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyAddress'OneOf1Line2 = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyAddress'OneOf1PostalCode = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyAddress'OneOf1State = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.address.anyOf@ in the specification. -- -- The customer\'s address. data PostCustomersCustomerRequestBodyAddress'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerRequestBodyAddress'EmptyString | PostCustomersCustomerRequestBodyAddress'PostCustomersCustomerRequestBodyAddress'OneOf1 PostCustomersCustomerRequestBodyAddress'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyAddress'Variants where toJSON (PostCustomersCustomerRequestBodyAddress'PostCustomersCustomerRequestBodyAddress'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyAddress'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyAddress'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerRequestBodyAddress'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerRequestBodyAddress'PostCustomersCustomerRequestBodyAddress'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\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.bank_account.anyOf@ in the specification. data PostCustomersCustomerRequestBodyBankAccount'OneOf1 = PostCustomersCustomerRequestBodyBankAccount'OneOf1 { -- | account_holder_name -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderName :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | account_holder_type -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'), -- | account_number -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyBankAccount'OneOf1AccountNumber :: Data.Text.Internal.Text, -- | country -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyBankAccount'OneOf1Country :: Data.Text.Internal.Text, -- | currency postCustomersCustomerRequestBodyBankAccount'OneOf1Currency :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | object -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyBankAccount'OneOf1Object :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'), -- | routing_number -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyBankAccount'OneOf1RoutingNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyBankAccount'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("account_holder_name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderName obj : "account_holder_type" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType obj : "account_number" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1AccountNumber obj : "country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1Country obj : "currency" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1Currency obj : "object" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1Object obj : "routing_number" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1RoutingNumber obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("account_holder_name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderName obj) GHC.Base.<> (("account_holder_type" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType obj) GHC.Base.<> (("account_number" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1AccountNumber obj) GHC.Base.<> (("country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1Country obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1Currency obj) GHC.Base.<> (("object" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1Object obj) GHC.Base.<> ("routing_number" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyBankAccount'OneOf1RoutingNumber obj))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyBankAccount'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyBankAccount'OneOf1" (\obj -> ((((((GHC.Base.pure PostCustomersCustomerRequestBodyBankAccount'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "account_holder_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "account_holder_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "account_number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "country")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "object")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "routing_number")) -- | Create a new 'PostCustomersCustomerRequestBodyBankAccount'OneOf1' with all required fields. mkPostCustomersCustomerRequestBodyBankAccount'OneOf1 :: -- | 'postCustomersCustomerRequestBodyBankAccount'OneOf1AccountNumber' Data.Text.Internal.Text -> -- | 'postCustomersCustomerRequestBodyBankAccount'OneOf1Country' Data.Text.Internal.Text -> PostCustomersCustomerRequestBodyBankAccount'OneOf1 mkPostCustomersCustomerRequestBodyBankAccount'OneOf1 postCustomersCustomerRequestBodyBankAccount'OneOf1AccountNumber postCustomersCustomerRequestBodyBankAccount'OneOf1Country = PostCustomersCustomerRequestBodyBankAccount'OneOf1 { postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderName = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyBankAccount'OneOf1AccountNumber = postCustomersCustomerRequestBodyBankAccount'OneOf1AccountNumber, postCustomersCustomerRequestBodyBankAccount'OneOf1Country = postCustomersCustomerRequestBodyBankAccount'OneOf1Country, postCustomersCustomerRequestBodyBankAccount'OneOf1Currency = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyBankAccount'OneOf1Object = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyBankAccount'OneOf1RoutingNumber = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.bank_account.anyOf.properties.account_holder_type@ in the specification. data PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'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. PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"company"@ PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'EnumCompany | -- | Represents the JSON value @"individual"@ PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'EnumIndividual deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType' where toJSON (PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'Other val) = val toJSON (PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'EnumCompany) = "company" toJSON (PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'EnumIndividual) = "individual" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "company" -> PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'EnumCompany | val GHC.Classes.== "individual" -> PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'EnumIndividual | GHC.Base.otherwise -> PostCustomersCustomerRequestBodyBankAccount'OneOf1AccountHolderType'Other val ) -- | Defines the enum schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.bank_account.anyOf.properties.object@ in the specification. data PostCustomersCustomerRequestBodyBankAccount'OneOf1Object' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'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. PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"bank_account"@ PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'EnumBankAccount deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyBankAccount'OneOf1Object' where toJSON (PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'Other val) = val toJSON (PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'EnumBankAccount) = "bank_account" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyBankAccount'OneOf1Object' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "bank_account" -> PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'EnumBankAccount | GHC.Base.otherwise -> PostCustomersCustomerRequestBodyBankAccount'OneOf1Object'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.bank_account.anyOf@ in the specification. -- -- Either a token, like the ones returned by [Stripe.js](https:\/\/stripe.com\/docs\/stripe.js), or a dictionary containing a user\'s bank account details. data PostCustomersCustomerRequestBodyBankAccount'Variants = PostCustomersCustomerRequestBodyBankAccount'PostCustomersCustomerRequestBodyBankAccount'OneOf1 PostCustomersCustomerRequestBodyBankAccount'OneOf1 | PostCustomersCustomerRequestBodyBankAccount'Text Data.Text.Internal.Text deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyBankAccount'Variants where toJSON (PostCustomersCustomerRequestBodyBankAccount'PostCustomersCustomerRequestBodyBankAccount'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyBankAccount'Text a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyBankAccount'Variants where parseJSON val = case (PostCustomersCustomerRequestBodyBankAccount'PostCustomersCustomerRequestBodyBankAccount'OneOf1 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PostCustomersCustomerRequestBodyBankAccount'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 object schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.card.anyOf@ in the specification. data PostCustomersCustomerRequestBodyCard'OneOf1 = PostCustomersCustomerRequestBodyCard'OneOf1 { -- | address_city -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1AddressCity :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | address_country -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1AddressCountry :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | address_line1 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1AddressLine1 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | address_line2 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1AddressLine2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | address_state -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1AddressState :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | address_zip -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1AddressZip :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | cvc -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1Cvc :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | exp_month postCustomersCustomerRequestBodyCard'OneOf1ExpMonth :: GHC.Types.Int, -- | exp_year postCustomersCustomerRequestBodyCard'OneOf1ExpYear :: GHC.Types.Int, -- | metadata postCustomersCustomerRequestBodyCard'OneOf1Metadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object), -- | name -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1Name :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | number -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1Number :: Data.Text.Internal.Text, -- | object -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyCard'OneOf1Object :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyCard'OneOf1Object') } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyCard'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("address_city" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressCity obj : "address_country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressCountry obj : "address_line1" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressLine1 obj : "address_line2" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressLine2 obj : "address_state" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressState obj : "address_zip" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressZip obj : "cvc" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Cvc obj : "exp_month" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1ExpMonth obj : "exp_year" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1ExpYear obj : "metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Metadata obj : "name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Name obj : "number" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Number obj : "object" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Object obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("address_city" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressCity obj) GHC.Base.<> (("address_country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressCountry obj) GHC.Base.<> (("address_line1" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressLine1 obj) GHC.Base.<> (("address_line2" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressLine2 obj) GHC.Base.<> (("address_state" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressState obj) GHC.Base.<> (("address_zip" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1AddressZip obj) GHC.Base.<> (("cvc" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Cvc obj) GHC.Base.<> (("exp_month" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1ExpMonth obj) GHC.Base.<> (("exp_year" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1ExpYear obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Metadata obj) GHC.Base.<> (("name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Name obj) GHC.Base.<> (("number" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Number obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyCard'OneOf1Object obj))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyCard'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyCard'OneOf1" (\obj -> ((((((((((((GHC.Base.pure PostCustomersCustomerRequestBodyCard'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_city")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_country")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_line1")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_line2")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_state")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address_zip")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "cvc")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "exp_month")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "exp_year")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "object")) -- | Create a new 'PostCustomersCustomerRequestBodyCard'OneOf1' with all required fields. mkPostCustomersCustomerRequestBodyCard'OneOf1 :: -- | 'postCustomersCustomerRequestBodyCard'OneOf1ExpMonth' GHC.Types.Int -> -- | 'postCustomersCustomerRequestBodyCard'OneOf1ExpYear' GHC.Types.Int -> -- | 'postCustomersCustomerRequestBodyCard'OneOf1Number' Data.Text.Internal.Text -> PostCustomersCustomerRequestBodyCard'OneOf1 mkPostCustomersCustomerRequestBodyCard'OneOf1 postCustomersCustomerRequestBodyCard'OneOf1ExpMonth postCustomersCustomerRequestBodyCard'OneOf1ExpYear postCustomersCustomerRequestBodyCard'OneOf1Number = PostCustomersCustomerRequestBodyCard'OneOf1 { postCustomersCustomerRequestBodyCard'OneOf1AddressCity = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1AddressCountry = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1AddressLine1 = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1AddressLine2 = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1AddressState = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1AddressZip = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1Cvc = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1ExpMonth = postCustomersCustomerRequestBodyCard'OneOf1ExpMonth, postCustomersCustomerRequestBodyCard'OneOf1ExpYear = postCustomersCustomerRequestBodyCard'OneOf1ExpYear, postCustomersCustomerRequestBodyCard'OneOf1Metadata = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1Name = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyCard'OneOf1Number = postCustomersCustomerRequestBodyCard'OneOf1Number, postCustomersCustomerRequestBodyCard'OneOf1Object = GHC.Maybe.Nothing } -- | Defines the enum schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.card.anyOf.properties.object@ in the specification. data PostCustomersCustomerRequestBodyCard'OneOf1Object' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerRequestBodyCard'OneOf1Object'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. PostCustomersCustomerRequestBodyCard'OneOf1Object'Typed Data.Text.Internal.Text | -- | Represents the JSON value @"card"@ PostCustomersCustomerRequestBodyCard'OneOf1Object'EnumCard deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyCard'OneOf1Object' where toJSON (PostCustomersCustomerRequestBodyCard'OneOf1Object'Other val) = val toJSON (PostCustomersCustomerRequestBodyCard'OneOf1Object'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerRequestBodyCard'OneOf1Object'EnumCard) = "card" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyCard'OneOf1Object' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "card" -> PostCustomersCustomerRequestBodyCard'OneOf1Object'EnumCard | GHC.Base.otherwise -> PostCustomersCustomerRequestBodyCard'OneOf1Object'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.card.anyOf@ in the specification. -- -- A token, like the ones returned by [Stripe.js](https:\/\/stripe.com\/docs\/stripe.js). data PostCustomersCustomerRequestBodyCard'Variants = PostCustomersCustomerRequestBodyCard'PostCustomersCustomerRequestBodyCard'OneOf1 PostCustomersCustomerRequestBodyCard'OneOf1 | PostCustomersCustomerRequestBodyCard'Text Data.Text.Internal.Text deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyCard'Variants where toJSON (PostCustomersCustomerRequestBodyCard'PostCustomersCustomerRequestBodyCard'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyCard'Text a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyCard'Variants where parseJSON val = case (PostCustomersCustomerRequestBodyCard'PostCustomersCustomerRequestBodyCard'OneOf1 Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((PostCustomersCustomerRequestBodyCard'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 object schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings@ in the specification. -- -- Default invoice settings for this customer. data PostCustomersCustomerRequestBodyInvoiceSettings' = PostCustomersCustomerRequestBodyInvoiceSettings' { -- | custom_fields postCustomersCustomerRequestBodyInvoiceSettings'CustomFields :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'Variants), -- | default_payment_method -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyInvoiceSettings'DefaultPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | footer -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyInvoiceSettings'Footer :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyInvoiceSettings' where toJSON obj = Data.Aeson.Types.Internal.object ("custom_fields" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'CustomFields obj : "default_payment_method" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'DefaultPaymentMethod obj : "footer" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'Footer obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("custom_fields" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'CustomFields obj) GHC.Base.<> (("default_payment_method" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'DefaultPaymentMethod obj) GHC.Base.<> ("footer" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'Footer obj))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyInvoiceSettings' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyInvoiceSettings'" (\obj -> ((GHC.Base.pure PostCustomersCustomerRequestBodyInvoiceSettings' 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")) -- | Create a new 'PostCustomersCustomerRequestBodyInvoiceSettings'' with all required fields. mkPostCustomersCustomerRequestBodyInvoiceSettings' :: PostCustomersCustomerRequestBodyInvoiceSettings' mkPostCustomersCustomerRequestBodyInvoiceSettings' = PostCustomersCustomerRequestBodyInvoiceSettings' { postCustomersCustomerRequestBodyInvoiceSettings'CustomFields = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyInvoiceSettings'DefaultPaymentMethod = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyInvoiceSettings'Footer = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings.properties.custom_fields.anyOf.items@ in the specification. data PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 = PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 { -- | name -- -- Constraints: -- -- * Maximum length of 30 postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Name :: Data.Text.Internal.Text, -- | value -- -- Constraints: -- -- * Maximum length of 30 postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Value :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Name obj : "value" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Value obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Name obj) GHC.Base.<> ("value" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Value obj)) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1" (\obj -> (GHC.Base.pure PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "value")) -- | Create a new 'PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1' with all required fields. mkPostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 :: -- | 'postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Name' Data.Text.Internal.Text -> -- | 'postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Value' Data.Text.Internal.Text -> PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 mkPostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Name postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Value = PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 { postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Name = postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Name, postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Value = postCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1Value } -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.invoice_settings.properties.custom_fields.anyOf@ in the specification. data PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'EmptyString | PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'ListTPostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 ([PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1]) deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'Variants where toJSON (PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'ListTPostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerRequestBodyInvoiceSettings'CustomFields'ListTPostCustomersCustomerRequestBodyInvoiceSettings'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 oneOf schema located at @paths.\/v1\/customers\/{customer}.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 PostCustomersCustomerRequestBodyMetadata'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerRequestBodyMetadata'EmptyString | PostCustomersCustomerRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyMetadata'Variants where toJSON (PostCustomersCustomerRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyMetadata'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyMetadata'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerRequestBodyMetadata'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerRequestBodyMetadata'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\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.shipping.anyOf@ in the specification. data PostCustomersCustomerRequestBodyShipping'OneOf1 = PostCustomersCustomerRequestBodyShipping'OneOf1 { -- | address postCustomersCustomerRequestBodyShipping'OneOf1Address :: PostCustomersCustomerRequestBodyShipping'OneOf1Address', -- | name -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Name :: Data.Text.Internal.Text, -- | phone -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Phone :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyShipping'OneOf1 where toJSON obj = Data.Aeson.Types.Internal.object ("address" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address obj : "name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Name obj : "phone" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Phone obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("address" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address obj) GHC.Base.<> (("name" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Name obj) GHC.Base.<> ("phone" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Phone obj))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyShipping'OneOf1 where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyShipping'OneOf1" (\obj -> ((GHC.Base.pure PostCustomersCustomerRequestBodyShipping'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 'PostCustomersCustomerRequestBodyShipping'OneOf1' with all required fields. mkPostCustomersCustomerRequestBodyShipping'OneOf1 :: -- | 'postCustomersCustomerRequestBodyShipping'OneOf1Address' PostCustomersCustomerRequestBodyShipping'OneOf1Address' -> -- | 'postCustomersCustomerRequestBodyShipping'OneOf1Name' Data.Text.Internal.Text -> PostCustomersCustomerRequestBodyShipping'OneOf1 mkPostCustomersCustomerRequestBodyShipping'OneOf1 postCustomersCustomerRequestBodyShipping'OneOf1Address postCustomersCustomerRequestBodyShipping'OneOf1Name = PostCustomersCustomerRequestBodyShipping'OneOf1 { postCustomersCustomerRequestBodyShipping'OneOf1Address = postCustomersCustomerRequestBodyShipping'OneOf1Address, postCustomersCustomerRequestBodyShipping'OneOf1Name = postCustomersCustomerRequestBodyShipping'OneOf1Name, postCustomersCustomerRequestBodyShipping'OneOf1Phone = GHC.Maybe.Nothing } -- | Defines the object schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.shipping.anyOf.properties.address@ in the specification. data PostCustomersCustomerRequestBodyShipping'OneOf1Address' = PostCustomersCustomerRequestBodyShipping'OneOf1Address' { -- | city -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Address'City :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | country -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Address'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | line1 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Address'Line1 :: Data.Text.Internal.Text, -- | line2 -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Address'Line2 :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | postal_code -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Address'PostalCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | state -- -- Constraints: -- -- * Maximum length of 5000 postCustomersCustomerRequestBodyShipping'OneOf1Address'State :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyShipping'OneOf1Address' where toJSON obj = Data.Aeson.Types.Internal.object ("city" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'City obj : "country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'Country obj : "line1" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'Line1 obj : "line2" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'Line2 obj : "postal_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'PostalCode obj : "state" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'State obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("city" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'City obj) GHC.Base.<> (("country" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'Country obj) GHC.Base.<> (("line1" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'Line1 obj) GHC.Base.<> (("line2" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'Line2 obj) GHC.Base.<> (("postal_code" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'PostalCode obj) GHC.Base.<> ("state" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyShipping'OneOf1Address'State obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyShipping'OneOf1Address' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyShipping'OneOf1Address'" (\obj -> (((((GHC.Base.pure PostCustomersCustomerRequestBodyShipping'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 'PostCustomersCustomerRequestBodyShipping'OneOf1Address'' with all required fields. mkPostCustomersCustomerRequestBodyShipping'OneOf1Address' :: -- | 'postCustomersCustomerRequestBodyShipping'OneOf1Address'Line1' Data.Text.Internal.Text -> PostCustomersCustomerRequestBodyShipping'OneOf1Address' mkPostCustomersCustomerRequestBodyShipping'OneOf1Address' postCustomersCustomerRequestBodyShipping'OneOf1Address'Line1 = PostCustomersCustomerRequestBodyShipping'OneOf1Address' { postCustomersCustomerRequestBodyShipping'OneOf1Address'City = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyShipping'OneOf1Address'Country = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyShipping'OneOf1Address'Line1 = postCustomersCustomerRequestBodyShipping'OneOf1Address'Line1, postCustomersCustomerRequestBodyShipping'OneOf1Address'Line2 = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyShipping'OneOf1Address'PostalCode = GHC.Maybe.Nothing, postCustomersCustomerRequestBodyShipping'OneOf1Address'State = GHC.Maybe.Nothing } -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}.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 PostCustomersCustomerRequestBodyShipping'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerRequestBodyShipping'EmptyString | PostCustomersCustomerRequestBodyShipping'PostCustomersCustomerRequestBodyShipping'OneOf1 PostCustomersCustomerRequestBodyShipping'OneOf1 deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyShipping'Variants where toJSON (PostCustomersCustomerRequestBodyShipping'PostCustomersCustomerRequestBodyShipping'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyShipping'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyShipping'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerRequestBodyShipping'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerRequestBodyShipping'PostCustomersCustomerRequestBodyShipping'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\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax@ in the specification. -- -- Tax details about the customer. data PostCustomersCustomerRequestBodyTax' = PostCustomersCustomerRequestBodyTax' { -- | ip_address postCustomersCustomerRequestBodyTax'IpAddress :: (GHC.Maybe.Maybe PostCustomersCustomerRequestBodyTax'IpAddress'Variants) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyTax' where toJSON obj = Data.Aeson.Types.Internal.object ("ip_address" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTax'IpAddress obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("ip_address" Data.Aeson.Types.ToJSON..= postCustomersCustomerRequestBodyTax'IpAddress obj) instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyTax' where parseJSON = Data.Aeson.Types.FromJSON.withObject "PostCustomersCustomerRequestBodyTax'" (\obj -> GHC.Base.pure PostCustomersCustomerRequestBodyTax' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "ip_address")) -- | Create a new 'PostCustomersCustomerRequestBodyTax'' with all required fields. mkPostCustomersCustomerRequestBodyTax' :: PostCustomersCustomerRequestBodyTax' mkPostCustomersCustomerRequestBodyTax' = PostCustomersCustomerRequestBodyTax' {postCustomersCustomerRequestBodyTax'IpAddress = GHC.Maybe.Nothing} -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax.properties.ip_address.anyOf@ in the specification. data PostCustomersCustomerRequestBodyTax'IpAddress'Variants = -- | Represents the JSON value @""@ PostCustomersCustomerRequestBodyTax'IpAddress'EmptyString | PostCustomersCustomerRequestBodyTax'IpAddress'Text Data.Text.Internal.Text deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyTax'IpAddress'Variants where toJSON (PostCustomersCustomerRequestBodyTax'IpAddress'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyTax'IpAddress'EmptyString) = "" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyTax'IpAddress'Variants where parseJSON val = if | val GHC.Classes.== "" -> GHC.Base.pure PostCustomersCustomerRequestBodyTax'IpAddress'EmptyString | GHC.Base.otherwise -> case (PostCustomersCustomerRequestBodyTax'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\/{customer}.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 PostCustomersCustomerRequestBodyTaxExempt' = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. PostCustomersCustomerRequestBodyTaxExempt'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. PostCustomersCustomerRequestBodyTaxExempt'Typed Data.Text.Internal.Text | -- | Represents the JSON value @""@ PostCustomersCustomerRequestBodyTaxExempt'EnumEmptyString | -- | Represents the JSON value @"exempt"@ PostCustomersCustomerRequestBodyTaxExempt'EnumExempt | -- | Represents the JSON value @"none"@ PostCustomersCustomerRequestBodyTaxExempt'EnumNone | -- | Represents the JSON value @"reverse"@ PostCustomersCustomerRequestBodyTaxExempt'EnumReverse deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyTaxExempt' where toJSON (PostCustomersCustomerRequestBodyTaxExempt'Other val) = val toJSON (PostCustomersCustomerRequestBodyTaxExempt'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (PostCustomersCustomerRequestBodyTaxExempt'EnumEmptyString) = "" toJSON (PostCustomersCustomerRequestBodyTaxExempt'EnumExempt) = "exempt" toJSON (PostCustomersCustomerRequestBodyTaxExempt'EnumNone) = "none" toJSON (PostCustomersCustomerRequestBodyTaxExempt'EnumReverse) = "reverse" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyTaxExempt' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "" -> PostCustomersCustomerRequestBodyTaxExempt'EnumEmptyString | val GHC.Classes.== "exempt" -> PostCustomersCustomerRequestBodyTaxExempt'EnumExempt | val GHC.Classes.== "none" -> PostCustomersCustomerRequestBodyTaxExempt'EnumNone | val GHC.Classes.== "reverse" -> PostCustomersCustomerRequestBodyTaxExempt'EnumReverse | GHC.Base.otherwise -> PostCustomersCustomerRequestBodyTaxExempt'Other val ) -- | Defines the oneOf schema located at @paths.\/v1\/customers\/{customer}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.trial_end.anyOf@ in the specification. -- -- Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value \`now\` can be provided to end the customer\'s trial immediately. Can be at most two years from \`billing_cycle_anchor\`. data PostCustomersCustomerRequestBodyTrialEnd'Variants = -- | Represents the JSON value @"now"@ PostCustomersCustomerRequestBodyTrialEnd'Now | PostCustomersCustomerRequestBodyTrialEnd'Int GHC.Types.Int deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON PostCustomersCustomerRequestBodyTrialEnd'Variants where toJSON (PostCustomersCustomerRequestBodyTrialEnd'Int a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (PostCustomersCustomerRequestBodyTrialEnd'Now) = "now" instance Data.Aeson.Types.FromJSON.FromJSON PostCustomersCustomerRequestBodyTrialEnd'Variants where parseJSON val = if | val GHC.Classes.== "now" -> GHC.Base.pure PostCustomersCustomerRequestBodyTrialEnd'Now | GHC.Base.otherwise -> case (PostCustomersCustomerRequestBodyTrialEnd'Int 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 -- | Represents a response of the operation 'postCustomersCustomer'. -- -- 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), 'PostCustomersCustomerResponseError' is used. data PostCustomersCustomerResponse = -- | Means either no matching case available or a parse error PostCustomersCustomerResponseError GHC.Base.String | -- | Successful response. PostCustomersCustomerResponse200 Customer | -- | Error response. PostCustomersCustomerResponseDefault Error deriving (GHC.Show.Show, GHC.Classes.Eq)