Skip to content

Commit a063ded

Browse files
author
Recurly Integrations
authored
Generated Latest Changes for v2021-02-25
1 parent e4d9492 commit a063ded

13 files changed

Lines changed: 427 additions & 19 deletions

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:

src/main/java/com/recurly/v3/Client.java

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,42 @@ public CouponRedemption removeCouponRedemption(String accountId) {
530530
return this.makeRequest("DELETE", path, returnType);
531531
}
532532

533+
/**
534+
* Show the coupon redemption
535+
*
536+
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_coupon_redemption">get_coupon_redemption api documentation</a>
537+
* @param accountId Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
538+
* @param couponRedemptionId Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
539+
* @return A coupon redemption.
540+
*/
541+
public CouponRedemption getCouponRedemption(String accountId, String couponRedemptionId) {
542+
final String url = "/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}";
543+
final HashMap<String, String> urlParams = new HashMap<String, String>();
544+
urlParams.put("account_id", accountId);
545+
urlParams.put("coupon_redemption_id", couponRedemptionId);
546+
final String path = this.interpolatePath(url, urlParams);
547+
Type returnType = CouponRedemption.class;
548+
return this.makeRequest("GET", path, returnType);
549+
}
550+
551+
/**
552+
* Delete the coupon redemption
553+
*
554+
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption_by_id">remove_coupon_redemption_by_id api documentation</a>
555+
* @param accountId Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
556+
* @param couponRedemptionId Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
557+
* @return Coupon redemption deleted.
558+
*/
559+
public CouponRedemption removeCouponRedemptionById(String accountId, String couponRedemptionId) {
560+
final String url = "/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}";
561+
final HashMap<String, String> urlParams = new HashMap<String, String>();
562+
urlParams.put("account_id", accountId);
563+
urlParams.put("coupon_redemption_id", couponRedemptionId);
564+
final String path = this.interpolatePath(url, urlParams);
565+
Type returnType = CouponRedemption.class;
566+
return this.makeRequest("DELETE", path, returnType);
567+
}
568+
533569
/**
534570
* List an account's credit payments
535571
*
@@ -2694,6 +2730,42 @@ public Pager<CouponRedemption> listSubscriptionCouponRedemptions(String subscrip
26942730
return new Pager<>(path, paramsMap, this, parameterizedType);
26952731
}
26962732

2733+
/**
2734+
* Show the coupon redemption for a subscription
2735+
*
2736+
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_coupon_redemption">get_subscription_coupon_redemption api documentation</a>
2737+
* @param subscriptionId Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
2738+
* @param couponRedemptionId Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
2739+
* @return The coupon redemption on a subscription.
2740+
*/
2741+
public CouponRedemption getSubscriptionCouponRedemption(String subscriptionId, String couponRedemptionId) {
2742+
final String url = "/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}";
2743+
final HashMap<String, String> urlParams = new HashMap<String, String>();
2744+
urlParams.put("subscription_id", subscriptionId);
2745+
urlParams.put("coupon_redemption_id", couponRedemptionId);
2746+
final String path = this.interpolatePath(url, urlParams);
2747+
Type returnType = CouponRedemption.class;
2748+
return this.makeRequest("GET", path, returnType);
2749+
}
2750+
2751+
/**
2752+
* Delete the coupon redemption from a subscription
2753+
*
2754+
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_coupon_redemption">remove_subscription_coupon_redemption api documentation</a>
2755+
* @param subscriptionId Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
2756+
* @param couponRedemptionId Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
2757+
* @return Coupon redemption deleted.
2758+
*/
2759+
public CouponRedemption removeSubscriptionCouponRedemption(String subscriptionId, String couponRedemptionId) {
2760+
final String url = "/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}";
2761+
final HashMap<String, String> urlParams = new HashMap<String, String>();
2762+
urlParams.put("subscription_id", subscriptionId);
2763+
urlParams.put("coupon_redemption_id", couponRedemptionId);
2764+
final String path = this.interpolatePath(url, urlParams);
2765+
Type returnType = CouponRedemption.class;
2766+
return this.makeRequest("DELETE", path, returnType);
2767+
}
2768+
26972769
/**
26982770
* List a subscription add-on's usage records
26992771
*

src/main/java/com/recurly/v3/Constants.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,50 @@ public enum CreditApplicationMode {
887887

888888
};
889889

890+
public enum CreditApplicationAllowedOriginType {
891+
UNDEFINED,
892+
893+
@SerializedName("line_item_refund")
894+
LINE_ITEM_REFUND,
895+
896+
@SerializedName("open_amount_refund")
897+
OPEN_AMOUNT_REFUND,
898+
899+
@SerializedName("immediate_change")
900+
IMMEDIATE_CHANGE,
901+
902+
@SerializedName("termination")
903+
TERMINATION,
904+
905+
@SerializedName("credit")
906+
CREDIT,
907+
908+
@SerializedName("write_off")
909+
WRITE_OFF,
910+
911+
@SerializedName("refund")
912+
REFUND,
913+
914+
@SerializedName("external_refund")
915+
EXTERNAL_REFUND,
916+
917+
@SerializedName("carryforward_credit")
918+
CARRYFORWARD_CREDIT,
919+
920+
@SerializedName("usage_correction")
921+
USAGE_CORRECTION,
922+
923+
@SerializedName("prepayment")
924+
PREPAYMENT,
925+
926+
@SerializedName("gift_card")
927+
GIFT_CARD,
928+
929+
@SerializedName("carryforward_gift_credit")
930+
CARRYFORWARD_GIFT_CREDIT,
931+
932+
};
933+
890934
public enum InvoiceRefundType {
891935
UNDEFINED,
892936

0 commit comments

Comments
 (0)