Safe Haskell | None |
---|---|
Language | Haskell2010 |
StripeAPI.Operations.PostPlans
Description
Contains the different functions to run the operation postPlans
Synopsis
- postPlans :: forall m. MonadHTTP m => PostPlansRequestBody -> ClientT m (Response PostPlansResponse)
- data PostPlansRequestBody = PostPlansRequestBody {
- postPlansRequestBodyActive :: Maybe Bool
- postPlansRequestBodyAggregateUsage :: Maybe PostPlansRequestBodyAggregateUsage'
- postPlansRequestBodyAmount :: Maybe Int
- postPlansRequestBodyAmountDecimal :: Maybe Text
- postPlansRequestBodyBillingScheme :: Maybe PostPlansRequestBodyBillingScheme'
- postPlansRequestBodyCurrency :: Text
- postPlansRequestBodyExpand :: Maybe [Text]
- postPlansRequestBodyId :: Maybe Text
- postPlansRequestBodyInterval :: PostPlansRequestBodyInterval'
- postPlansRequestBodyIntervalCount :: Maybe Int
- postPlansRequestBodyMetadata :: Maybe PostPlansRequestBodyMetadata'Variants
- postPlansRequestBodyNickname :: Maybe Text
- postPlansRequestBodyProduct :: Maybe PostPlansRequestBodyProduct'Variants
- postPlansRequestBodyTiers :: Maybe [PostPlansRequestBodyTiers']
- postPlansRequestBodyTiersMode :: Maybe PostPlansRequestBodyTiersMode'
- postPlansRequestBodyTransformUsage :: Maybe PostPlansRequestBodyTransformUsage'
- postPlansRequestBodyTrialPeriodDays :: Maybe Int
- postPlansRequestBodyUsageType :: Maybe PostPlansRequestBodyUsageType'
- mkPostPlansRequestBody :: Text -> PostPlansRequestBodyInterval' -> PostPlansRequestBody
- data PostPlansRequestBodyAggregateUsage'
- data PostPlansRequestBodyBillingScheme'
- data PostPlansRequestBodyInterval'
- data PostPlansRequestBodyMetadata'Variants
- data PostPlansRequestBodyProduct'OneOf1 = PostPlansRequestBodyProduct'OneOf1 {
- postPlansRequestBodyProduct'OneOf1Active :: Maybe Bool
- postPlansRequestBodyProduct'OneOf1Id :: Maybe Text
- postPlansRequestBodyProduct'OneOf1Metadata :: Maybe Object
- postPlansRequestBodyProduct'OneOf1Name :: Text
- postPlansRequestBodyProduct'OneOf1StatementDescriptor :: Maybe Text
- postPlansRequestBodyProduct'OneOf1TaxCode :: Maybe Text
- postPlansRequestBodyProduct'OneOf1UnitLabel :: Maybe Text
- mkPostPlansRequestBodyProduct'OneOf1 :: Text -> PostPlansRequestBodyProduct'OneOf1
- data PostPlansRequestBodyProduct'Variants
- data PostPlansRequestBodyTiers' = PostPlansRequestBodyTiers' {}
- mkPostPlansRequestBodyTiers' :: PostPlansRequestBodyTiers'UpTo'Variants -> PostPlansRequestBodyTiers'
- data PostPlansRequestBodyTiers'UpTo'Variants
- data PostPlansRequestBodyTiersMode'
- data PostPlansRequestBodyTransformUsage' = PostPlansRequestBodyTransformUsage' {}
- mkPostPlansRequestBodyTransformUsage' :: Int -> PostPlansRequestBodyTransformUsage'Round' -> PostPlansRequestBodyTransformUsage'
- data PostPlansRequestBodyTransformUsage'Round'
- data PostPlansRequestBodyUsageType'
- data PostPlansResponse
Documentation
Arguments
:: forall m. MonadHTTP m | |
=> PostPlansRequestBody | The request body to send |
-> ClientT m (Response PostPlansResponse) | Monadic computation which returns the result of the operation |
POST /v1/plans
<p>You can now model subscriptions more flexibly using the <a href="#prices">Prices API</a>. It replaces the Plans API and is backwards compatible to simplify your migration.</p>
data PostPlansRequestBody Source #
Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema
in the specification.
Constructors
PostPlansRequestBody | |
Fields
|
Instances
Eq PostPlansRequestBody Source # | |
Defined in StripeAPI.Operations.PostPlans Methods (==) :: PostPlansRequestBody -> PostPlansRequestBody -> Bool # (/=) :: PostPlansRequestBody -> PostPlansRequestBody -> Bool # | |
Show PostPlansRequestBody Source # | |
Defined in StripeAPI.Operations.PostPlans Methods showsPrec :: Int -> PostPlansRequestBody -> ShowS # show :: PostPlansRequestBody -> String # showList :: [PostPlansRequestBody] -> ShowS # | |
ToJSON PostPlansRequestBody Source # | |
Defined in StripeAPI.Operations.PostPlans Methods toJSON :: PostPlansRequestBody -> Value # toEncoding :: PostPlansRequestBody -> Encoding # toJSONList :: [PostPlansRequestBody] -> Value # toEncodingList :: [PostPlansRequestBody] -> Encoding # | |
FromJSON PostPlansRequestBody Source # | |
Defined in StripeAPI.Operations.PostPlans Methods parseJSON :: Value -> Parser PostPlansRequestBody # parseJSONList :: Value -> Parser [PostPlansRequestBody] # |
mkPostPlansRequestBody Source #
Arguments
:: Text | |
-> PostPlansRequestBodyInterval' | |
-> PostPlansRequestBody |
Create a new PostPlansRequestBody
with all required fields.
data PostPlansRequestBodyAggregateUsage' Source #
Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.aggregate_usage
in the specification.
Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`.
Constructors
PostPlansRequestBodyAggregateUsage'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PostPlansRequestBodyAggregateUsage'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PostPlansRequestBodyAggregateUsage'EnumLastDuringPeriod | Represents the JSON value |
PostPlansRequestBodyAggregateUsage'EnumLastEver | Represents the JSON value |
PostPlansRequestBodyAggregateUsage'EnumMax | Represents the JSON value |
PostPlansRequestBodyAggregateUsage'EnumSum | Represents the JSON value |
Instances
data PostPlansRequestBodyBillingScheme' Source #
Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.billing_scheme
in the specification.
Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
Constructors
PostPlansRequestBodyBillingScheme'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PostPlansRequestBodyBillingScheme'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PostPlansRequestBodyBillingScheme'EnumPerUnit | Represents the JSON value |
PostPlansRequestBodyBillingScheme'EnumTiered | Represents the JSON value |
Instances
data PostPlansRequestBodyInterval' Source #
Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.interval
in the specification.
Specifies billing frequency. Either `day`, `week`, `month` or `year`.
Constructors
PostPlansRequestBodyInterval'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PostPlansRequestBodyInterval'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PostPlansRequestBodyInterval'EnumDay | Represents the JSON value |
PostPlansRequestBodyInterval'EnumMonth | Represents the JSON value |
PostPlansRequestBodyInterval'EnumWeek | Represents the JSON value |
PostPlansRequestBodyInterval'EnumYear | Represents the JSON value |
Instances
Eq PostPlansRequestBodyInterval' Source # | |
Defined in StripeAPI.Operations.PostPlans | |
Show PostPlansRequestBodyInterval' Source # | |
Defined in StripeAPI.Operations.PostPlans Methods showsPrec :: Int -> PostPlansRequestBodyInterval' -> ShowS # show :: PostPlansRequestBodyInterval' -> String # showList :: [PostPlansRequestBodyInterval'] -> ShowS # | |
ToJSON PostPlansRequestBodyInterval' Source # | |
Defined in StripeAPI.Operations.PostPlans Methods toJSON :: PostPlansRequestBodyInterval' -> Value # toEncoding :: PostPlansRequestBodyInterval' -> Encoding # toJSONList :: [PostPlansRequestBodyInterval'] -> Value # toEncodingList :: [PostPlansRequestBodyInterval'] -> Encoding # | |
FromJSON PostPlansRequestBodyInterval' Source # | |
Defined in StripeAPI.Operations.PostPlans Methods parseJSON :: Value -> Parser PostPlansRequestBodyInterval' # parseJSONList :: Value -> Parser [PostPlansRequestBodyInterval'] # |
data PostPlansRequestBodyMetadata'Variants Source #
Defines the oneOf schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.metadata.anyOf
in the specification.
Set of key-value pairs 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`.
Constructors
PostPlansRequestBodyMetadata'EmptyString | Represents the JSON value |
PostPlansRequestBodyMetadata'Object Object |
Instances
data PostPlansRequestBodyProduct'OneOf1 Source #
Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.product.anyOf
in the specification.
The product whose pricing the created plan will represent. This can either be the ID of an existing product, or a dictionary containing fields used to create a service product.
Constructors
PostPlansRequestBodyProduct'OneOf1 | |
Fields
|
Instances
mkPostPlansRequestBodyProduct'OneOf1 Source #
Create a new PostPlansRequestBodyProduct'OneOf1
with all required fields.
data PostPlansRequestBodyProduct'Variants Source #
Defines the oneOf schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.product.anyOf
in the specification.
Constructors
PostPlansRequestBodyProduct'PostPlansRequestBodyProduct'OneOf1 PostPlansRequestBodyProduct'OneOf1 | |
PostPlansRequestBodyProduct'Text Text |
Instances
data PostPlansRequestBodyTiers' Source #
Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.tiers.items
in the specification.
Constructors
PostPlansRequestBodyTiers' | |
Fields
|
Instances
mkPostPlansRequestBodyTiers' Source #
Create a new PostPlansRequestBodyTiers'
with all required fields.
data PostPlansRequestBodyTiers'UpTo'Variants Source #
Defines the oneOf schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.tiers.items.properties.up_to.anyOf
in the specification.
Constructors
PostPlansRequestBodyTiers'UpTo'Inf | Represents the JSON value |
PostPlansRequestBodyTiers'UpTo'Int Int |
Instances
data PostPlansRequestBodyTiersMode' Source #
Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.tiers_mode
in the specification.
Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.
Constructors
PostPlansRequestBodyTiersMode'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PostPlansRequestBodyTiersMode'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PostPlansRequestBodyTiersMode'EnumGraduated | Represents the JSON value |
PostPlansRequestBodyTiersMode'EnumVolume | Represents the JSON value |
Instances
Eq PostPlansRequestBodyTiersMode' Source # | |
Defined in StripeAPI.Operations.PostPlans | |
Show PostPlansRequestBodyTiersMode' Source # | |
Defined in StripeAPI.Operations.PostPlans Methods showsPrec :: Int -> PostPlansRequestBodyTiersMode' -> ShowS # show :: PostPlansRequestBodyTiersMode' -> String # showList :: [PostPlansRequestBodyTiersMode'] -> ShowS # | |
ToJSON PostPlansRequestBodyTiersMode' Source # | |
Defined in StripeAPI.Operations.PostPlans | |
FromJSON PostPlansRequestBodyTiersMode' Source # | |
Defined in StripeAPI.Operations.PostPlans Methods parseJSON :: Value -> Parser PostPlansRequestBodyTiersMode' # parseJSONList :: Value -> Parser [PostPlansRequestBodyTiersMode'] # |
data PostPlansRequestBodyTransformUsage' Source #
Defines the object schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.transform_usage
in the specification.
Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`.
Constructors
PostPlansRequestBodyTransformUsage' | |
Instances
mkPostPlansRequestBodyTransformUsage' Source #
Create a new PostPlansRequestBodyTransformUsage'
with all required fields.
data PostPlansRequestBodyTransformUsage'Round' Source #
Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.transform_usage.properties.round
in the specification.
Constructors
PostPlansRequestBodyTransformUsage'Round'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PostPlansRequestBodyTransformUsage'Round'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PostPlansRequestBodyTransformUsage'Round'EnumDown | Represents the JSON value |
PostPlansRequestBodyTransformUsage'Round'EnumUp | Represents the JSON value |
Instances
data PostPlansRequestBodyUsageType' Source #
Defines the enum schema located at paths./v1/plans.POST.requestBody.content.application/x-www-form-urlencoded.schema.properties.usage_type
in the specification.
Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`.
Constructors
PostPlansRequestBodyUsageType'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PostPlansRequestBodyUsageType'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PostPlansRequestBodyUsageType'EnumLicensed | Represents the JSON value |
PostPlansRequestBodyUsageType'EnumMetered | Represents the JSON value |
Instances
Eq PostPlansRequestBodyUsageType' Source # | |
Defined in StripeAPI.Operations.PostPlans | |
Show PostPlansRequestBodyUsageType' Source # | |
Defined in StripeAPI.Operations.PostPlans Methods showsPrec :: Int -> PostPlansRequestBodyUsageType' -> ShowS # show :: PostPlansRequestBodyUsageType' -> String # showList :: [PostPlansRequestBodyUsageType'] -> ShowS # | |
ToJSON PostPlansRequestBodyUsageType' Source # | |
Defined in StripeAPI.Operations.PostPlans | |
FromJSON PostPlansRequestBodyUsageType' Source # | |
Defined in StripeAPI.Operations.PostPlans Methods parseJSON :: Value -> Parser PostPlansRequestBodyUsageType' # parseJSONList :: Value -> Parser [PostPlansRequestBodyUsageType'] # |
data PostPlansResponse Source #
Represents a response of the operation postPlans
.
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), PostPlansResponseError
is used.
Constructors
PostPlansResponseError String | Means either no matching case available or a parse error |
PostPlansResponse200 Plan | Successful response. |
PostPlansResponseDefault Error | Error response. |
Instances
Eq PostPlansResponse Source # | |
Defined in StripeAPI.Operations.PostPlans Methods (==) :: PostPlansResponse -> PostPlansResponse -> Bool # (/=) :: PostPlansResponse -> PostPlansResponse -> Bool # | |
Show PostPlansResponse Source # | |
Defined in StripeAPI.Operations.PostPlans Methods showsPrec :: Int -> PostPlansResponse -> ShowS # show :: PostPlansResponse -> String # showList :: [PostPlansResponse] -> ShowS # |