{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Operations.PostSubscriptionItems 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
postSubscriptionItems ::
forall m.
StripeAPI.Common.MonadHTTP m =>
PostSubscriptionItemsRequestBody ->
StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response PostSubscriptionItemsResponse)
postSubscriptionItems :: PostSubscriptionItemsRequestBody
-> StripeT m (Response PostSubscriptionItemsResponse)
postSubscriptionItems PostSubscriptionItemsRequestBody
body =
(Response ByteString -> Response PostSubscriptionItemsResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response PostSubscriptionItemsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( \Response ByteString
response_0 ->
(ByteString -> PostSubscriptionItemsResponse)
-> Response ByteString -> Response PostSubscriptionItemsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( (String -> PostSubscriptionItemsResponse)
-> (PostSubscriptionItemsResponse -> PostSubscriptionItemsResponse)
-> Either String PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostSubscriptionItemsResponse
PostSubscriptionItemsResponseError PostSubscriptionItemsResponse -> PostSubscriptionItemsResponse
forall a. a -> a
GHC.Base.id
(Either String PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse)
-> (ByteString -> Either String PostSubscriptionItemsResponse)
-> ByteString
-> PostSubscriptionItemsResponse
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 -> PostSubscriptionItemsResponse
PostSubscriptionItemsResponse200
(SubscriptionItem -> PostSubscriptionItemsResponse)
-> Either String SubscriptionItem
-> Either String PostSubscriptionItemsResponse
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 -> PostSubscriptionItemsResponse
PostSubscriptionItemsResponseDefault
(Error -> PostSubscriptionItemsResponse)
-> Either String Error
-> Either String PostSubscriptionItemsResponse
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 PostSubscriptionItemsResponse
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 PostSubscriptionItemsRequestBody
-> RequestBodyEncoding
-> StripeT m (Response ByteString)
forall (m :: * -> *) body.
(MonadHTTP m, ToJSON body) =>
Text
-> Text
-> [QueryParameter]
-> Maybe body
-> RequestBodyEncoding
-> StripeT 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") [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty (PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBody
forall a. a -> Maybe a
GHC.Maybe.Just PostSubscriptionItemsRequestBody
body) RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)
data PostSubscriptionItemsRequestBody = PostSubscriptionItemsRequestBody
{
PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
postSubscriptionItemsRequestBodyBillingThresholds :: (GHC.Maybe.Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants),
PostSubscriptionItemsRequestBody -> Maybe [Text]
postSubscriptionItemsRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
PostSubscriptionItemsRequestBody -> Maybe Object
postSubscriptionItemsRequestBodyMetadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
postSubscriptionItemsRequestBodyPaymentBehavior :: (GHC.Maybe.Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'),
PostSubscriptionItemsRequestBody -> Maybe Text
postSubscriptionItemsRequestBodyPrice :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
postSubscriptionItemsRequestBodyPriceData :: (GHC.Maybe.Maybe PostSubscriptionItemsRequestBodyPriceData'),
PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
postSubscriptionItemsRequestBodyProrationBehavior :: (GHC.Maybe.Maybe PostSubscriptionItemsRequestBodyProrationBehavior'),
PostSubscriptionItemsRequestBody -> Maybe Int
postSubscriptionItemsRequestBodyProrationDate :: (GHC.Maybe.Maybe GHC.Types.Int),
PostSubscriptionItemsRequestBody -> Maybe Int
postSubscriptionItemsRequestBodyQuantity :: (GHC.Maybe.Maybe GHC.Types.Int),
PostSubscriptionItemsRequestBody -> Text
postSubscriptionItemsRequestBodySubscription :: Data.Text.Internal.Text,
PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
postSubscriptionItemsRequestBodyTaxRates :: (GHC.Maybe.Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants)
}
deriving
( Int -> PostSubscriptionItemsRequestBody -> ShowS
[PostSubscriptionItemsRequestBody] -> ShowS
PostSubscriptionItemsRequestBody -> String
(Int -> PostSubscriptionItemsRequestBody -> ShowS)
-> (PostSubscriptionItemsRequestBody -> String)
-> ([PostSubscriptionItemsRequestBody] -> ShowS)
-> Show PostSubscriptionItemsRequestBody
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBody] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBody] -> ShowS
show :: PostSubscriptionItemsRequestBody -> String
$cshow :: PostSubscriptionItemsRequestBody -> String
showsPrec :: Int -> PostSubscriptionItemsRequestBody -> ShowS
$cshowsPrec :: Int -> PostSubscriptionItemsRequestBody -> ShowS
GHC.Show.Show,
PostSubscriptionItemsRequestBody
-> PostSubscriptionItemsRequestBody -> Bool
(PostSubscriptionItemsRequestBody
-> PostSubscriptionItemsRequestBody -> Bool)
-> (PostSubscriptionItemsRequestBody
-> PostSubscriptionItemsRequestBody -> Bool)
-> Eq PostSubscriptionItemsRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBody
-> PostSubscriptionItemsRequestBody -> Bool
$c/= :: PostSubscriptionItemsRequestBody
-> PostSubscriptionItemsRequestBody -> Bool
== :: PostSubscriptionItemsRequestBody
-> PostSubscriptionItemsRequestBody -> Bool
$c== :: PostSubscriptionItemsRequestBody
-> PostSubscriptionItemsRequestBody -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBody where
toJSON :: PostSubscriptionItemsRequestBody -> Value
toJSON PostSubscriptionItemsRequestBody
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"billing_thresholds" Text
-> Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
postSubscriptionItemsRequestBodyBillingThresholds PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe [Text]
postSubscriptionItemsRequestBodyExpand PostSubscriptionItemsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Maybe Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody -> Maybe Object
postSubscriptionItemsRequestBodyMetadata PostSubscriptionItemsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"payment_behavior" Text
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
postSubscriptionItemsRequestBodyPaymentBehavior PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe Text
postSubscriptionItemsRequestBodyPrice PostSubscriptionItemsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"price_data" Text -> Maybe PostSubscriptionItemsRequestBodyPriceData' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
postSubscriptionItemsRequestBodyPriceData PostSubscriptionItemsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"proration_behavior" Text
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
postSubscriptionItemsRequestBodyProrationBehavior PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe Int
postSubscriptionItemsRequestBodyProrationDate PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe Int
postSubscriptionItemsRequestBodyQuantity PostSubscriptionItemsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"subscription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody -> Text
postSubscriptionItemsRequestBodySubscription PostSubscriptionItemsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_rates" Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
postSubscriptionItemsRequestBodyTaxRates PostSubscriptionItemsRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PostSubscriptionItemsRequestBody -> Encoding
toEncoding PostSubscriptionItemsRequestBody
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"billing_thresholds" Text
-> Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
postSubscriptionItemsRequestBodyBillingThresholds PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe [Text]
postSubscriptionItemsRequestBodyExpand PostSubscriptionItemsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text -> Maybe Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody -> Maybe Object
postSubscriptionItemsRequestBodyMetadata PostSubscriptionItemsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"payment_behavior" Text
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
postSubscriptionItemsRequestBodyPaymentBehavior PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe Text
postSubscriptionItemsRequestBodyPrice PostSubscriptionItemsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"price_data" Text -> Maybe PostSubscriptionItemsRequestBodyPriceData' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
postSubscriptionItemsRequestBodyPriceData PostSubscriptionItemsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"proration_behavior" Text
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
postSubscriptionItemsRequestBodyProrationBehavior PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe Int
postSubscriptionItemsRequestBodyProrationDate PostSubscriptionItemsRequestBody
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..= PostSubscriptionItemsRequestBody -> Maybe Int
postSubscriptionItemsRequestBodyQuantity PostSubscriptionItemsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"subscription" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody -> Text
postSubscriptionItemsRequestBodySubscription PostSubscriptionItemsRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"tax_rates" Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBody
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
postSubscriptionItemsRequestBodyTaxRates PostSubscriptionItemsRequestBody
obj)))))))))))
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBody where
parseJSON :: Value -> Parser PostSubscriptionItemsRequestBody
parseJSON = String
-> (Object -> Parser PostSubscriptionItemsRequestBody)
-> Value
-> Parser PostSubscriptionItemsRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsRequestBody" (\Object
obj -> (((((((((((Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Maybe [Text]
-> Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser
(Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Maybe [Text]
-> Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Maybe [Text]
-> Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody
PostSubscriptionItemsRequestBody Parser
(Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Maybe [Text]
-> Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser
(Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants)
-> Parser
(Maybe [Text]
-> Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
(Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"billing_thresholds")) Parser
(Maybe [Text]
-> Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe [Text])
-> Parser
(Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
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 Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe Object)
-> Parser
(Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser
(Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe PostSubscriptionItemsRequestBodyPaymentBehavior')
-> Parser
(Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PostSubscriptionItemsRequestBodyPaymentBehavior')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"payment_behavior")) Parser
(Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe Text)
-> Parser
(Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
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 PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe PostSubscriptionItemsRequestBodyPriceData')
-> Parser
(Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PostSubscriptionItemsRequestBodyPriceData')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"price_data")) Parser
(Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser
(Maybe PostSubscriptionItemsRequestBodyProrationBehavior')
-> Parser
(Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
(Maybe PostSubscriptionItemsRequestBodyProrationBehavior')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"proration_behavior")) Parser
(Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
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
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe Int)
-> Parser
(Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
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
(Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser Text
-> Parser
(Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
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
"subscription")) Parser
(Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody)
-> Parser (Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants)
-> Parser PostSubscriptionItemsRequestBody
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tax_rates"))
mkPostSubscriptionItemsRequestBody ::
Data.Text.Internal.Text ->
PostSubscriptionItemsRequestBody
mkPostSubscriptionItemsRequestBody :: Text -> PostSubscriptionItemsRequestBody
mkPostSubscriptionItemsRequestBody Text
postSubscriptionItemsRequestBodySubscription =
PostSubscriptionItemsRequestBody :: Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Maybe [Text]
-> Maybe Object
-> Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Maybe Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
-> Maybe Int
-> Maybe Int
-> Text
-> Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBody
PostSubscriptionItemsRequestBody
{ postSubscriptionItemsRequestBodyBillingThresholds :: Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
postSubscriptionItemsRequestBodyBillingThresholds = Maybe PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyExpand :: Maybe [Text]
postSubscriptionItemsRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyMetadata :: Maybe Object
postSubscriptionItemsRequestBodyMetadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyPaymentBehavior :: Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
postSubscriptionItemsRequestBodyPaymentBehavior = Maybe PostSubscriptionItemsRequestBodyPaymentBehavior'
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyPrice :: Maybe Text
postSubscriptionItemsRequestBodyPrice = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyPriceData :: Maybe PostSubscriptionItemsRequestBodyPriceData'
postSubscriptionItemsRequestBodyPriceData = Maybe PostSubscriptionItemsRequestBodyPriceData'
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyProrationBehavior :: Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
postSubscriptionItemsRequestBodyProrationBehavior = Maybe PostSubscriptionItemsRequestBodyProrationBehavior'
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyProrationDate :: Maybe Int
postSubscriptionItemsRequestBodyProrationDate = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyQuantity :: Maybe Int
postSubscriptionItemsRequestBodyQuantity = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodySubscription :: Text
postSubscriptionItemsRequestBodySubscription = Text
postSubscriptionItemsRequestBodySubscription,
postSubscriptionItemsRequestBodyTaxRates :: Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
postSubscriptionItemsRequestBodyTaxRates = Maybe PostSubscriptionItemsRequestBodyTaxRates'Variants
forall a. Maybe a
GHC.Maybe.Nothing
}
data PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 = PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
{
PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Int
postSubscriptionItemsRequestBodyBillingThresholds'OneOf1UsageGte :: GHC.Types.Int
}
deriving
( Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> ShowS
[PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1] -> ShowS
PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> String
(Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> ShowS)
-> (PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> String)
-> ([PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1]
-> ShowS)
-> Show PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1] -> ShowS
show :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> String
$cshow :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> String
showsPrec :: Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> ShowS
$cshowsPrec :: Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> ShowS
GHC.Show.Show,
PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Bool
(PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> Bool)
-> (PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> Bool)
-> Eq PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Bool
$c/= :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Bool
== :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Bool
$c== :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 where
toJSON :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Value
toJSON PostSubscriptionItemsRequestBodyBillingThresholds'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..= PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Int
postSubscriptionItemsRequestBodyBillingThresholds'OneOf1UsageGte PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> Encoding
toEncoding PostSubscriptionItemsRequestBodyBillingThresholds'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..= PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Int
postSubscriptionItemsRequestBodyBillingThresholds'OneOf1UsageGte PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
obj)
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 where
parseJSON :: Value
-> Parser PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
parseJSON = String
-> (Object
-> Parser PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1)
-> Value
-> Parser PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1" (\Object
obj -> (Int -> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1)
-> Parser
(Int -> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int -> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 Parser
(Int -> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1)
-> Parser Int
-> Parser PostSubscriptionItemsRequestBodyBillingThresholds'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"))
mkPostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 ::
GHC.Types.Int ->
PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
mkPostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 :: Int -> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
mkPostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 Int
postSubscriptionItemsRequestBodyBillingThresholds'OneOf1UsageGte = PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 :: Int -> PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 {postSubscriptionItemsRequestBodyBillingThresholds'OneOf1UsageGte :: Int
postSubscriptionItemsRequestBodyBillingThresholds'OneOf1UsageGte = Int
postSubscriptionItemsRequestBodyBillingThresholds'OneOf1UsageGte}
data PostSubscriptionItemsRequestBodyBillingThresholds'Variants
=
PostSubscriptionItemsRequestBodyBillingThresholds'EmptyString
| PostSubscriptionItemsRequestBodyBillingThresholds'PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
deriving (Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> ShowS
[PostSubscriptionItemsRequestBodyBillingThresholds'Variants]
-> ShowS
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> String
(Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> ShowS)
-> (PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> String)
-> ([PostSubscriptionItemsRequestBodyBillingThresholds'Variants]
-> ShowS)
-> Show PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyBillingThresholds'Variants]
-> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyBillingThresholds'Variants]
-> ShowS
show :: PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> String
$cshow :: PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> String
showsPrec :: Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> ShowS
$cshowsPrec :: Int
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> ShowS
GHC.Show.Show, PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Bool
(PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Bool)
-> (PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Bool)
-> Eq PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Bool
$c/= :: PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Bool
== :: PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Bool
$c== :: PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyBillingThresholds'Variants where
toJSON :: PostSubscriptionItemsRequestBodyBillingThresholds'Variants -> Value
toJSON (PostSubscriptionItemsRequestBodyBillingThresholds'PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
a) = PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
a
toJSON (PostSubscriptionItemsRequestBodyBillingThresholds'Variants
PostSubscriptionItemsRequestBodyBillingThresholds'EmptyString) = Value
""
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyBillingThresholds'Variants where
parseJSON :: Value
-> Parser
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
parseJSON Value
val =
if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Parser
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsRequestBodyBillingThresholds'Variants
PostSubscriptionItemsRequestBodyBillingThresholds'EmptyString
| Bool
GHC.Base.otherwise -> case (PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
PostSubscriptionItemsRequestBodyBillingThresholds'PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1 (PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> PostSubscriptionItemsRequestBodyBillingThresholds'Variants)
-> Result PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
-> Result
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value
-> Result PostSubscriptionItemsRequestBodyBillingThresholds'OneOf1
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Result
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Result
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
Data.Aeson.Types.Internal.Success PostSubscriptionItemsRequestBodyBillingThresholds'Variants
a -> PostSubscriptionItemsRequestBodyBillingThresholds'Variants
-> Parser
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsRequestBodyBillingThresholds'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String
-> Parser
PostSubscriptionItemsRequestBodyBillingThresholds'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a
data PostSubscriptionItemsRequestBodyPaymentBehavior'
=
PostSubscriptionItemsRequestBodyPaymentBehavior'Other Data.Aeson.Types.Internal.Value
|
PostSubscriptionItemsRequestBodyPaymentBehavior'Typed Data.Text.Internal.Text
|
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumAllowIncomplete
|
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumDefaultIncomplete
|
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumErrorIfIncomplete
|
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumPendingIfIncomplete
deriving (Int -> PostSubscriptionItemsRequestBodyPaymentBehavior' -> ShowS
[PostSubscriptionItemsRequestBodyPaymentBehavior'] -> ShowS
PostSubscriptionItemsRequestBodyPaymentBehavior' -> String
(Int -> PostSubscriptionItemsRequestBodyPaymentBehavior' -> ShowS)
-> (PostSubscriptionItemsRequestBodyPaymentBehavior' -> String)
-> ([PostSubscriptionItemsRequestBodyPaymentBehavior'] -> ShowS)
-> Show PostSubscriptionItemsRequestBodyPaymentBehavior'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyPaymentBehavior'] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyPaymentBehavior'] -> ShowS
show :: PostSubscriptionItemsRequestBodyPaymentBehavior' -> String
$cshow :: PostSubscriptionItemsRequestBodyPaymentBehavior' -> String
showsPrec :: Int -> PostSubscriptionItemsRequestBodyPaymentBehavior' -> ShowS
$cshowsPrec :: Int -> PostSubscriptionItemsRequestBodyPaymentBehavior' -> ShowS
GHC.Show.Show, PostSubscriptionItemsRequestBodyPaymentBehavior'
-> PostSubscriptionItemsRequestBodyPaymentBehavior' -> Bool
(PostSubscriptionItemsRequestBodyPaymentBehavior'
-> PostSubscriptionItemsRequestBodyPaymentBehavior' -> Bool)
-> (PostSubscriptionItemsRequestBodyPaymentBehavior'
-> PostSubscriptionItemsRequestBodyPaymentBehavior' -> Bool)
-> Eq PostSubscriptionItemsRequestBodyPaymentBehavior'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyPaymentBehavior'
-> PostSubscriptionItemsRequestBodyPaymentBehavior' -> Bool
$c/= :: PostSubscriptionItemsRequestBodyPaymentBehavior'
-> PostSubscriptionItemsRequestBodyPaymentBehavior' -> Bool
== :: PostSubscriptionItemsRequestBodyPaymentBehavior'
-> PostSubscriptionItemsRequestBodyPaymentBehavior' -> Bool
$c== :: PostSubscriptionItemsRequestBodyPaymentBehavior'
-> PostSubscriptionItemsRequestBodyPaymentBehavior' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyPaymentBehavior' where
toJSON :: PostSubscriptionItemsRequestBodyPaymentBehavior' -> Value
toJSON (PostSubscriptionItemsRequestBodyPaymentBehavior'Other Value
val) = Value
val
toJSON (PostSubscriptionItemsRequestBodyPaymentBehavior'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumAllowIncomplete) = Value
"allow_incomplete"
toJSON (PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumDefaultIncomplete) = Value
"default_incomplete"
toJSON (PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumErrorIfIncomplete) = Value
"error_if_incomplete"
toJSON (PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumPendingIfIncomplete) = Value
"pending_if_incomplete"
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyPaymentBehavior' where
parseJSON :: Value -> Parser PostSubscriptionItemsRequestBodyPaymentBehavior'
parseJSON Value
val =
PostSubscriptionItemsRequestBodyPaymentBehavior'
-> Parser PostSubscriptionItemsRequestBodyPaymentBehavior'
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" -> PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumAllowIncomplete
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"default_incomplete" -> PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumDefaultIncomplete
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"error_if_incomplete" -> PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumErrorIfIncomplete
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pending_if_incomplete" -> PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'EnumPendingIfIncomplete
| Bool
GHC.Base.otherwise -> Value -> PostSubscriptionItemsRequestBodyPaymentBehavior'
PostSubscriptionItemsRequestBodyPaymentBehavior'Other Value
val
)
data PostSubscriptionItemsRequestBodyPriceData' = PostSubscriptionItemsRequestBodyPriceData'
{
PostSubscriptionItemsRequestBodyPriceData' -> Text
postSubscriptionItemsRequestBodyPriceData'Currency :: Data.Text.Internal.Text,
PostSubscriptionItemsRequestBodyPriceData' -> Text
postSubscriptionItemsRequestBodyPriceData'Product :: Data.Text.Internal.Text,
PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
postSubscriptionItemsRequestBodyPriceData'Recurring :: PostSubscriptionItemsRequestBodyPriceData'Recurring',
PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsRequestBodyPriceData'TaxBehavior :: (GHC.Maybe.Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'),
PostSubscriptionItemsRequestBodyPriceData' -> Maybe Int
postSubscriptionItemsRequestBodyPriceData'UnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int),
PostSubscriptionItemsRequestBodyPriceData' -> Maybe Text
postSubscriptionItemsRequestBodyPriceData'UnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> PostSubscriptionItemsRequestBodyPriceData' -> ShowS
[PostSubscriptionItemsRequestBodyPriceData'] -> ShowS
PostSubscriptionItemsRequestBodyPriceData' -> String
(Int -> PostSubscriptionItemsRequestBodyPriceData' -> ShowS)
-> (PostSubscriptionItemsRequestBodyPriceData' -> String)
-> ([PostSubscriptionItemsRequestBodyPriceData'] -> ShowS)
-> Show PostSubscriptionItemsRequestBodyPriceData'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyPriceData'] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyPriceData'] -> ShowS
show :: PostSubscriptionItemsRequestBodyPriceData' -> String
$cshow :: PostSubscriptionItemsRequestBodyPriceData' -> String
showsPrec :: Int -> PostSubscriptionItemsRequestBodyPriceData' -> ShowS
$cshowsPrec :: Int -> PostSubscriptionItemsRequestBodyPriceData' -> ShowS
GHC.Show.Show,
PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData' -> Bool
(PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData' -> Bool)
-> (PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData' -> Bool)
-> Eq PostSubscriptionItemsRequestBodyPriceData'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData' -> Bool
$c/= :: PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData' -> Bool
== :: PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData' -> Bool
$c== :: PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData' -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyPriceData' where
toJSON :: PostSubscriptionItemsRequestBodyPriceData' -> Value
toJSON PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Text
postSubscriptionItemsRequestBodyPriceData'Currency PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Text
postSubscriptionItemsRequestBodyPriceData'Product PostSubscriptionItemsRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"recurring" Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
postSubscriptionItemsRequestBodyPriceData'Recurring PostSubscriptionItemsRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_behavior" Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsRequestBodyPriceData'TaxBehavior PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Maybe Int
postSubscriptionItemsRequestBodyPriceData'UnitAmount PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Maybe Text
postSubscriptionItemsRequestBodyPriceData'UnitAmountDecimal PostSubscriptionItemsRequestBodyPriceData'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PostSubscriptionItemsRequestBodyPriceData' -> Encoding
toEncoding PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Text
postSubscriptionItemsRequestBodyPriceData'Currency PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Text
postSubscriptionItemsRequestBodyPriceData'Product PostSubscriptionItemsRequestBodyPriceData'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"recurring" Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBodyPriceData'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
postSubscriptionItemsRequestBodyPriceData'Recurring PostSubscriptionItemsRequestBodyPriceData'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tax_behavior" Text
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBodyPriceData'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsRequestBodyPriceData'TaxBehavior PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Maybe Int
postSubscriptionItemsRequestBodyPriceData'UnitAmount PostSubscriptionItemsRequestBodyPriceData'
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..= PostSubscriptionItemsRequestBodyPriceData' -> Maybe Text
postSubscriptionItemsRequestBodyPriceData'UnitAmountDecimal PostSubscriptionItemsRequestBodyPriceData'
obj))))))
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyPriceData' where
parseJSON :: Value -> Parser PostSubscriptionItemsRequestBodyPriceData'
parseJSON = String
-> (Object -> Parser PostSubscriptionItemsRequestBodyPriceData')
-> Value
-> Parser PostSubscriptionItemsRequestBodyPriceData'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsRequestBodyPriceData'" (\Object
obj -> ((((((Text
-> Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
-> Parser
(Text
-> Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text
-> Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData'
PostSubscriptionItemsRequestBodyPriceData' Parser
(Text
-> Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
-> Parser Text
-> Parser
(Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
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
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
-> Parser Text
-> Parser
(PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
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
(PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
-> Parser PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Parser
(Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser PostSubscriptionItemsRequestBodyPriceData'Recurring'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"recurring")) Parser
(Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData')
-> Parser
(Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior')
-> Parser
(Maybe Int
-> Maybe Text -> PostSubscriptionItemsRequestBodyPriceData')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
(Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tax_behavior")) Parser
(Maybe Int
-> Maybe Text -> PostSubscriptionItemsRequestBodyPriceData')
-> Parser (Maybe Int)
-> Parser
(Maybe Text -> PostSubscriptionItemsRequestBodyPriceData')
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 -> PostSubscriptionItemsRequestBodyPriceData')
-> Parser (Maybe Text)
-> Parser PostSubscriptionItemsRequestBodyPriceData'
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"))
mkPostSubscriptionItemsRequestBodyPriceData' ::
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
PostSubscriptionItemsRequestBodyPriceData'Recurring' ->
PostSubscriptionItemsRequestBodyPriceData'
mkPostSubscriptionItemsRequestBodyPriceData' :: Text
-> Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'
mkPostSubscriptionItemsRequestBodyPriceData' Text
postSubscriptionItemsRequestBodyPriceData'Currency Text
postSubscriptionItemsRequestBodyPriceData'Product PostSubscriptionItemsRequestBodyPriceData'Recurring'
postSubscriptionItemsRequestBodyPriceData'Recurring =
PostSubscriptionItemsRequestBodyPriceData' :: Text
-> Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Maybe Int
-> Maybe Text
-> PostSubscriptionItemsRequestBodyPriceData'
PostSubscriptionItemsRequestBodyPriceData'
{ postSubscriptionItemsRequestBodyPriceData'Currency :: Text
postSubscriptionItemsRequestBodyPriceData'Currency = Text
postSubscriptionItemsRequestBodyPriceData'Currency,
postSubscriptionItemsRequestBodyPriceData'Product :: Text
postSubscriptionItemsRequestBodyPriceData'Product = Text
postSubscriptionItemsRequestBodyPriceData'Product,
postSubscriptionItemsRequestBodyPriceData'Recurring :: PostSubscriptionItemsRequestBodyPriceData'Recurring'
postSubscriptionItemsRequestBodyPriceData'Recurring = PostSubscriptionItemsRequestBodyPriceData'Recurring'
postSubscriptionItemsRequestBodyPriceData'Recurring,
postSubscriptionItemsRequestBodyPriceData'TaxBehavior :: Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
postSubscriptionItemsRequestBodyPriceData'TaxBehavior = Maybe PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyPriceData'UnitAmount :: Maybe Int
postSubscriptionItemsRequestBodyPriceData'UnitAmount = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
postSubscriptionItemsRequestBodyPriceData'UnitAmountDecimal :: Maybe Text
postSubscriptionItemsRequestBodyPriceData'UnitAmountDecimal = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
}
data PostSubscriptionItemsRequestBodyPriceData'Recurring' = PostSubscriptionItemsRequestBodyPriceData'Recurring'
{
PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsRequestBodyPriceData'Recurring'Interval :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval',
PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Maybe Int
postSubscriptionItemsRequestBodyPriceData'Recurring'IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int)
}
deriving
( Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> ShowS
[PostSubscriptionItemsRequestBodyPriceData'Recurring'] -> ShowS
PostSubscriptionItemsRequestBodyPriceData'Recurring' -> String
(Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> ShowS)
-> (PostSubscriptionItemsRequestBodyPriceData'Recurring' -> String)
-> ([PostSubscriptionItemsRequestBodyPriceData'Recurring']
-> ShowS)
-> Show PostSubscriptionItemsRequestBodyPriceData'Recurring'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyPriceData'Recurring'] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyPriceData'Recurring'] -> ShowS
show :: PostSubscriptionItemsRequestBodyPriceData'Recurring' -> String
$cshow :: PostSubscriptionItemsRequestBodyPriceData'Recurring' -> String
showsPrec :: Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> ShowS
$cshowsPrec :: Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> ShowS
GHC.Show.Show,
PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Bool
(PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Bool)
-> (PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Bool)
-> Eq PostSubscriptionItemsRequestBodyPriceData'Recurring'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Bool
$c/= :: PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Bool
== :: PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Bool
$c== :: PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyPriceData'Recurring' where
toJSON :: PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Value
toJSON PostSubscriptionItemsRequestBodyPriceData'Recurring'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"interval" Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsRequestBodyPriceData'Recurring'Interval PostSubscriptionItemsRequestBodyPriceData'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..= PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Maybe Int
postSubscriptionItemsRequestBodyPriceData'Recurring'IntervalCount PostSubscriptionItemsRequestBodyPriceData'Recurring'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Encoding
toEncoding PostSubscriptionItemsRequestBodyPriceData'Recurring'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"interval" Text
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostSubscriptionItemsRequestBodyPriceData'Recurring'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsRequestBodyPriceData'Recurring'Interval PostSubscriptionItemsRequestBodyPriceData'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..= PostSubscriptionItemsRequestBodyPriceData'Recurring' -> Maybe Int
postSubscriptionItemsRequestBodyPriceData'Recurring'IntervalCount PostSubscriptionItemsRequestBodyPriceData'Recurring'
obj))
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyPriceData'Recurring' where
parseJSON :: Value
-> Parser PostSubscriptionItemsRequestBodyPriceData'Recurring'
parseJSON = String
-> (Object
-> Parser PostSubscriptionItemsRequestBodyPriceData'Recurring')
-> Value
-> Parser PostSubscriptionItemsRequestBodyPriceData'Recurring'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostSubscriptionItemsRequestBodyPriceData'Recurring'" (\Object
obj -> ((PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Maybe Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring')
-> Parser
(PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Maybe Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Maybe Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
PostSubscriptionItemsRequestBodyPriceData'Recurring' Parser
(PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Maybe Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring')
-> Parser
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Parser
(Maybe Int -> PostSubscriptionItemsRequestBodyPriceData'Recurring')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"interval")) Parser
(Maybe Int -> PostSubscriptionItemsRequestBodyPriceData'Recurring')
-> Parser (Maybe Int)
-> Parser PostSubscriptionItemsRequestBodyPriceData'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"))
mkPostSubscriptionItemsRequestBodyPriceData'Recurring' ::
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval' ->
PostSubscriptionItemsRequestBodyPriceData'Recurring'
mkPostSubscriptionItemsRequestBodyPriceData'Recurring' :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
mkPostSubscriptionItemsRequestBodyPriceData'Recurring' PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsRequestBodyPriceData'Recurring'Interval =
PostSubscriptionItemsRequestBodyPriceData'Recurring' :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Maybe Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'
PostSubscriptionItemsRequestBodyPriceData'Recurring'
{ postSubscriptionItemsRequestBodyPriceData'Recurring'Interval :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsRequestBodyPriceData'Recurring'Interval = PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
postSubscriptionItemsRequestBodyPriceData'Recurring'Interval,
postSubscriptionItemsRequestBodyPriceData'Recurring'IntervalCount :: Maybe Int
postSubscriptionItemsRequestBodyPriceData'Recurring'IntervalCount = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
}
data PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
=
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'Other Data.Aeson.Types.Internal.Value
|
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'Typed Data.Text.Internal.Text
|
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumDay
|
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumMonth
|
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumWeek
|
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumYear
deriving (Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> ShowS
[PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval']
-> ShowS
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> String
(Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> ShowS)
-> (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> String)
-> ([PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval']
-> ShowS)
-> Show
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval']
-> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval']
-> ShowS
show :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> String
$cshow :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> String
showsPrec :: Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> ShowS
$cshowsPrec :: Int
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> ShowS
GHC.Show.Show, PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Bool
(PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Bool)
-> (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Bool)
-> Eq PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Bool
$c/= :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Bool
== :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Bool
$c== :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval' where
toJSON :: PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Value
toJSON (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'Other Value
val) = Value
val
toJSON (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumDay) = Value
"day"
toJSON (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumMonth) = Value
"month"
toJSON (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumWeek) = Value
"week"
toJSON (PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumYear) = Value
"year"
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval' where
parseJSON :: Value
-> Parser
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
parseJSON Value
val =
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
-> Parser
PostSubscriptionItemsRequestBodyPriceData'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" -> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumDay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"month" -> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumMonth
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"week" -> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumWeek
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"year" -> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'EnumYear
| Bool
GHC.Base.otherwise -> Value
-> PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'
PostSubscriptionItemsRequestBodyPriceData'Recurring'Interval'Other Value
val
)
data PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
=
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'Other Data.Aeson.Types.Internal.Value
|
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'Typed Data.Text.Internal.Text
|
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumExclusive
|
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumInclusive
|
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumUnspecified
deriving (Int
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> ShowS
[PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'] -> ShowS
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> String
(Int
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> ShowS)
-> (PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> String)
-> ([PostSubscriptionItemsRequestBodyPriceData'TaxBehavior']
-> ShowS)
-> Show PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'] -> ShowS
show :: PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> String
$cshow :: PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> String
showsPrec :: Int
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> ShowS
$cshowsPrec :: Int
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> ShowS
GHC.Show.Show, PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Bool
(PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Bool)
-> (PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Bool)
-> Eq PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Bool
$c/= :: PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Bool
== :: PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Bool
$c== :: PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' where
toJSON :: PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' -> Value
toJSON (PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'Other Value
val) = Value
val
toJSON (PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumExclusive) = Value
"exclusive"
toJSON (PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumInclusive) = Value
"inclusive"
toJSON (PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumUnspecified) = Value
"unspecified"
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyPriceData'TaxBehavior' where
parseJSON :: Value
-> Parser PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
parseJSON Value
val =
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
-> Parser PostSubscriptionItemsRequestBodyPriceData'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" -> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumExclusive
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"inclusive" -> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumInclusive
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unspecified" -> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'EnumUnspecified
| Bool
GHC.Base.otherwise -> Value -> PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'
PostSubscriptionItemsRequestBodyPriceData'TaxBehavior'Other Value
val
)
data PostSubscriptionItemsRequestBodyProrationBehavior'
=
PostSubscriptionItemsRequestBodyProrationBehavior'Other Data.Aeson.Types.Internal.Value
|
PostSubscriptionItemsRequestBodyProrationBehavior'Typed Data.Text.Internal.Text
|
PostSubscriptionItemsRequestBodyProrationBehavior'EnumAlwaysInvoice
|
PostSubscriptionItemsRequestBodyProrationBehavior'EnumCreateProrations
|
PostSubscriptionItemsRequestBodyProrationBehavior'EnumNone
deriving (Int -> PostSubscriptionItemsRequestBodyProrationBehavior' -> ShowS
[PostSubscriptionItemsRequestBodyProrationBehavior'] -> ShowS
PostSubscriptionItemsRequestBodyProrationBehavior' -> String
(Int
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> ShowS)
-> (PostSubscriptionItemsRequestBodyProrationBehavior' -> String)
-> ([PostSubscriptionItemsRequestBodyProrationBehavior'] -> ShowS)
-> Show PostSubscriptionItemsRequestBodyProrationBehavior'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyProrationBehavior'] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyProrationBehavior'] -> ShowS
show :: PostSubscriptionItemsRequestBodyProrationBehavior' -> String
$cshow :: PostSubscriptionItemsRequestBodyProrationBehavior' -> String
showsPrec :: Int -> PostSubscriptionItemsRequestBodyProrationBehavior' -> ShowS
$cshowsPrec :: Int -> PostSubscriptionItemsRequestBodyProrationBehavior' -> ShowS
GHC.Show.Show, PostSubscriptionItemsRequestBodyProrationBehavior'
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> Bool
(PostSubscriptionItemsRequestBodyProrationBehavior'
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> Bool)
-> (PostSubscriptionItemsRequestBodyProrationBehavior'
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> Bool)
-> Eq PostSubscriptionItemsRequestBodyProrationBehavior'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyProrationBehavior'
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> Bool
$c/= :: PostSubscriptionItemsRequestBodyProrationBehavior'
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> Bool
== :: PostSubscriptionItemsRequestBodyProrationBehavior'
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> Bool
$c== :: PostSubscriptionItemsRequestBodyProrationBehavior'
-> PostSubscriptionItemsRequestBodyProrationBehavior' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyProrationBehavior' where
toJSON :: PostSubscriptionItemsRequestBodyProrationBehavior' -> Value
toJSON (PostSubscriptionItemsRequestBodyProrationBehavior'Other Value
val) = Value
val
toJSON (PostSubscriptionItemsRequestBodyProrationBehavior'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PostSubscriptionItemsRequestBodyProrationBehavior'
PostSubscriptionItemsRequestBodyProrationBehavior'EnumAlwaysInvoice) = Value
"always_invoice"
toJSON (PostSubscriptionItemsRequestBodyProrationBehavior'
PostSubscriptionItemsRequestBodyProrationBehavior'EnumCreateProrations) = Value
"create_prorations"
toJSON (PostSubscriptionItemsRequestBodyProrationBehavior'
PostSubscriptionItemsRequestBodyProrationBehavior'EnumNone) = Value
"none"
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyProrationBehavior' where
parseJSON :: Value -> Parser PostSubscriptionItemsRequestBodyProrationBehavior'
parseJSON Value
val =
PostSubscriptionItemsRequestBodyProrationBehavior'
-> Parser PostSubscriptionItemsRequestBodyProrationBehavior'
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" -> PostSubscriptionItemsRequestBodyProrationBehavior'
PostSubscriptionItemsRequestBodyProrationBehavior'EnumAlwaysInvoice
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"create_prorations" -> PostSubscriptionItemsRequestBodyProrationBehavior'
PostSubscriptionItemsRequestBodyProrationBehavior'EnumCreateProrations
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"none" -> PostSubscriptionItemsRequestBodyProrationBehavior'
PostSubscriptionItemsRequestBodyProrationBehavior'EnumNone
| Bool
GHC.Base.otherwise -> Value -> PostSubscriptionItemsRequestBodyProrationBehavior'
PostSubscriptionItemsRequestBodyProrationBehavior'Other Value
val
)
data PostSubscriptionItemsRequestBodyTaxRates'Variants
=
PostSubscriptionItemsRequestBodyTaxRates'EmptyString
| PostSubscriptionItemsRequestBodyTaxRates'ListTText ([Data.Text.Internal.Text])
deriving (Int -> PostSubscriptionItemsRequestBodyTaxRates'Variants -> ShowS
[PostSubscriptionItemsRequestBodyTaxRates'Variants] -> ShowS
PostSubscriptionItemsRequestBodyTaxRates'Variants -> String
(Int -> PostSubscriptionItemsRequestBodyTaxRates'Variants -> ShowS)
-> (PostSubscriptionItemsRequestBodyTaxRates'Variants -> String)
-> ([PostSubscriptionItemsRequestBodyTaxRates'Variants] -> ShowS)
-> Show PostSubscriptionItemsRequestBodyTaxRates'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsRequestBodyTaxRates'Variants] -> ShowS
$cshowList :: [PostSubscriptionItemsRequestBodyTaxRates'Variants] -> ShowS
show :: PostSubscriptionItemsRequestBodyTaxRates'Variants -> String
$cshow :: PostSubscriptionItemsRequestBodyTaxRates'Variants -> String
showsPrec :: Int -> PostSubscriptionItemsRequestBodyTaxRates'Variants -> ShowS
$cshowsPrec :: Int -> PostSubscriptionItemsRequestBodyTaxRates'Variants -> ShowS
GHC.Show.Show, PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBodyTaxRates'Variants -> Bool
(PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBodyTaxRates'Variants -> Bool)
-> (PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBodyTaxRates'Variants -> Bool)
-> Eq PostSubscriptionItemsRequestBodyTaxRates'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBodyTaxRates'Variants -> Bool
$c/= :: PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBodyTaxRates'Variants -> Bool
== :: PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBodyTaxRates'Variants -> Bool
$c== :: PostSubscriptionItemsRequestBodyTaxRates'Variants
-> PostSubscriptionItemsRequestBodyTaxRates'Variants -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostSubscriptionItemsRequestBodyTaxRates'Variants where
toJSON :: PostSubscriptionItemsRequestBodyTaxRates'Variants -> Value
toJSON (PostSubscriptionItemsRequestBodyTaxRates'ListTText [Text]
a) = [Text] -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON [Text]
a
toJSON (PostSubscriptionItemsRequestBodyTaxRates'Variants
PostSubscriptionItemsRequestBodyTaxRates'EmptyString) = Value
""
instance Data.Aeson.Types.FromJSON.FromJSON PostSubscriptionItemsRequestBodyTaxRates'Variants where
parseJSON :: Value -> Parser PostSubscriptionItemsRequestBodyTaxRates'Variants
parseJSON Value
val =
if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostSubscriptionItemsRequestBodyTaxRates'Variants
-> Parser PostSubscriptionItemsRequestBodyTaxRates'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsRequestBodyTaxRates'Variants
PostSubscriptionItemsRequestBodyTaxRates'EmptyString
| Bool
GHC.Base.otherwise -> case ([Text] -> PostSubscriptionItemsRequestBodyTaxRates'Variants
PostSubscriptionItemsRequestBodyTaxRates'ListTText ([Text] -> PostSubscriptionItemsRequestBodyTaxRates'Variants)
-> Result [Text]
-> Result PostSubscriptionItemsRequestBodyTaxRates'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 PostSubscriptionItemsRequestBodyTaxRates'Variants
-> Result PostSubscriptionItemsRequestBodyTaxRates'Variants
-> Result PostSubscriptionItemsRequestBodyTaxRates'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PostSubscriptionItemsRequestBodyTaxRates'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
Data.Aeson.Types.Internal.Success PostSubscriptionItemsRequestBodyTaxRates'Variants
a -> PostSubscriptionItemsRequestBodyTaxRates'Variants
-> Parser PostSubscriptionItemsRequestBodyTaxRates'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostSubscriptionItemsRequestBodyTaxRates'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String -> Parser PostSubscriptionItemsRequestBodyTaxRates'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a
data PostSubscriptionItemsResponse
=
PostSubscriptionItemsResponseError GHC.Base.String
|
PostSubscriptionItemsResponse200 SubscriptionItem
|
PostSubscriptionItemsResponseDefault Error
deriving (Int -> PostSubscriptionItemsResponse -> ShowS
[PostSubscriptionItemsResponse] -> ShowS
PostSubscriptionItemsResponse -> String
(Int -> PostSubscriptionItemsResponse -> ShowS)
-> (PostSubscriptionItemsResponse -> String)
-> ([PostSubscriptionItemsResponse] -> ShowS)
-> Show PostSubscriptionItemsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostSubscriptionItemsResponse] -> ShowS
$cshowList :: [PostSubscriptionItemsResponse] -> ShowS
show :: PostSubscriptionItemsResponse -> String
$cshow :: PostSubscriptionItemsResponse -> String
showsPrec :: Int -> PostSubscriptionItemsResponse -> ShowS
$cshowsPrec :: Int -> PostSubscriptionItemsResponse -> ShowS
GHC.Show.Show, PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse -> Bool
(PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse -> Bool)
-> (PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse -> Bool)
-> Eq PostSubscriptionItemsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse -> Bool
$c/= :: PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse -> Bool
== :: PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse -> Bool
$c== :: PostSubscriptionItemsResponse
-> PostSubscriptionItemsResponse -> Bool
GHC.Classes.Eq)