{-# 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 postSubscriptionItemsItem
module StripeAPI.Operations.PostSubscriptionItemsItem 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/subscription_items/{item}
--
-- \<p>Updates the plan or quantity of an item on a current subscription.\<\/p>
postSubscriptionItemsItem ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | item | Constraints: Maximum length of 5000
  Data.Text.Internal.Text ->
  -- | The request body to send
  GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBody ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostSubscriptionItemsItemResponse)
postSubscriptionItemsItem :: Text
-> Maybe PostSubscriptionItemsItemRequestBody
-> ClientT m (Response PostSubscriptionItemsItemResponse)
postSubscriptionItemsItem
  Text
item
  Maybe PostSubscriptionItemsItemRequestBody
body =
    (Response ByteString -> Response PostSubscriptionItemsItemResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response PostSubscriptionItemsItemResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
      ( \Response ByteString
response_0 ->
          (ByteString -> PostSubscriptionItemsItemResponse)
-> Response ByteString
-> Response PostSubscriptionItemsItemResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
            ( (String -> PostSubscriptionItemsItemResponse)
-> (PostSubscriptionItemsItemResponse
    -> PostSubscriptionItemsItemResponse)
-> Either String PostSubscriptionItemsItemResponse
-> PostSubscriptionItemsItemResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostSubscriptionItemsItemResponse
PostSubscriptionItemsItemResponseError PostSubscriptionItemsItemResponse
-> PostSubscriptionItemsItemResponse
forall a. a -> a
GHC.Base.id
                (Either String PostSubscriptionItemsItemResponse
 -> PostSubscriptionItemsItemResponse)
-> (ByteString -> Either String PostSubscriptionItemsItemResponse)
-> ByteString
-> PostSubscriptionItemsItemResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. ( \Response ByteString
response ByteString
body ->
                               if
                                   | (\Status
status_1 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_1 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
200) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                     SubscriptionItem -> PostSubscriptionItemsItemResponse
PostSubscriptionItemsItemResponse200
                                       (SubscriptionItem -> PostSubscriptionItemsItemResponse)
-> Either String SubscriptionItem
-> Either String PostSubscriptionItemsItemResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String SubscriptionItem
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                            Data.Either.Either
                                                              GHC.Base.String
                                                              SubscriptionItem
                                                        )
                                   | Bool -> Status -> Bool
forall a b. a -> b -> a
GHC.Base.const Bool
GHC.Types.True (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                     Error -> PostSubscriptionItemsItemResponse
PostSubscriptionItemsItemResponseDefault
                                       (Error -> PostSubscriptionItemsItemResponse)
-> Either String Error
-> Either String PostSubscriptionItemsItemResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String Error
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                            Data.Either.Either
                                                              GHC.Base.String
                                                              Error
                                                        )
                                   | Bool
GHC.Base.otherwise -> String -> Either String PostSubscriptionItemsItemResponse
forall a b. a -> Either a b
Data.Either.Left String
"Missing default response type"
                           )
                  Response ByteString
response_0
            )
            Response ByteString
response_0
      )
      (Text
-> Text
-> [QueryParameter]
-> Maybe PostSubscriptionItemsItemRequestBody
-> RequestBodyEncoding
-> ClientT m (Response ByteString)
forall (m :: * -> *) body.
(MonadHTTP m, ToJSON body) =>
Text
-> Text
-> [QueryParameter]
-> Maybe body
-> RequestBodyEncoding
-> ClientT m (Response ByteString)
StripeAPI.Common.doBodyCallWithConfigurationM (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"POST") (String -> Text
Data.Text.pack (String
"/v1/subscription_items/" String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ (ByteString -> String
Data.ByteString.Char8.unpack (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (String -> ByteString
Data.ByteString.Char8.pack (String -> ByteString) -> String -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> String
forall a. StringifyModel a => a -> String
StripeAPI.Common.stringifyModel Text
item)) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
""))) [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty Maybe PostSubscriptionItemsItemRequestBody
body RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)

-- | Defines the object schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema@ in the specification.
data PostSubscriptionItemsItemRequestBody = PostSubscriptionItemsItemRequestBody
  { -- | billing_thresholds: Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
    PostSubscriptionItemsItemRequestBody
-> Maybe
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
postSubscriptionItemsItemRequestBodyBillingThresholds :: (GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants),
    -- | expand: Specifies which fields in the response should be expanded.
    PostSubscriptionItemsItemRequestBody -> Maybe [Text]
postSubscriptionItemsItemRequestBodyExpand :: (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\`.
    PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
postSubscriptionItemsItemRequestBodyMetadata :: (GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants),
    -- | off_session: Indicates if a customer is on or off-session while an invoice payment is attempted.
    PostSubscriptionItemsItemRequestBody -> Maybe Bool
postSubscriptionItemsItemRequestBodyOffSession :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | payment_behavior: Use \`allow_incomplete\` to transition the subscription to \`status=past_due\` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription\'s invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication) for Billing to learn more. This is the default behavior.
    --
    -- Use \`default_incomplete\` to transition the subscription to \`status=past_due\` when payment is required and await explicit confirmation of the invoice\'s payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication), or collecting a mandate for a bank debit payment method.
    --
    -- Use \`pending_if_incomplete\` to update the subscription using [pending updates](https:\/\/stripe.com\/docs\/billing\/subscriptions\/pending-updates). When you use \`pending_if_incomplete\` you can only pass the parameters [supported by pending updates](https:\/\/stripe.com\/docs\/billing\/pending-updates-reference\#supported-attributes).
    --
    -- Use \`error_if_incomplete\` if you want Stripe to return an HTTP 402 status code if a subscription\'s invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https:\/\/stripe.com\/docs\/upgrades\#2019-03-14) to learn more.
    PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
postSubscriptionItemsItemRequestBodyPaymentBehavior :: (GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'),
    -- | price: The ID of the price object.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostSubscriptionItemsItemRequestBody -> Maybe Text
postSubscriptionItemsItemRequestBodyPrice :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | price_data: Data used to generate a new [Price](https:\/\/stripe.com\/docs\/api\/prices) object inline.
    PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
postSubscriptionItemsItemRequestBodyPriceData :: (GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBodyPriceData'),
    -- | proration_behavior: Determines how to handle [prorations](https:\/\/stripe.com\/docs\/subscriptions\/billing-cycle\#prorations) when the billing cycle changes (e.g., when switching plans, resetting \`billing_cycle_anchor=now\`, or starting a trial), or if an item\'s \`quantity\` changes. Valid values are \`create_prorations\`, \`none\`, or \`always_invoice\`.
    --
    -- Passing \`create_prorations\` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https:\/\/stripe.com\/docs\/subscriptions\/upgrading-downgrading\#immediate-payment). In order to always invoice immediately for prorations, pass \`always_invoice\`.
    --
    -- Prorations can be disabled by passing \`none\`.
    PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
postSubscriptionItemsItemRequestBodyProrationBehavior :: (GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'),
    -- | proration_date: If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https:\/\/stripe.com\/docs\/api\#retrieve_customer_invoice) endpoint.
    PostSubscriptionItemsItemRequestBody -> Maybe Int
postSubscriptionItemsItemRequestBodyProrationDate :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | quantity: The quantity you\'d like to apply to the subscription item you\'re creating.
    PostSubscriptionItemsItemRequestBody -> Maybe Int
postSubscriptionItemsItemRequestBodyQuantity :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | tax_rates: A list of [Tax Rate](https:\/\/stripe.com\/docs\/api\/tax_rates) ids. These Tax Rates will override the [\`default_tax_rates\`](https:\/\/stripe.com\/docs\/api\/subscriptions\/create\#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
    PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
postSubscriptionItemsItemRequestBodyTaxRates :: (GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants)
  }
  deriving
    ( Int -> PostSubscriptionItemsItemRequestBody -> String -> String
[PostSubscriptionItemsItemRequestBody] -> String -> String
PostSubscriptionItemsItemRequestBody -> String
(Int -> PostSubscriptionItemsItemRequestBody -> String -> String)
-> (PostSubscriptionItemsItemRequestBody -> String)
-> ([PostSubscriptionItemsItemRequestBody] -> String -> String)
-> Show PostSubscriptionItemsItemRequestBody
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBody] -> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBody] -> String -> String
show :: PostSubscriptionItemsItemRequestBody -> String
$cshow :: PostSubscriptionItemsItemRequestBody -> String
showsPrec :: Int -> PostSubscriptionItemsItemRequestBody -> String -> String
$cshowsPrec :: Int -> PostSubscriptionItemsItemRequestBody -> String -> String
GHC.Show.Show,
      PostSubscriptionItemsItemRequestBody
-> PostSubscriptionItemsItemRequestBody -> Bool
(PostSubscriptionItemsItemRequestBody
 -> PostSubscriptionItemsItemRequestBody -> Bool)
-> (PostSubscriptionItemsItemRequestBody
    -> PostSubscriptionItemsItemRequestBody -> Bool)
-> Eq PostSubscriptionItemsItemRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBody
-> PostSubscriptionItemsItemRequestBody -> Bool
$c/= :: PostSubscriptionItemsItemRequestBody
-> PostSubscriptionItemsItemRequestBody -> Bool
== :: PostSubscriptionItemsItemRequestBody
-> PostSubscriptionItemsItemRequestBody -> Bool
$c== :: PostSubscriptionItemsItemRequestBody
-> PostSubscriptionItemsItemRequestBody -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBody where
  toJSON :: PostSubscriptionItemsItemRequestBody -> Value
toJSON PostSubscriptionItemsItemRequestBody
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"billing_thresholds" Text
-> Maybe
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
postSubscriptionItemsItemRequestBodyBillingThresholds PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"expand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe [Text]
postSubscriptionItemsItemRequestBodyExpand PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text
-> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
postSubscriptionItemsItemRequestBodyMetadata PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"off_session" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Bool
postSubscriptionItemsItemRequestBodyOffSession PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"payment_behavior" Text
-> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
postSubscriptionItemsItemRequestBodyPaymentBehavior PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"price" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Text
postSubscriptionItemsItemRequestBodyPrice PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"price_data" Text
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
postSubscriptionItemsItemRequestBodyPriceData PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"proration_behavior" Text
-> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
postSubscriptionItemsItemRequestBodyProrationBehavior PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"proration_date" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Int
postSubscriptionItemsItemRequestBodyProrationDate PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"quantity" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Int
postSubscriptionItemsItemRequestBodyQuantity PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_rates" Text
-> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
postSubscriptionItemsItemRequestBodyTaxRates PostSubscriptionItemsItemRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostSubscriptionItemsItemRequestBody -> Encoding
toEncoding PostSubscriptionItemsItemRequestBody
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"billing_thresholds" Text
-> Maybe
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
postSubscriptionItemsItemRequestBodyBillingThresholds PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"expand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe [Text]
postSubscriptionItemsItemRequestBodyExpand PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text
-> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
postSubscriptionItemsItemRequestBodyMetadata PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"off_session" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Bool
postSubscriptionItemsItemRequestBodyOffSession PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"payment_behavior" Text
-> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
postSubscriptionItemsItemRequestBodyPaymentBehavior PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"price" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Text
postSubscriptionItemsItemRequestBodyPrice PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"price_data" Text
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
postSubscriptionItemsItemRequestBodyPriceData PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"proration_behavior" Text
-> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
postSubscriptionItemsItemRequestBodyProrationBehavior PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"proration_date" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Int
postSubscriptionItemsItemRequestBodyProrationDate PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"quantity" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody -> Maybe Int
postSubscriptionItemsItemRequestBodyQuantity PostSubscriptionItemsItemRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"tax_rates" Text
-> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBody
-> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
postSubscriptionItemsItemRequestBodyTaxRates PostSubscriptionItemsItemRequestBody
obj)))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBody where
  parseJSON :: Value -> Parser PostSubscriptionItemsItemRequestBody
parseJSON = String
-> (Object -> Parser PostSubscriptionItemsItemRequestBody)
-> Value
-> Parser PostSubscriptionItemsItemRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsItemRequestBody" (\Object
obj -> (((((((((((Maybe
   PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
 -> Maybe [Text]
 -> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
 -> Maybe Bool
 -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
 -> Maybe Text
 -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
 -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
 -> Maybe Int
 -> Maybe Int
 -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
 -> PostSubscriptionItemsItemRequestBody)
-> Parser
     (Maybe
        PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
      -> Maybe [Text]
      -> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
      -> Maybe Bool
      -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
      -> Maybe Text
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
      -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe
  PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Maybe [Text]
-> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Maybe Bool
-> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
-> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> PostSubscriptionItemsItemRequestBody
PostSubscriptionItemsItemRequestBody Parser
  (Maybe
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
   -> Maybe [Text]
   -> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
   -> Maybe Bool
   -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
   -> Maybe Text
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
   -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser
     (Maybe
        PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants)
-> Parser
     (Maybe [Text]
      -> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
      -> Maybe Bool
      -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
      -> Maybe Text
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
      -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe
        PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"billing_thresholds")) Parser
  (Maybe [Text]
   -> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
   -> Maybe Bool
   -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
   -> Maybe Text
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
   -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser (Maybe [Text])
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
      -> Maybe Bool
      -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
      -> Maybe Text
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
      -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"expand")) Parser
  (Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
   -> Maybe Bool
   -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
   -> Maybe Text
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
   -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants)
-> Parser
     (Maybe Bool
      -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
      -> Maybe Text
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
      -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser
  (Maybe Bool
   -> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
   -> Maybe Text
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
   -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser (Maybe Bool)
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
      -> Maybe Text
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
      -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"off_session")) Parser
  (Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
   -> Maybe Text
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
   -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior')
-> Parser
     (Maybe Text
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
      -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"payment_behavior")) Parser
  (Maybe Text
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
   -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser (Maybe Text)
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyPriceData'
      -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"price")) Parser
  (Maybe PostSubscriptionItemsItemRequestBodyPriceData'
   -> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser (Maybe PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
      -> Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PostSubscriptionItemsItemRequestBodyPriceData')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"price_data")) Parser
  (Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
   -> Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior')
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"proration_behavior")) Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"proration_date")) Parser
  (Maybe Int
   -> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser (Maybe Int)
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
      -> PostSubscriptionItemsItemRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"quantity")) Parser
  (Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
   -> PostSubscriptionItemsItemRequestBody)
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants)
-> Parser PostSubscriptionItemsItemRequestBody
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tax_rates"))

-- | Create a new 'PostSubscriptionItemsItemRequestBody' with all required fields.
mkPostSubscriptionItemsItemRequestBody :: PostSubscriptionItemsItemRequestBody
mkPostSubscriptionItemsItemRequestBody :: PostSubscriptionItemsItemRequestBody
mkPostSubscriptionItemsItemRequestBody =
  PostSubscriptionItemsItemRequestBody :: Maybe
  PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Maybe [Text]
-> Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Maybe Bool
-> Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'
-> Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> PostSubscriptionItemsItemRequestBody
PostSubscriptionItemsItemRequestBody
    { postSubscriptionItemsItemRequestBodyBillingThresholds :: Maybe
  PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
postSubscriptionItemsItemRequestBodyBillingThresholds = Maybe
  PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyExpand :: Maybe [Text]
postSubscriptionItemsItemRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyMetadata :: Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
postSubscriptionItemsItemRequestBodyMetadata = Maybe PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyOffSession :: Maybe Bool
postSubscriptionItemsItemRequestBodyOffSession = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyPaymentBehavior :: Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
postSubscriptionItemsItemRequestBodyPaymentBehavior = Maybe PostSubscriptionItemsItemRequestBodyPaymentBehavior'
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyPrice :: Maybe Text
postSubscriptionItemsItemRequestBodyPrice = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyPriceData :: Maybe PostSubscriptionItemsItemRequestBodyPriceData'
postSubscriptionItemsItemRequestBodyPriceData = Maybe PostSubscriptionItemsItemRequestBodyPriceData'
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyProrationBehavior :: Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
postSubscriptionItemsItemRequestBodyProrationBehavior = Maybe PostSubscriptionItemsItemRequestBodyProrationBehavior'
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyProrationDate :: Maybe Int
postSubscriptionItemsItemRequestBodyProrationDate = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyQuantity :: Maybe Int
postSubscriptionItemsItemRequestBodyQuantity = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyTaxRates :: Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
postSubscriptionItemsItemRequestBodyTaxRates = Maybe PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.billing_thresholds.anyOf@ in the specification.
data PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 = PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
  { -- | usage_gte
    PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 -> Int
postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte :: GHC.Types.Int
  }
  deriving
    ( Int
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> String
-> String
[PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1]
-> String -> String
PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> String
(Int
 -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1]
    -> String -> String)
-> Show
     PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1]
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1]
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> String
$cshow :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> String
-> String
GHC.Show.Show,
      PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Bool
(PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
 -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
 -> Bool)
-> (PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
    -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
    -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Bool
== :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Bool
$c== :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 where
  toJSON :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Value
toJSON PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"usage_gte" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 -> Int
postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Encoding
toEncoding PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs (Text
"usage_gte" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 -> Int
postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
obj)

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 where
  parseJSON :: Value
-> Parser
     PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
parseJSON = String
-> (Object
    -> Parser
         PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1)
-> Value
-> Parser
     PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1" (\Object
obj -> (Int
 -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1)
-> Parser
     (Int
      -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 Parser
  (Int
   -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1)
-> Parser Int
-> Parser
     PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"usage_gte"))

-- | Create a new 'PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1' with all required fields.
mkPostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 ::
  -- | 'postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte'
  GHC.Types.Int ->
  PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
mkPostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 :: Int -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
mkPostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 Int
postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte = PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 :: Int -> PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 {postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte :: Int
postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte = Int
postSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1UsageGte}

-- | Defines the oneOf schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.billing_thresholds.anyOf@ in the specification.
--
-- Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
data PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
  = -- | Represents the JSON value @""@
    PostSubscriptionItemsItemRequestBodyBillingThresholds'EmptyString
  | PostSubscriptionItemsItemRequestBodyBillingThresholds'PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
  deriving (Int
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> String
-> String
[PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants]
-> String -> String
PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> String
(Int
 -> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants]
    -> String -> String)
-> Show
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants]
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants]
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> String
$cshow :: PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> String
-> String
GHC.Show.Show, PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Bool
(PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
 -> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
 -> Bool)
-> (PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
    -> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
    -> Bool)
-> Eq
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Bool
== :: PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Bool
$c== :: PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants where
  toJSON :: PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Value
toJSON (PostSubscriptionItemsItemRequestBodyBillingThresholds'PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
a) = PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
a
  toJSON (PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
PostSubscriptionItemsItemRequestBodyBillingThresholds'EmptyString) = Value
""

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants where
  parseJSON :: Value
-> Parser
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
parseJSON Value
val =
    if
        | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Parser
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
PostSubscriptionItemsItemRequestBodyBillingThresholds'EmptyString
        | Bool
GHC.Base.otherwise -> case (PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
PostSubscriptionItemsItemRequestBodyBillingThresholds'PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1 (PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
 -> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants)
-> Result
     PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
-> Result
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value
-> Result
     PostSubscriptionItemsItemRequestBodyBillingThresholds'OneOf1
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result
  PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Result
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Result
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
          Data.Aeson.Types.Internal.Success PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
a -> PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
-> Parser
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
a
          Data.Aeson.Types.Internal.Error String
a -> String
-> Parser
     PostSubscriptionItemsItemRequestBodyBillingThresholds'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the oneOf schema located at @paths.\/v1\/subscription_items\/{item}.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 PostSubscriptionItemsItemRequestBodyMetadata'Variants
  = -- | Represents the JSON value @""@
    PostSubscriptionItemsItemRequestBodyMetadata'EmptyString
  | PostSubscriptionItemsItemRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object
  deriving (Int
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> String
-> String
[PostSubscriptionItemsItemRequestBodyMetadata'Variants]
-> String -> String
PostSubscriptionItemsItemRequestBodyMetadata'Variants -> String
(Int
 -> PostSubscriptionItemsItemRequestBodyMetadata'Variants
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyMetadata'Variants
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyMetadata'Variants]
    -> String -> String)
-> Show PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyMetadata'Variants]
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyMetadata'Variants]
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyMetadata'Variants -> String
$cshow :: PostSubscriptionItemsItemRequestBodyMetadata'Variants -> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> String
-> String
GHC.Show.Show, PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Bool
(PostSubscriptionItemsItemRequestBodyMetadata'Variants
 -> PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Bool)
-> (PostSubscriptionItemsItemRequestBodyMetadata'Variants
    -> PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Bool
== :: PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Bool
$c== :: PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyMetadata'Variants where
  toJSON :: PostSubscriptionItemsItemRequestBodyMetadata'Variants -> Value
toJSON (PostSubscriptionItemsItemRequestBodyMetadata'Object Object
a) = Object -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Object
a
  toJSON (PostSubscriptionItemsItemRequestBodyMetadata'Variants
PostSubscriptionItemsItemRequestBodyMetadata'EmptyString) = Value
""

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyMetadata'Variants where
  parseJSON :: Value
-> Parser PostSubscriptionItemsItemRequestBodyMetadata'Variants
parseJSON Value
val =
    if
        | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Parser PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsItemRequestBodyMetadata'Variants
PostSubscriptionItemsItemRequestBodyMetadata'EmptyString
        | Bool
GHC.Base.otherwise -> case (Object -> PostSubscriptionItemsItemRequestBodyMetadata'Variants
PostSubscriptionItemsItemRequestBodyMetadata'Object (Object -> PostSubscriptionItemsItemRequestBodyMetadata'Variants)
-> Result Object
-> Result PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Object
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Result PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Result PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
          Data.Aeson.Types.Internal.Success PostSubscriptionItemsItemRequestBodyMetadata'Variants
a -> PostSubscriptionItemsItemRequestBodyMetadata'Variants
-> Parser PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsItemRequestBodyMetadata'Variants
a
          Data.Aeson.Types.Internal.Error String
a -> String
-> Parser PostSubscriptionItemsItemRequestBodyMetadata'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the enum schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.payment_behavior@ in the specification.
--
-- Use \`allow_incomplete\` to transition the subscription to \`status=past_due\` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription\'s invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication) for Billing to learn more. This is the default behavior.
--
-- Use \`default_incomplete\` to transition the subscription to \`status=past_due\` when payment is required and await explicit confirmation of the invoice\'s payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https:\/\/stripe.com\/docs\/billing\/migration\/strong-customer-authentication), or collecting a mandate for a bank debit payment method.
--
-- Use \`pending_if_incomplete\` to update the subscription using [pending updates](https:\/\/stripe.com\/docs\/billing\/subscriptions\/pending-updates). When you use \`pending_if_incomplete\` you can only pass the parameters [supported by pending updates](https:\/\/stripe.com\/docs\/billing\/pending-updates-reference\#supported-attributes).
--
-- Use \`error_if_incomplete\` if you want Stripe to return an HTTP 402 status code if a subscription\'s invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https:\/\/stripe.com\/docs\/upgrades\#2019-03-14) to learn more.
data PostSubscriptionItemsItemRequestBodyPaymentBehavior'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PostSubscriptionItemsItemRequestBodyPaymentBehavior'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.
    PostSubscriptionItemsItemRequestBodyPaymentBehavior'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"allow_incomplete"@
    PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumAllowIncomplete
  | -- | Represents the JSON value @"default_incomplete"@
    PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumDefaultIncomplete
  | -- | Represents the JSON value @"error_if_incomplete"@
    PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumErrorIfIncomplete
  | -- | Represents the JSON value @"pending_if_incomplete"@
    PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumPendingIfIncomplete
  deriving (Int
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> String
-> String
[PostSubscriptionItemsItemRequestBodyPaymentBehavior']
-> String -> String
PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> String
(Int
 -> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> String)
-> ([PostSubscriptionItemsItemRequestBodyPaymentBehavior']
    -> String -> String)
-> Show PostSubscriptionItemsItemRequestBodyPaymentBehavior'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyPaymentBehavior']
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyPaymentBehavior']
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> String
$cshow :: PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> String
-> String
GHC.Show.Show, PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Bool
(PostSubscriptionItemsItemRequestBodyPaymentBehavior'
 -> PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Bool)
-> (PostSubscriptionItemsItemRequestBodyPaymentBehavior'
    -> PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyPaymentBehavior'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Bool
== :: PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Bool
$c== :: PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyPaymentBehavior' where
  toJSON :: PostSubscriptionItemsItemRequestBodyPaymentBehavior' -> Value
toJSON (PostSubscriptionItemsItemRequestBodyPaymentBehavior'Other Value
val) = Value
val
  toJSON (PostSubscriptionItemsItemRequestBodyPaymentBehavior'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumAllowIncomplete) = Value
"allow_incomplete"
  toJSON (PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumDefaultIncomplete) = Value
"default_incomplete"
  toJSON (PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumErrorIfIncomplete) = Value
"error_if_incomplete"
  toJSON (PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumPendingIfIncomplete) = Value
"pending_if_incomplete"

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyPaymentBehavior' where
  parseJSON :: Value
-> Parser PostSubscriptionItemsItemRequestBodyPaymentBehavior'
parseJSON Value
val =
    PostSubscriptionItemsItemRequestBodyPaymentBehavior'
-> Parser PostSubscriptionItemsItemRequestBodyPaymentBehavior'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"allow_incomplete" -> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumAllowIncomplete
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"default_incomplete" -> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumDefaultIncomplete
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"error_if_incomplete" -> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumErrorIfIncomplete
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pending_if_incomplete" -> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'EnumPendingIfIncomplete
            | Bool
GHC.Base.otherwise -> Value -> PostSubscriptionItemsItemRequestBodyPaymentBehavior'
PostSubscriptionItemsItemRequestBodyPaymentBehavior'Other Value
val
      )

-- | Defines the object schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.price_data@ in the specification.
--
-- Data used to generate a new [Price](https:\/\/stripe.com\/docs\/api\/prices) object inline.
data PostSubscriptionItemsItemRequestBodyPriceData' = PostSubscriptionItemsItemRequestBodyPriceData'
  { -- | currency
    PostSubscriptionItemsItemRequestBodyPriceData' -> Text
postSubscriptionItemsItemRequestBodyPriceData'Currency :: Data.Text.Internal.Text,
    -- | product
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    PostSubscriptionItemsItemRequestBodyPriceData' -> Text
postSubscriptionItemsItemRequestBodyPriceData'Product :: Data.Text.Internal.Text,
    -- | recurring
    PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
postSubscriptionItemsItemRequestBodyPriceData'Recurring :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring',
    -- | tax_behavior
    PostSubscriptionItemsItemRequestBodyPriceData'
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsItemRequestBodyPriceData'TaxBehavior :: (GHC.Maybe.Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'),
    -- | unit_amount
    PostSubscriptionItemsItemRequestBodyPriceData' -> Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | unit_amount_decimal
    PostSubscriptionItemsItemRequestBodyPriceData' -> Maybe Text
postSubscriptionItemsItemRequestBodyPriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int
-> PostSubscriptionItemsItemRequestBodyPriceData'
-> String
-> String
[PostSubscriptionItemsItemRequestBodyPriceData']
-> String -> String
PostSubscriptionItemsItemRequestBodyPriceData' -> String
(Int
 -> PostSubscriptionItemsItemRequestBodyPriceData'
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyPriceData' -> String)
-> ([PostSubscriptionItemsItemRequestBodyPriceData']
    -> String -> String)
-> Show PostSubscriptionItemsItemRequestBodyPriceData'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyPriceData']
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyPriceData']
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyPriceData' -> String
$cshow :: PostSubscriptionItemsItemRequestBodyPriceData' -> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'
-> String
-> String
GHC.Show.Show,
      PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData' -> Bool
(PostSubscriptionItemsItemRequestBodyPriceData'
 -> PostSubscriptionItemsItemRequestBodyPriceData' -> Bool)
-> (PostSubscriptionItemsItemRequestBodyPriceData'
    -> PostSubscriptionItemsItemRequestBodyPriceData' -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyPriceData'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData' -> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData' -> Bool
== :: PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData' -> Bool
$c== :: PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyPriceData' where
  toJSON :: PostSubscriptionItemsItemRequestBodyPriceData' -> Value
toJSON PostSubscriptionItemsItemRequestBodyPriceData'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"currency" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Text
postSubscriptionItemsItemRequestBodyPriceData'Currency PostSubscriptionItemsItemRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"product" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Text
postSubscriptionItemsItemRequestBodyPriceData'Product PostSubscriptionItemsItemRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"recurring" Text
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
postSubscriptionItemsItemRequestBodyPriceData'Recurring PostSubscriptionItemsItemRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_behavior" Text
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsItemRequestBodyPriceData'TaxBehavior PostSubscriptionItemsItemRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"unit_amount" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'UnitAmount PostSubscriptionItemsItemRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"unit_amount_decimal" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Maybe Text
postSubscriptionItemsItemRequestBodyPriceData'UnitAmountDecimal PostSubscriptionItemsItemRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostSubscriptionItemsItemRequestBodyPriceData' -> Encoding
toEncoding PostSubscriptionItemsItemRequestBodyPriceData'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"currency" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Text
postSubscriptionItemsItemRequestBodyPriceData'Currency PostSubscriptionItemsItemRequestBodyPriceData'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"product" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Text
postSubscriptionItemsItemRequestBodyPriceData'Product PostSubscriptionItemsItemRequestBodyPriceData'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"recurring" Text
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
postSubscriptionItemsItemRequestBodyPriceData'Recurring PostSubscriptionItemsItemRequestBodyPriceData'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tax_behavior" Text
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsItemRequestBodyPriceData'TaxBehavior PostSubscriptionItemsItemRequestBodyPriceData'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"unit_amount" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'UnitAmount PostSubscriptionItemsItemRequestBodyPriceData'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"unit_amount_decimal" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData' -> Maybe Text
postSubscriptionItemsItemRequestBodyPriceData'UnitAmountDecimal PostSubscriptionItemsItemRequestBodyPriceData'
obj))))))

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyPriceData' where
  parseJSON :: Value -> Parser PostSubscriptionItemsItemRequestBodyPriceData'
parseJSON = String
-> (Object
    -> Parser PostSubscriptionItemsItemRequestBodyPriceData')
-> Value
-> Parser PostSubscriptionItemsItemRequestBodyPriceData'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsItemRequestBodyPriceData'" (\Object
obj -> ((((((Text
 -> Text
 -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
 -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
 -> Maybe Int
 -> Maybe Text
 -> PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser
     (Text
      -> Text
      -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
      -> Maybe Int
      -> Maybe Text
      -> PostSubscriptionItemsItemRequestBodyPriceData')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text
-> Text
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsItemRequestBodyPriceData'
PostSubscriptionItemsItemRequestBodyPriceData' Parser
  (Text
   -> Text
   -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
   -> Maybe Int
   -> Maybe Text
   -> PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser Text
-> Parser
     (Text
      -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
      -> Maybe Int
      -> Maybe Text
      -> PostSubscriptionItemsItemRequestBodyPriceData')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"currency")) Parser
  (Text
   -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
   -> Maybe Int
   -> Maybe Text
   -> PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser Text
-> Parser
     (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
      -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
      -> Maybe Int
      -> Maybe Text
      -> PostSubscriptionItemsItemRequestBodyPriceData')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"product")) Parser
  (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
   -> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
   -> Maybe Int
   -> Maybe Text
   -> PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
      -> Maybe Int
      -> Maybe Text
      -> PostSubscriptionItemsItemRequestBodyPriceData')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"recurring")) Parser
  (Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
   -> Maybe Int
   -> Maybe Text
   -> PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior')
-> Parser
     (Maybe Int
      -> Maybe Text -> PostSubscriptionItemsItemRequestBodyPriceData')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tax_behavior")) Parser
  (Maybe Int
   -> Maybe Text -> PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser (Maybe Int)
-> Parser
     (Maybe Text -> PostSubscriptionItemsItemRequestBodyPriceData')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"unit_amount")) Parser
  (Maybe Text -> PostSubscriptionItemsItemRequestBodyPriceData')
-> Parser (Maybe Text)
-> Parser PostSubscriptionItemsItemRequestBodyPriceData'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"unit_amount_decimal"))

-- | Create a new 'PostSubscriptionItemsItemRequestBodyPriceData'' with all required fields.
mkPostSubscriptionItemsItemRequestBodyPriceData' ::
  -- | 'postSubscriptionItemsItemRequestBodyPriceData'Currency'
  Data.Text.Internal.Text ->
  -- | 'postSubscriptionItemsItemRequestBodyPriceData'Product'
  Data.Text.Internal.Text ->
  -- | 'postSubscriptionItemsItemRequestBodyPriceData'Recurring'
  PostSubscriptionItemsItemRequestBodyPriceData'Recurring' ->
  PostSubscriptionItemsItemRequestBodyPriceData'
mkPostSubscriptionItemsItemRequestBodyPriceData' :: Text
-> Text
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'
mkPostSubscriptionItemsItemRequestBodyPriceData' Text
postSubscriptionItemsItemRequestBodyPriceData'Currency Text
postSubscriptionItemsItemRequestBodyPriceData'Product PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
postSubscriptionItemsItemRequestBodyPriceData'Recurring =
  PostSubscriptionItemsItemRequestBodyPriceData' :: Text
-> Text
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsItemRequestBodyPriceData'
PostSubscriptionItemsItemRequestBodyPriceData'
    { postSubscriptionItemsItemRequestBodyPriceData'Currency :: Text
postSubscriptionItemsItemRequestBodyPriceData'Currency = Text
postSubscriptionItemsItemRequestBodyPriceData'Currency,
      postSubscriptionItemsItemRequestBodyPriceData'Product :: Text
postSubscriptionItemsItemRequestBodyPriceData'Product = Text
postSubscriptionItemsItemRequestBodyPriceData'Product,
      postSubscriptionItemsItemRequestBodyPriceData'Recurring :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
postSubscriptionItemsItemRequestBodyPriceData'Recurring = PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
postSubscriptionItemsItemRequestBodyPriceData'Recurring,
      postSubscriptionItemsItemRequestBodyPriceData'TaxBehavior :: Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsItemRequestBodyPriceData'TaxBehavior = Maybe PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyPriceData'UnitAmount :: Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'UnitAmount = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      postSubscriptionItemsItemRequestBodyPriceData'UnitAmountDecimal :: Maybe Text
postSubscriptionItemsItemRequestBodyPriceData'UnitAmountDecimal = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.price_data.properties.recurring@ in the specification.
data PostSubscriptionItemsItemRequestBodyPriceData'Recurring' = PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
  { -- | interval
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval',
    -- | interval_count
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'Recurring'IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> String
-> String
[PostSubscriptionItemsItemRequestBodyPriceData'Recurring']
-> String -> String
PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> String
(Int
 -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyPriceData'Recurring']
    -> String -> String)
-> Show PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyPriceData'Recurring']
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyPriceData'Recurring']
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> String
$cshow :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> String
-> String
GHC.Show.Show,
      PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> Bool
(PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
 -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
 -> Bool)
-> (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
    -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
    -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> Bool
== :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> Bool
$c== :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyPriceData'Recurring' where
  toJSON :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring' -> Value
toJSON PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"interval" Text
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"interval_count" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'Recurring'IntervalCount PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Encoding
toEncoding PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"interval" Text
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"interval_count" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
-> Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'Recurring'IntervalCount PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
obj))

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyPriceData'Recurring' where
  parseJSON :: Value
-> Parser PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
parseJSON = String
-> (Object
    -> Parser PostSubscriptionItemsItemRequestBodyPriceData'Recurring')
-> Value
-> Parser PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsItemRequestBodyPriceData'Recurring'" (\Object
obj -> ((PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
 -> Maybe Int
 -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring')
-> Parser
     (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
      -> Maybe Int
      -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Maybe Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring' Parser
  (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
   -> Maybe Int
   -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring')
-> Parser
     PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Parser
     (Maybe Int
      -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"interval")) Parser
  (Maybe Int
   -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring')
-> Parser (Maybe Int)
-> Parser PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"interval_count"))

-- | Create a new 'PostSubscriptionItemsItemRequestBodyPriceData'Recurring'' with all required fields.
mkPostSubscriptionItemsItemRequestBodyPriceData'Recurring' ::
  -- | 'postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
  PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval' ->
  PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
mkPostSubscriptionItemsItemRequestBodyPriceData'Recurring' :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
mkPostSubscriptionItemsItemRequestBodyPriceData'Recurring' PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval =
  PostSubscriptionItemsItemRequestBodyPriceData'Recurring' :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Maybe Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'
    { postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval = PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval,
      postSubscriptionItemsItemRequestBodyPriceData'Recurring'IntervalCount :: Maybe Int
postSubscriptionItemsItemRequestBodyPriceData'Recurring'IntervalCount = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the enum schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.price_data.properties.recurring.properties.interval@ in the specification.
data PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'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.
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"day"@
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumDay
  | -- | Represents the JSON value @"month"@
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumMonth
  | -- | Represents the JSON value @"week"@
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumWeek
  | -- | Represents the JSON value @"year"@
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumYear
  deriving (Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> String
-> String
[PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval']
-> String -> String
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> String
(Int
 -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval']
    -> String -> String)
-> Show
     PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval']
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval']
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> String
$cshow :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> String
-> String
GHC.Show.Show, PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Bool
(PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
 -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
 -> Bool)
-> (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
    -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
    -> Bool)
-> Eq
     PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Bool
== :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Bool
$c== :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval' where
  toJSON :: PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Value
toJSON (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'Other Value
val) = Value
val
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumDay) = Value
"day"
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumMonth) = Value
"month"
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumWeek) = Value
"week"
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumYear) = Value
"year"

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval' where
  parseJSON :: Value
-> Parser
     PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
parseJSON Value
val =
    PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
-> Parser
     PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"day" -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumDay
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"month" -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumMonth
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"week" -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumWeek
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"year" -> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'EnumYear
            | Bool
GHC.Base.otherwise -> Value
-> PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsItemRequestBodyPriceData'Recurring'Interval'Other Value
val
      )

-- | Defines the enum schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.price_data.properties.tax_behavior@ in the specification.
data PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'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.
    PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"exclusive"@
    PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumExclusive
  | -- | Represents the JSON value @"inclusive"@
    PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumInclusive
  | -- | Represents the JSON value @"unspecified"@
    PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumUnspecified
  deriving (Int
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> String
-> String
[PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior']
-> String -> String
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> String
(Int
 -> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior']
    -> String -> String)
-> Show PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior']
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior']
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> String
$cshow :: PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> String
-> String
GHC.Show.Show, PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Bool
(PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
 -> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
 -> Bool)
-> (PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
    -> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
    -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Bool
== :: PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Bool
$c== :: PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior' where
  toJSON :: PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior' -> Value
toJSON (PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'Other Value
val) = Value
val
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumExclusive) = Value
"exclusive"
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumInclusive) = Value
"inclusive"
  toJSON (PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumUnspecified) = Value
"unspecified"

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior' where
  parseJSON :: Value
-> Parser
     PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
parseJSON Value
val =
    PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
-> Parser
     PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"exclusive" -> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumExclusive
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"inclusive" -> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumInclusive
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unspecified" -> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'EnumUnspecified
            | Bool
GHC.Base.otherwise -> Value -> PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsItemRequestBodyPriceData'TaxBehavior'Other Value
val
      )

-- | Defines the enum schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.proration_behavior@ in the specification.
--
-- Determines how to handle [prorations](https:\/\/stripe.com\/docs\/subscriptions\/billing-cycle\#prorations) when the billing cycle changes (e.g., when switching plans, resetting \`billing_cycle_anchor=now\`, or starting a trial), or if an item\'s \`quantity\` changes. Valid values are \`create_prorations\`, \`none\`, or \`always_invoice\`.
--
-- Passing \`create_prorations\` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https:\/\/stripe.com\/docs\/subscriptions\/upgrading-downgrading\#immediate-payment). In order to always invoice immediately for prorations, pass \`always_invoice\`.
--
-- Prorations can be disabled by passing \`none\`.
data PostSubscriptionItemsItemRequestBodyProrationBehavior'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PostSubscriptionItemsItemRequestBodyProrationBehavior'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.
    PostSubscriptionItemsItemRequestBodyProrationBehavior'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"always_invoice"@
    PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumAlwaysInvoice
  | -- | Represents the JSON value @"create_prorations"@
    PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumCreateProrations
  | -- | Represents the JSON value @"none"@
    PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumNone
  deriving (Int
-> PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> String
-> String
[PostSubscriptionItemsItemRequestBodyProrationBehavior']
-> String -> String
PostSubscriptionItemsItemRequestBodyProrationBehavior' -> String
(Int
 -> PostSubscriptionItemsItemRequestBodyProrationBehavior'
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyProrationBehavior'
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyProrationBehavior']
    -> String -> String)
-> Show PostSubscriptionItemsItemRequestBodyProrationBehavior'
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyProrationBehavior']
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyProrationBehavior']
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyProrationBehavior' -> String
$cshow :: PostSubscriptionItemsItemRequestBodyProrationBehavior' -> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> String
-> String
GHC.Show.Show, PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Bool
(PostSubscriptionItemsItemRequestBodyProrationBehavior'
 -> PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Bool)
-> (PostSubscriptionItemsItemRequestBodyProrationBehavior'
    -> PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyProrationBehavior'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Bool
== :: PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Bool
$c== :: PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyProrationBehavior' where
  toJSON :: PostSubscriptionItemsItemRequestBodyProrationBehavior' -> Value
toJSON (PostSubscriptionItemsItemRequestBodyProrationBehavior'Other Value
val) = Value
val
  toJSON (PostSubscriptionItemsItemRequestBodyProrationBehavior'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PostSubscriptionItemsItemRequestBodyProrationBehavior'
PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumAlwaysInvoice) = Value
"always_invoice"
  toJSON (PostSubscriptionItemsItemRequestBodyProrationBehavior'
PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumCreateProrations) = Value
"create_prorations"
  toJSON (PostSubscriptionItemsItemRequestBodyProrationBehavior'
PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumNone) = Value
"none"

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyProrationBehavior' where
  parseJSON :: Value
-> Parser PostSubscriptionItemsItemRequestBodyProrationBehavior'
parseJSON Value
val =
    PostSubscriptionItemsItemRequestBodyProrationBehavior'
-> Parser PostSubscriptionItemsItemRequestBodyProrationBehavior'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"always_invoice" -> PostSubscriptionItemsItemRequestBodyProrationBehavior'
PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumAlwaysInvoice
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"create_prorations" -> PostSubscriptionItemsItemRequestBodyProrationBehavior'
PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumCreateProrations
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"none" -> PostSubscriptionItemsItemRequestBodyProrationBehavior'
PostSubscriptionItemsItemRequestBodyProrationBehavior'EnumNone
            | Bool
GHC.Base.otherwise -> Value -> PostSubscriptionItemsItemRequestBodyProrationBehavior'
PostSubscriptionItemsItemRequestBodyProrationBehavior'Other Value
val
      )

-- | Defines the oneOf schema located at @paths.\/v1\/subscription_items\/{item}.POST.requestBody.content.application\/x-www-form-urlencoded.schema.properties.tax_rates.anyOf@ in the specification.
--
-- A list of [Tax Rate](https:\/\/stripe.com\/docs\/api\/tax_rates) ids. These Tax Rates will override the [\`default_tax_rates\`](https:\/\/stripe.com\/docs\/api\/subscriptions\/create\#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates.
data PostSubscriptionItemsItemRequestBodyTaxRates'Variants
  = -- | Represents the JSON value @""@
    PostSubscriptionItemsItemRequestBodyTaxRates'EmptyString
  | PostSubscriptionItemsItemRequestBodyTaxRates'ListTText ([Data.Text.Internal.Text])
  deriving (Int
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> String
-> String
[PostSubscriptionItemsItemRequestBodyTaxRates'Variants]
-> String -> String
PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> String
(Int
 -> PostSubscriptionItemsItemRequestBodyTaxRates'Variants
 -> String
 -> String)
-> (PostSubscriptionItemsItemRequestBodyTaxRates'Variants
    -> String)
-> ([PostSubscriptionItemsItemRequestBodyTaxRates'Variants]
    -> String -> String)
-> Show PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemRequestBodyTaxRates'Variants]
-> String -> String
$cshowList :: [PostSubscriptionItemsItemRequestBodyTaxRates'Variants]
-> String -> String
show :: PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> String
$cshow :: PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> String
showsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> String
-> String
$cshowsPrec :: Int
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> String
-> String
GHC.Show.Show, PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Bool
(PostSubscriptionItemsItemRequestBodyTaxRates'Variants
 -> PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Bool)
-> (PostSubscriptionItemsItemRequestBodyTaxRates'Variants
    -> PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Bool)
-> Eq PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Bool
$c/= :: PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Bool
== :: PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Bool
$c== :: PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsItemRequestBodyTaxRates'Variants where
  toJSON :: PostSubscriptionItemsItemRequestBodyTaxRates'Variants -> Value
toJSON (PostSubscriptionItemsItemRequestBodyTaxRates'ListTText [Text]
a) = [Text] -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON [Text]
a
  toJSON (PostSubscriptionItemsItemRequestBodyTaxRates'Variants
PostSubscriptionItemsItemRequestBodyTaxRates'EmptyString) = Value
""

instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsItemRequestBodyTaxRates'Variants where
  parseJSON :: Value
-> Parser PostSubscriptionItemsItemRequestBodyTaxRates'Variants
parseJSON Value
val =
    if
        | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> Parser PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsItemRequestBodyTaxRates'Variants
PostSubscriptionItemsItemRequestBodyTaxRates'EmptyString
        | Bool
GHC.Base.otherwise -> case ([Text] -> PostSubscriptionItemsItemRequestBodyTaxRates'Variants
PostSubscriptionItemsItemRequestBodyTaxRates'ListTText ([Text] -> PostSubscriptionItemsItemRequestBodyTaxRates'Variants)
-> Result [Text]
-> Result PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result [Text]
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> Result PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> Result PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
          Data.Aeson.Types.Internal.Success PostSubscriptionItemsItemRequestBodyTaxRates'Variants
a -> PostSubscriptionItemsItemRequestBodyTaxRates'Variants
-> Parser PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsItemRequestBodyTaxRates'Variants
a
          Data.Aeson.Types.Internal.Error String
a -> String
-> Parser PostSubscriptionItemsItemRequestBodyTaxRates'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Represents a response of the operation 'postSubscriptionItemsItem'.
--
-- 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), 'PostSubscriptionItemsItemResponseError' is used.
data PostSubscriptionItemsItemResponse
  = -- | Means either no matching case available or a parse error
    PostSubscriptionItemsItemResponseError GHC.Base.String
  | -- | Successful response.
    PostSubscriptionItemsItemResponse200 SubscriptionItem
  | -- | Error response.
    PostSubscriptionItemsItemResponseDefault Error
  deriving (Int -> PostSubscriptionItemsItemResponse -> String -> String
[PostSubscriptionItemsItemResponse] -> String -> String
PostSubscriptionItemsItemResponse -> String
(Int -> PostSubscriptionItemsItemResponse -> String -> String)
-> (PostSubscriptionItemsItemResponse -> String)
-> ([PostSubscriptionItemsItemResponse] -> String -> String)
-> Show PostSubscriptionItemsItemResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostSubscriptionItemsItemResponse] -> String -> String
$cshowList :: [PostSubscriptionItemsItemResponse] -> String -> String
show :: PostSubscriptionItemsItemResponse -> String
$cshow :: PostSubscriptionItemsItemResponse -> String
showsPrec :: Int -> PostSubscriptionItemsItemResponse -> String -> String
$cshowsPrec :: Int -> PostSubscriptionItemsItemResponse -> String -> String
GHC.Show.Show, PostSubscriptionItemsItemResponse
-> PostSubscriptionItemsItemResponse -> Bool
(PostSubscriptionItemsItemResponse
 -> PostSubscriptionItemsItemResponse -> Bool)
-> (PostSubscriptionItemsItemResponse
    -> PostSubscriptionItemsItemResponse -> Bool)
-> Eq PostSubscriptionItemsItemResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsItemResponse
-> PostSubscriptionItemsItemResponse -> Bool
$c/= :: PostSubscriptionItemsItemResponse
-> PostSubscriptionItemsItemResponse -> Bool
== :: PostSubscriptionItemsItemResponse
-> PostSubscriptionItemsItemResponse -> Bool
$c== :: PostSubscriptionItemsItemResponse
-> PostSubscriptionItemsItemResponse -> Bool
GHC.Classes.Eq)