Skip to content

Commit b0199cc

Browse files
authored
Merge pull request #738 from recurly/v3-v2021-02-25-21650785939
Generated Latest Changes for v2021-02-25
2 parents 35e6788 + 37e9d84 commit b0199cc

File tree

3 files changed

+316
-2
lines changed

3 files changed

+316
-2
lines changed

openapi/api.yaml

Lines changed: 180 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3312,6 +3312,70 @@ paths:
33123312
{\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
33133313
Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Removed Coupon
33143314
Redemption: %v\", couponRedemption.Id)"
3315+
"/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}":
3316+
get:
3317+
tags:
3318+
- coupon_redemption
3319+
operationId: get_coupon_redemption
3320+
summary: Show the coupon redemption
3321+
parameters:
3322+
- "$ref": "#/components/parameters/account_id"
3323+
- "$ref": "#/components/parameters/coupon_redemption_id"
3324+
responses:
3325+
'200':
3326+
description: A coupon redemption.
3327+
content:
3328+
application/json:
3329+
schema:
3330+
"$ref": "#/components/schemas/CouponRedemption"
3331+
'404':
3332+
description: Incorrect site, account ID, or coupon redemption ID.
3333+
content:
3334+
application/json:
3335+
schema:
3336+
"$ref": "#/components/schemas/Error"
3337+
default:
3338+
description: Unexpected error.
3339+
content:
3340+
application/json:
3341+
schema:
3342+
"$ref": "#/components/schemas/Error"
3343+
x-code-samples: []
3344+
delete:
3345+
tags:
3346+
- coupon_redemption
3347+
operationId: remove_coupon_redemption_by_id
3348+
summary: Delete the coupon redemption
3349+
description: Deactivate the coupon redemption on an account.
3350+
parameters:
3351+
- "$ref": "#/components/parameters/account_id"
3352+
- "$ref": "#/components/parameters/coupon_redemption_id"
3353+
responses:
3354+
'200':
3355+
description: Coupon redemption deleted.
3356+
content:
3357+
application/json:
3358+
schema:
3359+
"$ref": "#/components/schemas/CouponRedemption"
3360+
'404':
3361+
description: Incorrect site, account ID, or coupon redemption ID.
3362+
content:
3363+
application/json:
3364+
schema:
3365+
"$ref": "#/components/schemas/Error"
3366+
'422':
3367+
description: The coupon redemption is already expired or inactive.
3368+
content:
3369+
application/json:
3370+
schema:
3371+
"$ref": "#/components/schemas/Error"
3372+
default:
3373+
description: Unexpected error.
3374+
content:
3375+
application/json:
3376+
schema:
3377+
"$ref": "#/components/schemas/Error"
3378+
x-code-samples: []
33153379
"/accounts/{account_id}/credit_payments":
33163380
get:
33173381
tags:
@@ -14749,6 +14813,70 @@ paths:
1474914813
e, ok := err.(*recurly.Error); ok {\n\t\tfmt.Printf(\"Failed to retrieve
1475014814
next page: %v\", e)\n\t\tbreak\n\t}\n\tfor i, redemption := range subCouponRedemptions.Data()
1475114815
{\n\t\tfmt.Printf(\"Subscription Coupon Redemption %3d: %s\\n\",\n\t\t\ti,\n\t\t\tredemption.Id,\n\t\t)\n\t}\n}"
14816+
"/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}":
14817+
get:
14818+
tags:
14819+
- coupon_redemption
14820+
operationId: get_subscription_coupon_redemption
14821+
summary: Show the coupon redemption for a subscription
14822+
parameters:
14823+
- "$ref": "#/components/parameters/subscription_id"
14824+
- "$ref": "#/components/parameters/coupon_redemption_id"
14825+
responses:
14826+
'200':
14827+
description: The coupon redemption on a subscription.
14828+
content:
14829+
application/json:
14830+
schema:
14831+
"$ref": "#/components/schemas/CouponRedemption"
14832+
'404':
14833+
description: Incorrect site, subscription ID, or coupon redemption ID.
14834+
content:
14835+
application/json:
14836+
schema:
14837+
"$ref": "#/components/schemas/Error"
14838+
default:
14839+
description: Unexpected error.
14840+
content:
14841+
application/json:
14842+
schema:
14843+
"$ref": "#/components/schemas/Error"
14844+
x-code-samples: []
14845+
delete:
14846+
tags:
14847+
- coupon_redemption
14848+
operationId: remove_subscription_coupon_redemption
14849+
summary: Delete the coupon redemption from a subscription
14850+
description: Deactivate the coupon redemption on a subscription.
14851+
parameters:
14852+
- "$ref": "#/components/parameters/subscription_id"
14853+
- "$ref": "#/components/parameters/coupon_redemption_id"
14854+
responses:
14855+
'200':
14856+
description: Coupon redemption deleted.
14857+
content:
14858+
application/json:
14859+
schema:
14860+
"$ref": "#/components/schemas/CouponRedemption"
14861+
'404':
14862+
description: Incorrect site, subscription ID, or coupon redemption ID.
14863+
content:
14864+
application/json:
14865+
schema:
14866+
"$ref": "#/components/schemas/Error"
14867+
'422':
14868+
description: The coupon redemption is already expired or inactive.
14869+
content:
14870+
application/json:
14871+
schema:
14872+
"$ref": "#/components/schemas/Error"
14873+
default:
14874+
description: Unexpected error.
14875+
content:
14876+
application/json:
14877+
schema:
14878+
"$ref": "#/components/schemas/Error"
14879+
x-code-samples: []
1475214880
"/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage":
1475314881
get:
1475414882
tags:
@@ -17051,6 +17179,14 @@ components:
1705117179
required: true
1705217180
schema:
1705317181
type: string
17182+
coupon_redemption_id:
17183+
name: coupon_redemption_id
17184+
in: path
17185+
description: Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`.
17186+
For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
17187+
required: true
17188+
schema:
17189+
type: string
1705417190
credit_payment_id:
1705517191
name: credit_payment_id
1705617192
in: path
@@ -19754,6 +19890,13 @@ components:
1975419890
title: Object type
1975519891
description: Will always be `coupon`.
1975619892
readOnly: true
19893+
uuid:
19894+
type: string
19895+
title: Recurly UUID
19896+
description: The UUID is useful for matching data with the CSV exports and
19897+
building URLs into Recurly's UI.
19898+
maxLength: 32
19899+
readOnly: true
1975719900
account:
1975819901
type: object
1975919902
title: Account
@@ -20974,6 +21117,13 @@ components:
2097421117
title: Credit invoices
2097521118
items:
2097621119
"$ref": "#/components/schemas/Invoice"
21120+
verification_transactions:
21121+
type: array
21122+
title: Verification transactions
21123+
description: Verification transactions (used for free trial payment method
21124+
validation)
21125+
items:
21126+
"$ref": "#/components/schemas/Transaction"
2097721127
InvoiceUpdate:
2097821128
type: object
2097921129
properties:
@@ -27104,10 +27254,20 @@ components:
2710427254
title: Credit Application Policy
2710527255
description: |
2710627256
Controls whether credit invoices are automatically applied to new invoices.
27107-
The `mode` field determines the application behavior.
27257+
The `mode` field determines the application behavior. When mode is `all`,
27258+
the optional `allowed_origins` array can restrict which credit invoice origins
27259+
are applied.
2710827260
properties:
2710927261
mode:
2711027262
"$ref": "#/components/schemas/CreditApplicationModeEnum"
27263+
allowed_origins:
27264+
type: array
27265+
description: |
27266+
Optional array of credit invoice origin types to allow when mode is `all`.
27267+
If not specified when mode is `all`, credits from all origins are applied.
27268+
Only valid when mode is `all`.
27269+
items:
27270+
"$ref": "#/components/schemas/CreditApplicationAllowedOriginTypeEnum"
2711127271
required:
2711227272
- mode
2711327273
CreditApplicationModeEnum:
@@ -27121,6 +27281,25 @@ components:
2712127281
- all
2712227282
- none
2712327283
default: all
27284+
CreditApplicationAllowedOriginTypeEnum:
27285+
type: string
27286+
title: Credit Application Allowed Origin Type
27287+
description: The origin type of a credit invoice that can be allowed in a credit
27288+
application policy
27289+
enum:
27290+
- line_item_refund
27291+
- open_amount_refund
27292+
- immediate_change
27293+
- termination
27294+
- credit
27295+
- write_off
27296+
- refund
27297+
- external_refund
27298+
- carryforward_credit
27299+
- usage_correction
27300+
- prepayment
27301+
- gift_card
27302+
- carryforward_gift_credit
2712427303
InvoiceRefundTypeEnum:
2712527304
type: string
2712627305
enum:

recurly/client.py

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,64 @@ def remove_coupon_redemption(self, account_id, **options):
840840
)
841841
return self._make_request("DELETE", path, None, **options)
842842

843+
def get_coupon_redemption(self, account_id, coupon_redemption_id, **options):
844+
"""Show the coupon redemption
845+
846+
Parameters
847+
----------
848+
849+
account_id : str
850+
Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
851+
coupon_redemption_id : str
852+
Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
853+
854+
Keyword Arguments
855+
-----------------
856+
857+
headers : dict
858+
Extra HTTP headers to send with the request.
859+
860+
Returns
861+
-------
862+
863+
CouponRedemption
864+
A coupon redemption.
865+
"""
866+
path = self._interpolate_path(
867+
"/accounts/%s/coupon_redemptions/%s", account_id, coupon_redemption_id
868+
)
869+
return self._make_request("GET", path, None, **options)
870+
871+
def remove_coupon_redemption_by_id(
872+
self, account_id, coupon_redemption_id, **options
873+
):
874+
"""Delete the coupon redemption
875+
876+
Parameters
877+
----------
878+
879+
account_id : str
880+
Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
881+
coupon_redemption_id : str
882+
Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
883+
884+
Keyword Arguments
885+
-----------------
886+
887+
headers : dict
888+
Extra HTTP headers to send with the request.
889+
890+
Returns
891+
-------
892+
893+
CouponRedemption
894+
Coupon redemption deleted.
895+
"""
896+
path = self._interpolate_path(
897+
"/accounts/%s/coupon_redemptions/%s", account_id, coupon_redemption_id
898+
)
899+
return self._make_request("DELETE", path, None, **options)
900+
843901
def list_account_credit_payments(self, account_id, **options):
844902
"""List an account's credit payments
845903
@@ -4874,6 +4932,70 @@ def list_subscription_coupon_redemptions(self, subscription_id, **options):
48744932
)
48754933
return Pager(self, path, **options)
48764934

4935+
def get_subscription_coupon_redemption(
4936+
self, subscription_id, coupon_redemption_id, **options
4937+
):
4938+
"""Show the coupon redemption for a subscription
4939+
4940+
Parameters
4941+
----------
4942+
4943+
subscription_id : str
4944+
Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4945+
coupon_redemption_id : str
4946+
Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4947+
4948+
Keyword Arguments
4949+
-----------------
4950+
4951+
headers : dict
4952+
Extra HTTP headers to send with the request.
4953+
4954+
Returns
4955+
-------
4956+
4957+
CouponRedemption
4958+
The coupon redemption on a subscription.
4959+
"""
4960+
path = self._interpolate_path(
4961+
"/subscriptions/%s/coupon_redemptions/%s",
4962+
subscription_id,
4963+
coupon_redemption_id,
4964+
)
4965+
return self._make_request("GET", path, None, **options)
4966+
4967+
def remove_subscription_coupon_redemption(
4968+
self, subscription_id, coupon_redemption_id, **options
4969+
):
4970+
"""Delete the coupon redemption from a subscription
4971+
4972+
Parameters
4973+
----------
4974+
4975+
subscription_id : str
4976+
Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4977+
coupon_redemption_id : str
4978+
Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4979+
4980+
Keyword Arguments
4981+
-----------------
4982+
4983+
headers : dict
4984+
Extra HTTP headers to send with the request.
4985+
4986+
Returns
4987+
-------
4988+
4989+
CouponRedemption
4990+
Coupon redemption deleted.
4991+
"""
4992+
path = self._interpolate_path(
4993+
"/subscriptions/%s/coupon_redemptions/%s",
4994+
subscription_id,
4995+
coupon_redemption_id,
4996+
)
4997+
return self._make_request("DELETE", path, None, **options)
4998+
48774999
def list_usage(self, subscription_id, add_on_id, **options):
48785000
"""List a subscription add-on's usage records
48795001

0 commit comments

Comments
 (0)