Skip to content

Commit

Permalink
Merge pull request #485 from recurly/v3-v2021-02-25-1616706546
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (Usage Percentage on Tiers)
  • Loading branch information
douglasmiller authored Mar 25, 2021
2 parents 45a7be8 + da238b9 commit 7eb30e6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
21 changes: 13 additions & 8 deletions openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15735,8 +15735,8 @@ components:
title: Usage Percentage
description: The percentage taken of the monetary amount of usage tracked.
This can be up to 4 decimal places. A value between 0.0 and 100.0. Required
if `add_on_type` is usage and `usage_type` is percentage. Must be omitted
otherwise. `usage_percentage` does not support tiers.
if `add_on_type` is usage, `tier_type` is `flat` and `usage_type` is percentage.
Must be omitted otherwise.
measured_unit_id:
type: string
title: Measured Unit ID
Expand Down Expand Up @@ -15842,7 +15842,7 @@ components:
description: |
If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
must include one to many tiers with `ending_quantity` and `unit_amount` for
the desired `currencies`. There must be one tier with an `ending_quantity`
the desired `currencies`, or alternatively, `usage_percentage` for usage percentage type usage add ons. There must be one tier with an `ending_quantity`
of 999999999 which is the default if not provided.
required:
- code
Expand Down Expand Up @@ -15875,8 +15875,8 @@ components:
title: Usage Percentage
description: The percentage taken of the monetary amount of usage tracked.
This can be up to 4 decimal places. A value between 0.0 and 100.0. Required
if `add_on_type` is usage and `usage_type` is percentage. Must be omitted
otherwise. `usage_percentage` does not support tiers.
if `add_on_type` is usage, `tier_type` is `flat` and `usage_type` is percentage.
Must be omitted otherwise.
measured_unit_id:
type: string
title: Measured Unit ID
Expand Down Expand Up @@ -15971,7 +15971,7 @@ components:
description: |
If the tier_type is `flat`, then `tiers` must be absent. The `tiers` object
must include one to many tiers with `ending_quantity` and `unit_amount` for
the desired `currencies`. There must be one tier with an `ending_quantity`
the desired `currencies`, or alternatively, `usage_percentage` for usage percentage type usage add ons. There must be one tier with an `ending_quantity`
of 999999999 which is the default if not provided.
BillingInfo:
type: object
Expand Down Expand Up @@ -18626,17 +18626,22 @@ components:
ending_quantity:
type: integer
title: Ending quantity
description: Ending quantity for the tier. This represents a unit amount
for unit-priced add ons, but for percentage type usage add ons, represents
the site default currency in its minimum divisible unit.
minimum: 1
maximum: 999999999
default: 999999999
usage_percentage:
type: string
title: Usage Percentage
description: Decimal usage percentage.
currencies:
type: array
title: Tier pricing
items:
"$ref": "#/components/schemas/TierPricing"
minItems: 1
required:
- currencies
Settings:
type: object
properties:
Expand Down
10 changes: 8 additions & 2 deletions recurly/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -2330,10 +2330,16 @@ class Tier(Resource):
currencies : :obj:`list` of :obj:`TierPricing`
Tier pricing
ending_quantity : int
Ending quantity
Ending quantity for the tier. This represents a unit amount for unit-priced add ons, but for percentage type usage add ons, represents the site default currency in its minimum divisible unit.
usage_percentage : str
Decimal usage percentage.
"""

schema = {"currencies": ["TierPricing"], "ending_quantity": int}
schema = {
"currencies": ["TierPricing"],
"ending_quantity": int,
"usage_percentage": str,
}


class TierPricing(Resource):
Expand Down

0 comments on commit 7eb30e6

Please sign in to comment.