collection_method\<\/code>, become uneditable.\<\/p>
--
-- \If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,
-- sending reminders for, or \automatically reconciling\<\/a> invoices, pass
-- \auto_advance=false\<\/code>.\<\/p>
postInvoicesInvoice ::
forall m.
StripeAPI.Common.MonadHTTP m =>
-- | invoice | Constraints: Maximum length of 5000
Data.Text.Internal.Text ->
-- | The request body to send
GHC.Maybe.Maybe PostInvoicesInvoiceRequestBody ->
-- | Monadic computation which returns the result of the operation
StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostInvoicesInvoiceResponse)
postInvoicesInvoice
invoice
body =
GHC.Base.fmap
( \response_0 ->
GHC.Base.fmap
( Data.Either.either PostInvoicesInvoiceResponseError 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) ->
PostInvoicesInvoiceResponse200
Data.Functor.<$> ( Data.Aeson.eitherDecodeStrict body ::
Data.Either.Either
GHC.Base.String
Invoice
)
| GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) ->
PostInvoicesInvoiceResponseDefault
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/invoices/" 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 invoice)) GHC.Base.++ ""))) GHC.Base.mempty body StripeAPI.Common.RequestBodyEncodingFormData)
-- | Defines the object schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification.
data PostInvoicesInvoiceRequestBody = PostInvoicesInvoiceRequestBody
{ -- | account_tax_ids: The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
postInvoicesInvoiceRequestBodyAccountTaxIds :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyAccountTaxIds'Variants),
-- | application_fee_amount: A fee in %s that will be applied to the invoice and transferred to the application owner\'s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https:\/\/stripe.com\/docs\/billing\/invoices\/connect\#collecting-fees).
postInvoicesInvoiceRequestBodyApplicationFeeAmount :: (GHC.Maybe.Maybe GHC.Types.Int),
-- | auto_advance: Controls whether Stripe will perform [automatic collection](https:\/\/stripe.com\/docs\/billing\/invoices\/workflow\/\#auto_advance) of the invoice.
postInvoicesInvoiceRequestBodyAutoAdvance :: (GHC.Maybe.Maybe GHC.Types.Bool),
-- | automatic_tax: Settings for automatic tax lookup for this invoice.
postInvoicesInvoiceRequestBodyAutomaticTax :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyAutomaticTax'),
-- | collection_method: Either \`charge_automatically\` or \`send_invoice\`. This field can be updated only on \`draft\` invoices.
postInvoicesInvoiceRequestBodyCollectionMethod :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyCollectionMethod'),
-- | custom_fields: A list of up to 4 custom fields to be displayed on the invoice. If a value for \`custom_fields\` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
postInvoicesInvoiceRequestBodyCustomFields :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyCustomFields'Variants),
-- | days_until_due: The number of days from which the invoice is created until it is due. Only valid for invoices where \`collection_method=send_invoice\`. This field can only be updated on \`draft\` invoices.
postInvoicesInvoiceRequestBodyDaysUntilDue :: (GHC.Maybe.Maybe GHC.Types.Int),
-- | default_payment_method: ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription\'s default payment method, if any, or to the default payment method in the customer\'s invoice settings.
--
-- Constraints:
--
-- * Maximum length of 5000
postInvoicesInvoiceRequestBodyDefaultPaymentMethod :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
-- | default_source: ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription\'s default source, if any, or to the customer\'s default source.
--
-- Constraints:
--
-- * Maximum length of 5000
postInvoicesInvoiceRequestBodyDefaultSource :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
-- | default_tax_rates: The tax rates that will apply to any line item that does not have \`tax_rates\` set. Pass an empty string to remove previously-defined tax rates.
postInvoicesInvoiceRequestBodyDefaultTaxRates :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyDefaultTaxRates'Variants),
-- | description: An arbitrary string attached to the object. Often useful for displaying to users. Referenced as \'memo\' in the Dashboard.
--
-- Constraints:
--
-- * Maximum length of 1500
postInvoicesInvoiceRequestBodyDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
-- | discounts: The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
postInvoicesInvoiceRequestBodyDiscounts :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyDiscounts'Variants),
-- | due_date: The date on which payment for this invoice is due. Only valid for invoices where \`collection_method=send_invoice\`. This field can only be updated on \`draft\` invoices.
postInvoicesInvoiceRequestBodyDueDate :: (GHC.Maybe.Maybe GHC.Types.Int),
-- | expand: Specifies which fields in the response should be expanded.
postInvoicesInvoiceRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
-- | footer: Footer to be displayed on the invoice.
--
-- Constraints:
--
-- * Maximum length of 5000
postInvoicesInvoiceRequestBodyFooter :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
-- | 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\`.
postInvoicesInvoiceRequestBodyMetadata :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyMetadata'Variants),
-- | on_behalf_of: The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https:\/\/stripe.com\/docs\/billing\/invoices\/connect) documentation for details.
postInvoicesInvoiceRequestBodyOnBehalfOf :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyOnBehalfOf'Variants),
-- | payment_settings: Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
postInvoicesInvoiceRequestBodyPaymentSettings :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyPaymentSettings'),
-- | statement_descriptor: Extra information about a charge for the customer\'s credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default \`statement_descriptor\` will be set to the first subscription item\'s product\'s \`statement_descriptor\`.
--
-- Constraints:
--
-- * Maximum length of 22
postInvoicesInvoiceRequestBodyStatementDescriptor :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
-- | transfer_data: If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice\'s charge. This will be unset if you POST an empty value.
postInvoicesInvoiceRequestBodyTransferData :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyTransferData'Variants)
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBody where
toJSON obj = Data.Aeson.Types.Internal.object ("account_tax_ids" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAccountTaxIds obj : "application_fee_amount" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyApplicationFeeAmount obj : "auto_advance" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAutoAdvance obj : "automatic_tax" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAutomaticTax obj : "collection_method" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCollectionMethod obj : "custom_fields" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCustomFields obj : "days_until_due" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDaysUntilDue obj : "default_payment_method" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDefaultPaymentMethod obj : "default_source" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDefaultSource obj : "default_tax_rates" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDefaultTaxRates obj : "description" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDescription obj : "discounts" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDiscounts obj : "due_date" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDueDate obj : "expand" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyExpand obj : "footer" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyFooter obj : "metadata" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyMetadata obj : "on_behalf_of" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyOnBehalfOf obj : "payment_settings" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings obj : "statement_descriptor" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyStatementDescriptor obj : "transfer_data" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyTransferData obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("account_tax_ids" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAccountTaxIds obj) GHC.Base.<> (("application_fee_amount" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyApplicationFeeAmount obj) GHC.Base.<> (("auto_advance" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAutoAdvance obj) GHC.Base.<> (("automatic_tax" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAutomaticTax obj) GHC.Base.<> (("collection_method" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCollectionMethod obj) GHC.Base.<> (("custom_fields" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCustomFields obj) GHC.Base.<> (("days_until_due" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDaysUntilDue obj) GHC.Base.<> (("default_payment_method" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDefaultPaymentMethod obj) GHC.Base.<> (("default_source" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDefaultSource obj) GHC.Base.<> (("default_tax_rates" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDefaultTaxRates obj) GHC.Base.<> (("description" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDescription obj) GHC.Base.<> (("discounts" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDiscounts obj) GHC.Base.<> (("due_date" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDueDate obj) GHC.Base.<> (("expand" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyExpand obj) GHC.Base.<> (("footer" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyFooter obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyMetadata obj) GHC.Base.<> (("on_behalf_of" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyOnBehalfOf obj) GHC.Base.<> (("payment_settings" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings obj) GHC.Base.<> (("statement_descriptor" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyStatementDescriptor obj) GHC.Base.<> ("transfer_data" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyTransferData obj))))))))))))))))))))
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBody where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBody" (\obj -> (((((((((((((((((((GHC.Base.pure PostInvoicesInvoiceRequestBody GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "account_tax_ids")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "application_fee_amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "auto_advance")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "automatic_tax")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "collection_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "custom_fields")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "days_until_due")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_payment_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_source")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_tax_rates")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "discounts")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "due_date")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "expand")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "footer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "on_behalf_of")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_settings")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "statement_descriptor")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "transfer_data"))
-- | Create a new 'PostInvoicesInvoiceRequestBody' with all required fields.
mkPostInvoicesInvoiceRequestBody :: PostInvoicesInvoiceRequestBody
mkPostInvoicesInvoiceRequestBody =
PostInvoicesInvoiceRequestBody
{ postInvoicesInvoiceRequestBodyAccountTaxIds = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyApplicationFeeAmount = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyAutoAdvance = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyAutomaticTax = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyCollectionMethod = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyCustomFields = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDaysUntilDue = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDefaultPaymentMethod = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDefaultSource = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDefaultTaxRates = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDescription = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDiscounts = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDueDate = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyExpand = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyFooter = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyMetadata = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyOnBehalfOf = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyPaymentSettings = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyStatementDescriptor = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyTransferData = GHC.Maybe.Nothing
}
-- | Defines the oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.account_tax_ids.anyOf@ in the specification.
--
-- The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
data PostInvoicesInvoiceRequestBodyAccountTaxIds'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyAccountTaxIds'EmptyString
| PostInvoicesInvoiceRequestBodyAccountTaxIds'ListTText ([Data.Text.Internal.Text])
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyAccountTaxIds'Variants where
toJSON (PostInvoicesInvoiceRequestBodyAccountTaxIds'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyAccountTaxIds'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyAccountTaxIds'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyAccountTaxIds'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyAccountTaxIds'ListTText 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\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.automatic_tax@ in the specification.
--
-- Settings for automatic tax lookup for this invoice.
data PostInvoicesInvoiceRequestBodyAutomaticTax' = PostInvoicesInvoiceRequestBodyAutomaticTax'
{ -- | enabled
postInvoicesInvoiceRequestBodyAutomaticTax'Enabled :: GHC.Types.Bool
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyAutomaticTax' where
toJSON obj = Data.Aeson.Types.Internal.object ("enabled" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAutomaticTax'Enabled obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("enabled" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyAutomaticTax'Enabled obj)
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyAutomaticTax' where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyAutomaticTax'" (\obj -> GHC.Base.pure PostInvoicesInvoiceRequestBodyAutomaticTax' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "enabled"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyAutomaticTax'' with all required fields.
mkPostInvoicesInvoiceRequestBodyAutomaticTax' ::
-- | 'postInvoicesInvoiceRequestBodyAutomaticTax'Enabled'
GHC.Types.Bool ->
PostInvoicesInvoiceRequestBodyAutomaticTax'
mkPostInvoicesInvoiceRequestBodyAutomaticTax' postInvoicesInvoiceRequestBodyAutomaticTax'Enabled = PostInvoicesInvoiceRequestBodyAutomaticTax' {postInvoicesInvoiceRequestBodyAutomaticTax'Enabled = postInvoicesInvoiceRequestBodyAutomaticTax'Enabled}
-- | Defines the enum schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.collection_method@ in the specification.
--
-- Either \`charge_automatically\` or \`send_invoice\`. This field can be updated only on \`draft\` invoices.
data PostInvoicesInvoiceRequestBodyCollectionMethod'
= -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
PostInvoicesInvoiceRequestBodyCollectionMethod'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.
PostInvoicesInvoiceRequestBodyCollectionMethod'Typed Data.Text.Internal.Text
| -- | Represents the JSON value @"charge_automatically"@
PostInvoicesInvoiceRequestBodyCollectionMethod'EnumChargeAutomatically
| -- | Represents the JSON value @"send_invoice"@
PostInvoicesInvoiceRequestBodyCollectionMethod'EnumSendInvoice
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyCollectionMethod' where
toJSON (PostInvoicesInvoiceRequestBodyCollectionMethod'Other val) = val
toJSON (PostInvoicesInvoiceRequestBodyCollectionMethod'Typed val) = Data.Aeson.Types.ToJSON.toJSON val
toJSON (PostInvoicesInvoiceRequestBodyCollectionMethod'EnumChargeAutomatically) = "charge_automatically"
toJSON (PostInvoicesInvoiceRequestBodyCollectionMethod'EnumSendInvoice) = "send_invoice"
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyCollectionMethod' where
parseJSON val =
GHC.Base.pure
( if
| val GHC.Classes.== "charge_automatically" -> PostInvoicesInvoiceRequestBodyCollectionMethod'EnumChargeAutomatically
| val GHC.Classes.== "send_invoice" -> PostInvoicesInvoiceRequestBodyCollectionMethod'EnumSendInvoice
| GHC.Base.otherwise -> PostInvoicesInvoiceRequestBodyCollectionMethod'Other val
)
-- | Defines the object schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.custom_fields.anyOf.items@ in the specification.
data PostInvoicesInvoiceRequestBodyCustomFields'OneOf1 = PostInvoicesInvoiceRequestBodyCustomFields'OneOf1
{ -- | name
--
-- Constraints:
--
-- * Maximum length of 30
postInvoicesInvoiceRequestBodyCustomFields'OneOf1Name :: Data.Text.Internal.Text,
-- | value
--
-- Constraints:
--
-- * Maximum length of 30
postInvoicesInvoiceRequestBodyCustomFields'OneOf1Value :: Data.Text.Internal.Text
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyCustomFields'OneOf1 where
toJSON obj = Data.Aeson.Types.Internal.object ("name" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCustomFields'OneOf1Name obj : "value" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCustomFields'OneOf1Value obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("name" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCustomFields'OneOf1Name obj) GHC.Base.<> ("value" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyCustomFields'OneOf1Value obj))
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyCustomFields'OneOf1 where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyCustomFields'OneOf1" (\obj -> (GHC.Base.pure PostInvoicesInvoiceRequestBodyCustomFields'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "value"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyCustomFields'OneOf1' with all required fields.
mkPostInvoicesInvoiceRequestBodyCustomFields'OneOf1 ::
-- | 'postInvoicesInvoiceRequestBodyCustomFields'OneOf1Name'
Data.Text.Internal.Text ->
-- | 'postInvoicesInvoiceRequestBodyCustomFields'OneOf1Value'
Data.Text.Internal.Text ->
PostInvoicesInvoiceRequestBodyCustomFields'OneOf1
mkPostInvoicesInvoiceRequestBodyCustomFields'OneOf1 postInvoicesInvoiceRequestBodyCustomFields'OneOf1Name postInvoicesInvoiceRequestBodyCustomFields'OneOf1Value =
PostInvoicesInvoiceRequestBodyCustomFields'OneOf1
{ postInvoicesInvoiceRequestBodyCustomFields'OneOf1Name = postInvoicesInvoiceRequestBodyCustomFields'OneOf1Name,
postInvoicesInvoiceRequestBodyCustomFields'OneOf1Value = postInvoicesInvoiceRequestBodyCustomFields'OneOf1Value
}
-- | Defines the oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.custom_fields.anyOf@ in the specification.
--
-- A list of up to 4 custom fields to be displayed on the invoice. If a value for \`custom_fields\` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
data PostInvoicesInvoiceRequestBodyCustomFields'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyCustomFields'EmptyString
| PostInvoicesInvoiceRequestBodyCustomFields'ListTPostInvoicesInvoiceRequestBodyCustomFields'OneOf1 ([PostInvoicesInvoiceRequestBodyCustomFields'OneOf1])
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyCustomFields'Variants where
toJSON (PostInvoicesInvoiceRequestBodyCustomFields'ListTPostInvoicesInvoiceRequestBodyCustomFields'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyCustomFields'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyCustomFields'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyCustomFields'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyCustomFields'ListTPostInvoicesInvoiceRequestBodyCustomFields'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\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.default_tax_rates.anyOf@ in the specification.
--
-- The tax rates that will apply to any line item that does not have \`tax_rates\` set. Pass an empty string to remove previously-defined tax rates.
data PostInvoicesInvoiceRequestBodyDefaultTaxRates'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyDefaultTaxRates'EmptyString
| PostInvoicesInvoiceRequestBodyDefaultTaxRates'ListTText ([Data.Text.Internal.Text])
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyDefaultTaxRates'Variants where
toJSON (PostInvoicesInvoiceRequestBodyDefaultTaxRates'ListTText a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyDefaultTaxRates'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyDefaultTaxRates'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyDefaultTaxRates'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyDefaultTaxRates'ListTText 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\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.discounts.anyOf.items@ in the specification.
data PostInvoicesInvoiceRequestBodyDiscounts'OneOf1 = PostInvoicesInvoiceRequestBodyDiscounts'OneOf1
{ -- | coupon
--
-- Constraints:
--
-- * Maximum length of 5000
postInvoicesInvoiceRequestBodyDiscounts'OneOf1Coupon :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
-- | discount
--
-- Constraints:
--
-- * Maximum length of 5000
postInvoicesInvoiceRequestBodyDiscounts'OneOf1Discount :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyDiscounts'OneOf1 where
toJSON obj = Data.Aeson.Types.Internal.object ("coupon" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDiscounts'OneOf1Coupon obj : "discount" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDiscounts'OneOf1Discount obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("coupon" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDiscounts'OneOf1Coupon obj) GHC.Base.<> ("discount" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyDiscounts'OneOf1Discount obj))
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyDiscounts'OneOf1 where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyDiscounts'OneOf1" (\obj -> (GHC.Base.pure PostInvoicesInvoiceRequestBodyDiscounts'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "coupon")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "discount"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyDiscounts'OneOf1' with all required fields.
mkPostInvoicesInvoiceRequestBodyDiscounts'OneOf1 :: PostInvoicesInvoiceRequestBodyDiscounts'OneOf1
mkPostInvoicesInvoiceRequestBodyDiscounts'OneOf1 =
PostInvoicesInvoiceRequestBodyDiscounts'OneOf1
{ postInvoicesInvoiceRequestBodyDiscounts'OneOf1Coupon = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyDiscounts'OneOf1Discount = GHC.Maybe.Nothing
}
-- | Defines the oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.discounts.anyOf@ in the specification.
--
-- The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
data PostInvoicesInvoiceRequestBodyDiscounts'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyDiscounts'EmptyString
| PostInvoicesInvoiceRequestBodyDiscounts'ListTPostInvoicesInvoiceRequestBodyDiscounts'OneOf1 ([PostInvoicesInvoiceRequestBodyDiscounts'OneOf1])
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyDiscounts'Variants where
toJSON (PostInvoicesInvoiceRequestBodyDiscounts'ListTPostInvoicesInvoiceRequestBodyDiscounts'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyDiscounts'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyDiscounts'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyDiscounts'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyDiscounts'ListTPostInvoicesInvoiceRequestBodyDiscounts'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\/invoices\/{invoice}.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 PostInvoicesInvoiceRequestBodyMetadata'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyMetadata'EmptyString
| PostInvoicesInvoiceRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyMetadata'Variants where
toJSON (PostInvoicesInvoiceRequestBodyMetadata'Object a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyMetadata'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyMetadata'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyMetadata'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyMetadata'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 oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.on_behalf_of.anyOf@ in the specification.
--
-- The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https:\/\/stripe.com\/docs\/billing\/invoices\/connect) documentation for details.
data PostInvoicesInvoiceRequestBodyOnBehalfOf'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyOnBehalfOf'EmptyString
| PostInvoicesInvoiceRequestBodyOnBehalfOf'Text Data.Text.Internal.Text
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyOnBehalfOf'Variants where
toJSON (PostInvoicesInvoiceRequestBodyOnBehalfOf'Text a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyOnBehalfOf'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyOnBehalfOf'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyOnBehalfOf'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyOnBehalfOf'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\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings@ in the specification.
--
-- Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
data PostInvoicesInvoiceRequestBodyPaymentSettings' = PostInvoicesInvoiceRequestBodyPaymentSettings'
{ -- | payment_method_options
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'),
-- | payment_method_types
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'Variants)
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings' where
toJSON obj = Data.Aeson.Types.Internal.object ("payment_method_options" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions obj : "payment_method_types" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("payment_method_options" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions obj) GHC.Base.<> ("payment_method_types" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes obj))
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings' where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyPaymentSettings'" (\obj -> (GHC.Base.pure PostInvoicesInvoiceRequestBodyPaymentSettings' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method_options")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "payment_method_types"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyPaymentSettings'' with all required fields.
mkPostInvoicesInvoiceRequestBodyPaymentSettings' :: PostInvoicesInvoiceRequestBodyPaymentSettings'
mkPostInvoicesInvoiceRequestBodyPaymentSettings' =
PostInvoicesInvoiceRequestBodyPaymentSettings'
{ postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes = GHC.Maybe.Nothing
}
-- | Defines the object schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_options@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions' = PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'
{ -- | bancontact
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'Variants),
-- | card
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'Variants)
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions' where
toJSON obj = Data.Aeson.Types.Internal.object ("bancontact" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact obj : "card" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("bancontact" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact obj) GHC.Base.<> ("card" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card obj))
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions' where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'" (\obj -> (GHC.Base.pure PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bancontact")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "card"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'' with all required fields.
mkPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions' :: PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'
mkPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions' =
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'
{ postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card = GHC.Maybe.Nothing
}
-- | Defines the object schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_options.properties.bancontact.anyOf@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 = PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1
{ -- | preferred_language
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage')
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 where
toJSON obj = Data.Aeson.Types.Internal.object ("preferred_language" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("preferred_language" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage obj)
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1" (\obj -> GHC.Base.pure PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "preferred_language"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1' with all required fields.
mkPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 :: PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1
mkPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 = PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 {postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage = GHC.Maybe.Nothing}
-- | Defines the enum schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_options.properties.bancontact.anyOf.properties.preferred_language@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'
= -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'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.
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'Typed Data.Text.Internal.Text
| -- | Represents the JSON value @"de"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumDe
| -- | Represents the JSON value @"en"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumEn
| -- | Represents the JSON value @"fr"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumFr
| -- | Represents the JSON value @"nl"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumNl
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage' where
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'Other val) = val
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'Typed val) = Data.Aeson.Types.ToJSON.toJSON val
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumDe) = "de"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumEn) = "en"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumFr) = "fr"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumNl) = "nl"
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage' where
parseJSON val =
GHC.Base.pure
( if
| val GHC.Classes.== "de" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumDe
| val GHC.Classes.== "en" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumEn
| val GHC.Classes.== "fr" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumFr
| val GHC.Classes.== "nl" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'EnumNl
| GHC.Base.otherwise -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1PreferredLanguage'Other val
)
-- | Defines the oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_options.properties.bancontact.anyOf@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'EmptyString
| PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'Variants where
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Bancontact'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\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_options.properties.card.anyOf@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 = PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1
{ -- | request_three_d_secure
postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure :: (GHC.Maybe.Maybe PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure')
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 where
toJSON obj = Data.Aeson.Types.Internal.object ("request_three_d_secure" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs ("request_three_d_secure" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure obj)
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1" (\obj -> GHC.Base.pure PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "request_three_d_secure"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1' with all required fields.
mkPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 :: PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1
mkPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 = PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 {postInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure = GHC.Maybe.Nothing}
-- | Defines the enum schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_options.properties.card.anyOf.properties.request_three_d_secure@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'
= -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'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.
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'Typed Data.Text.Internal.Text
| -- | Represents the JSON value @"any"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'EnumAny
| -- | Represents the JSON value @"automatic"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'EnumAutomatic
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure' where
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'Other val) = val
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'Typed val) = Data.Aeson.Types.ToJSON.toJSON val
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'EnumAny) = "any"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'EnumAutomatic) = "automatic"
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure' where
parseJSON val =
GHC.Base.pure
( if
| val GHC.Classes.== "any" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'EnumAny
| val GHC.Classes.== "automatic" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'EnumAutomatic
| GHC.Base.otherwise -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1RequestThreeDSecure'Other val
)
-- | Defines the oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_options.properties.card.anyOf@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'EmptyString
| PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'Variants where
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodOptions'Card'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 enum schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_types.anyOf.items@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1
= -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1Other Data.Aeson.Types.Internal.Value
| -- | This constructor can be used to send values to the server which are not present in the specification yet.
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1Typed Data.Text.Internal.Text
| -- | Represents the JSON value @"ach_credit_transfer"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAchCreditTransfer
| -- | Represents the JSON value @"ach_debit"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAchDebit
| -- | Represents the JSON value @"au_becs_debit"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAuBecsDebit
| -- | Represents the JSON value @"bacs_debit"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumBacsDebit
| -- | Represents the JSON value @"bancontact"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumBancontact
| -- | Represents the JSON value @"card"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumCard
| -- | Represents the JSON value @"fpx"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumFpx
| -- | Represents the JSON value @"giropay"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumGiropay
| -- | Represents the JSON value @"ideal"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumIdeal
| -- | Represents the JSON value @"sepa_debit"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumSepaDebit
| -- | Represents the JSON value @"sofort"@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumSofort
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1 where
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1Other val) = val
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1Typed val) = Data.Aeson.Types.ToJSON.toJSON val
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAchCreditTransfer) = "ach_credit_transfer"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAchDebit) = "ach_debit"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAuBecsDebit) = "au_becs_debit"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumBacsDebit) = "bacs_debit"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumBancontact) = "bancontact"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumCard) = "card"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumFpx) = "fpx"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumGiropay) = "giropay"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumIdeal) = "ideal"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumSepaDebit) = "sepa_debit"
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumSofort) = "sofort"
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1 where
parseJSON val =
GHC.Base.pure
( if
| val GHC.Classes.== "ach_credit_transfer" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAchCreditTransfer
| val GHC.Classes.== "ach_debit" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAchDebit
| val GHC.Classes.== "au_becs_debit" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumAuBecsDebit
| val GHC.Classes.== "bacs_debit" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumBacsDebit
| val GHC.Classes.== "bancontact" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumBancontact
| val GHC.Classes.== "card" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumCard
| val GHC.Classes.== "fpx" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumFpx
| val GHC.Classes.== "giropay" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumGiropay
| val GHC.Classes.== "ideal" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumIdeal
| val GHC.Classes.== "sepa_debit" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumSepaDebit
| val GHC.Classes.== "sofort" -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1EnumSofort
| GHC.Base.otherwise -> PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1Other val
)
-- | Defines the oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_settings.properties.payment_method_types.anyOf@ in the specification.
data PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'EmptyString
| PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'ListTPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1 ([PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1])
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'Variants where
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'ListTPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'ListTPostInvoicesInvoiceRequestBodyPaymentSettings'PaymentMethodTypes'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\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.transfer_data.anyOf@ in the specification.
data PostInvoicesInvoiceRequestBodyTransferData'OneOf1 = PostInvoicesInvoiceRequestBodyTransferData'OneOf1
{ -- | amount
postInvoicesInvoiceRequestBodyTransferData'OneOf1Amount :: (GHC.Maybe.Maybe GHC.Types.Int),
-- | destination
postInvoicesInvoiceRequestBodyTransferData'OneOf1Destination :: Data.Text.Internal.Text
}
deriving
( GHC.Show.Show,
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyTransferData'OneOf1 where
toJSON obj = Data.Aeson.Types.Internal.object ("amount" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyTransferData'OneOf1Amount obj : "destination" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyTransferData'OneOf1Destination obj : GHC.Base.mempty)
toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("amount" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyTransferData'OneOf1Amount obj) GHC.Base.<> ("destination" Data.Aeson.Types.ToJSON..= postInvoicesInvoiceRequestBodyTransferData'OneOf1Destination obj))
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyTransferData'OneOf1 where
parseJSON = Data.Aeson.Types.FromJSON.withObject "PostInvoicesInvoiceRequestBodyTransferData'OneOf1" (\obj -> (GHC.Base.pure PostInvoicesInvoiceRequestBodyTransferData'OneOf1 GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "amount")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "destination"))
-- | Create a new 'PostInvoicesInvoiceRequestBodyTransferData'OneOf1' with all required fields.
mkPostInvoicesInvoiceRequestBodyTransferData'OneOf1 ::
-- | 'postInvoicesInvoiceRequestBodyTransferData'OneOf1Destination'
Data.Text.Internal.Text ->
PostInvoicesInvoiceRequestBodyTransferData'OneOf1
mkPostInvoicesInvoiceRequestBodyTransferData'OneOf1 postInvoicesInvoiceRequestBodyTransferData'OneOf1Destination =
PostInvoicesInvoiceRequestBodyTransferData'OneOf1
{ postInvoicesInvoiceRequestBodyTransferData'OneOf1Amount = GHC.Maybe.Nothing,
postInvoicesInvoiceRequestBodyTransferData'OneOf1Destination = postInvoicesInvoiceRequestBodyTransferData'OneOf1Destination
}
-- | Defines the oneOf schema located at @paths.\/v1\/invoices\/{invoice}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.transfer_data.anyOf@ in the specification.
--
-- If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice\'s charge. This will be unset if you POST an empty value.
data PostInvoicesInvoiceRequestBodyTransferData'Variants
= -- | Represents the JSON value @""@
PostInvoicesInvoiceRequestBodyTransferData'EmptyString
| PostInvoicesInvoiceRequestBodyTransferData'PostInvoicesInvoiceRequestBodyTransferData'OneOf1 PostInvoicesInvoiceRequestBodyTransferData'OneOf1
deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostInvoicesInvoiceRequestBodyTransferData'Variants where
toJSON (PostInvoicesInvoiceRequestBodyTransferData'PostInvoicesInvoiceRequestBodyTransferData'OneOf1 a) = Data.Aeson.Types.ToJSON.toJSON a
toJSON (PostInvoicesInvoiceRequestBodyTransferData'EmptyString) = ""
instance Data.Aeson.Types.FromJSON.FromJSON PostInvoicesInvoiceRequestBodyTransferData'Variants where
parseJSON val =
if
| val GHC.Classes.== "" -> GHC.Base.pure PostInvoicesInvoiceRequestBodyTransferData'EmptyString
| GHC.Base.otherwise -> case (PostInvoicesInvoiceRequestBodyTransferData'PostInvoicesInvoiceRequestBodyTransferData'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
-- | Represents a response of the operation 'postInvoicesInvoice'.
--
-- 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), 'PostInvoicesInvoiceResponseError' is used.
data PostInvoicesInvoiceResponse
= -- | Means either no matching case available or a parse error
PostInvoicesInvoiceResponseError GHC.Base.String
| -- | Successful response.
PostInvoicesInvoiceResponse200 Invoice
| -- | Error response.
PostInvoicesInvoiceResponseDefault Error
deriving (GHC.Show.Show, GHC.Classes.Eq)