Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Latest Changes for v2021-02-25 (Support to new subscription fields and response) #169

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12611,7 +12611,16 @@ paths:
- subscription_change
operationId: create_subscription_change
summary: Create a new subscription change
description: Calling this will overwrite an existing, pending subscription change.
description: |
Calling this will overwrite an existing, pending subscription change.

If a subscription has a pending change, and a change is submitted which matches
the subscription as it currently exists, the pending change will be deleted,
and you will receive a 204 No Content response.

If a subscription has no pending
change, and a change is submitted which matches the subscription as it currently
exists, a 422 Unprocessable Entity validation error will be returned.
parameters:
- "$ref": "#/components/parameters/subscription_id"
requestBody:
Expand All @@ -12627,6 +12636,8 @@ paths:
application/json:
schema:
"$ref": "#/components/schemas/SubscriptionChange"
'204':
description: The previous pending change was reverted.
'404':
description: Incorrect site ID.
content:
Expand Down Expand Up @@ -19443,6 +19454,16 @@ components:
format: float
title: Estimated total, before tax.
minimum: 0
tax:
type: number
format: float
title: Estimated tax
tax_info:
"$ref": "#/components/schemas/TaxInfo"
total:
type: number
format: float
title: Estimated total
collection_method:
title: Collection method
default: automatic
Expand Down Expand Up @@ -19502,6 +19523,12 @@ components:
set. This timestamp is used for alerting customers to reauthorize in 3
years in accordance with NACHA rules. If a subscription becomes inactive
or the billing info is no longer a bank account, this timestamp is cleared.
gateway_code:
type: string
title: Gateway Code
description: If present, this subscription's transactions will use the payment
gateway with this code.
maxLength: 13
billing_info_id:
type: string
title: Billing Info ID
Expand Down Expand Up @@ -19956,6 +19983,13 @@ components:
format: float
title: Assigns the subscription's shipping cost. If this is greater than
zero then a `method_id` or `method_code` is required.
address_id:
type: string
titpe: Shipping address ID
description: Assign a shipping address from the account's existing shipping
addresses. If this and address are both present, address will take precedence.
address:
"$ref": "#/components/schemas/ShippingAddressCreate"
SubscriptionCreate:
type: object
properties:
Expand Down Expand Up @@ -20264,6 +20298,12 @@ components:
at 31 days exactly.
minimum: 0
default: 0
gateway_code:
type: string
title: Gateway Code
description: If present, this subscription's transactions will use the payment
gateway with this code.
maxLength: 13
shipping:
"$ref": "#/components/schemas/SubscriptionShippingUpdate"
billing_info_id:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@

public class SubscriptionChangeShippingCreate extends Request {

@SerializedName("address")
@Expose
private ShippingAddressCreate address;

/**
* Assign a shipping address from the account's existing shipping addresses. If this and address
* are both present, address will take precedence.
*/
@SerializedName("address_id")
@Expose
private String addressId;

/**
* Assigns the subscription's shipping cost. If this is greater than zero then a `method_id` or
* `method_code` is required.
Expand All @@ -39,6 +51,31 @@ public class SubscriptionChangeShippingCreate extends Request {
@Expose
private String methodId;

public ShippingAddressCreate getAddress() {
return this.address;
}

/** @param address */
public void setAddress(final ShippingAddressCreate address) {
this.address = address;
}

/**
* Assign a shipping address from the account's existing shipping addresses. If this and address
* are both present, address will take precedence.
*/
public String getAddressId() {
return this.addressId;
}

/**
* @param addressId Assign a shipping address from the account's existing shipping addresses. If
* this and address are both present, address will take precedence.
*/
public void setAddressId(final String addressId) {
this.addressId = addressId;
}

/**
* Assigns the subscription's shipping cost. If this is greater than zero then a `method_id` or
* `method_code` is required.
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/com/recurly/v3/requests/SubscriptionUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public class SubscriptionUpdate extends Request {
@Expose
private String customerNotes;

/** If present, this subscription's transactions will use the payment gateway with this code. */
@SerializedName("gateway_code")
@Expose
private String gatewayCode;

/**
* Integer representing the number of days after an invoice's creation that the invoice will
* become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will
Expand Down Expand Up @@ -181,6 +186,19 @@ public void setCustomerNotes(final String customerNotes) {
this.customerNotes = customerNotes;
}

/** If present, this subscription's transactions will use the payment gateway with this code. */
public String getGatewayCode() {
return this.gatewayCode;
}

/**
* @param gatewayCode If present, this subscription's transactions will use the payment gateway
* with this code.
*/
public void setGatewayCode(final String gatewayCode) {
this.gatewayCode = gatewayCode;
}

/**
* Integer representing the number of days after an invoice's creation that the invoice will
* become past due. If an invoice's net terms are set to '0', it is due 'On Receipt' and will
Expand Down
63 changes: 63 additions & 0 deletions src/main/java/com/recurly/v3/resources/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public class Subscription extends Resource {
@Expose
private DateTime expiresAt;

/** If present, this subscription's transactions will use the payment gateway with this code. */
@SerializedName("gateway_code")
@Expose
private String gatewayCode;

/** Subscription ID */
@SerializedName("id")
@Expose
Expand Down Expand Up @@ -213,11 +218,26 @@ public class Subscription extends Resource {
@Expose
private BigDecimal subtotal;

/** Estimated tax */
@SerializedName("tax")
@Expose
private BigDecimal tax;

/** Tax info */
@SerializedName("tax_info")
@Expose
private TaxInfo taxInfo;

/** Terms and conditions */
@SerializedName("terms_and_conditions")
@Expose
private String termsAndConditions;

/** Estimated total */
@SerializedName("total")
@Expose
private BigDecimal total;

/**
* The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if
* `auto_renew=true` the subscription will renew and a new term will begin, otherwise the
Expand Down Expand Up @@ -489,6 +509,19 @@ public void setExpiresAt(final DateTime expiresAt) {
this.expiresAt = expiresAt;
}

/** If present, this subscription's transactions will use the payment gateway with this code. */
public String getGatewayCode() {
return this.gatewayCode;
}

/**
* @param gatewayCode If present, this subscription's transactions will use the payment gateway
* with this code.
*/
public void setGatewayCode(final String gatewayCode) {
this.gatewayCode = gatewayCode;
}

/** Subscription ID */
public String getId() {
return this.id;
Expand Down Expand Up @@ -665,6 +698,26 @@ public void setSubtotal(final BigDecimal subtotal) {
this.subtotal = subtotal;
}

/** Estimated tax */
public BigDecimal getTax() {
return this.tax;
}

/** @param tax Estimated tax */
public void setTax(final BigDecimal tax) {
this.tax = tax;
}

/** Tax info */
public TaxInfo getTaxInfo() {
return this.taxInfo;
}

/** @param taxInfo Tax info */
public void setTaxInfo(final TaxInfo taxInfo) {
this.taxInfo = taxInfo;
}

/** Terms and conditions */
public String getTermsAndConditions() {
return this.termsAndConditions;
Expand All @@ -675,6 +728,16 @@ public void setTermsAndConditions(final String termsAndConditions) {
this.termsAndConditions = termsAndConditions;
}

/** Estimated total */
public BigDecimal getTotal() {
return this.total;
}

/** @param total Estimated total */
public void setTotal(final BigDecimal total) {
this.total = total;
}

/**
* The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if
* `auto_renew=true` the subscription will renew and a new term will begin, otherwise the
Expand Down