Skip to content

Commit

Permalink
Merge pull request #276 from recurly/v3-v2021-02-25-9766218312
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (Taxable Address Control, RevRec)
  • Loading branch information
amandamfielding authored Jul 3, 2024
2 parents c17273f + 73aff16 commit d6ff069
Show file tree
Hide file tree
Showing 25 changed files with 2,792 additions and 38 deletions.
871 changes: 861 additions & 10 deletions openapi/api.yaml

Large diffs are not rendered by default.

103 changes: 99 additions & 4 deletions src/main/java/com/recurly/v3/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ public Pager<CustomFieldDefinition> listCustomFieldDefinitions(QueryParams query
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_custom_field_definition">get_custom_field_definition api documentation</a>
* @param customFieldDefinitionId Custom Field Definition ID
* @return An custom field definition.
* @return A custom field definition.
*/
public CustomFieldDefinition getCustomFieldDefinition(String customFieldDefinitionId) {
final String url = "/custom_field_definitions/{custom_field_definition_id}";
Expand All @@ -1091,6 +1091,101 @@ public CustomFieldDefinition getCustomFieldDefinition(String customFieldDefiniti
return this.makeRequest("GET", path, returnType);
}

/**
* Create a new general ledger account
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/create_general_ledger_account">create_general_ledger_account api documentation</a>
* @param body The body of the request.
* @return A new general ledger account.
*/
public GeneralLedgerAccount createGeneralLedgerAccount(GeneralLedgerAccountCreate body) {
final String url = "/general_ledger_accounts";
final HashMap<String, String> urlParams = new HashMap<String, String>();
final String path = this.interpolatePath(url, urlParams);
Type returnType = GeneralLedgerAccount.class;
return this.makeRequest("POST", path, body, returnType);
}

/**
* List a site's general ledger accounts
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/list_general_ledger_accounts">list_general_ledger_accounts api documentation</a>
* @param queryParams The {@link QueryParams} for this endpoint.
* @return A list of the site's general ledger accounts.
*/
public Pager<GeneralLedgerAccount> listGeneralLedgerAccounts(QueryParams queryParams) {
final String url = "/general_ledger_accounts";
final HashMap<String, String> urlParams = new HashMap<String, String>();
if (queryParams == null) queryParams = new QueryParams();
final HashMap<String, Object> paramsMap = queryParams.getParams();
final String path = this.interpolatePath(url, urlParams);
Type parameterizedType = TypeToken.getParameterized(Pager.class, GeneralLedgerAccount.class).getType();
return new Pager<>(path, paramsMap, this, parameterizedType);
}

/**
* Fetch a general ledger account
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_general_ledger_account">get_general_ledger_account api documentation</a>
* @param generalLedgerAccountId General Ledger Account ID
* @return A general ledger account.
*/
public GeneralLedgerAccount getGeneralLedgerAccount(String generalLedgerAccountId) {
final String url = "/general_ledger_accounts/{general_ledger_account_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("general_ledger_account_id", generalLedgerAccountId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = GeneralLedgerAccount.class;
return this.makeRequest("GET", path, returnType);
}

/**
* Update a general ledger account
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/update_general_ledger_account">update_general_ledger_account api documentation</a>
* @param generalLedgerAccountId General Ledger Account ID
* @param body The body of the request.
* @return The updated general ledger account.
*/
public GeneralLedgerAccount updateGeneralLedgerAccount(String generalLedgerAccountId, GeneralLedgerAccountUpdate body) {
final String url = "/general_ledger_accounts/{general_ledger_account_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("general_ledger_account_id", generalLedgerAccountId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = GeneralLedgerAccount.class;
return this.makeRequest("PUT", path, body, returnType);
}

/**
* Get a single Performance Obligation.
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligation">get_performance_obligation api documentation</a>
* @param performanceObligationId Performance Obligation id.
* @return A single Performance Obligation.
*/
public PerformanceObligation getPerformanceObligation(String performanceObligationId) {
final String url = "/performance_obligations/{performance_obligation_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("performance_obligation_id", performanceObligationId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = PerformanceObligation.class;
return this.makeRequest("GET", path, returnType);
}

/**
* Get a site's Performance Obligations
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_performance_obligations">get_performance_obligations api documentation</a>
* @return A list of Performance Obligations.
*/
public Pager<PerformanceObligation> getPerformanceObligations() {
final String url = "/performance_obligations";
final HashMap<String, String> urlParams = new HashMap<String, String>();
final String path = this.interpolatePath(url, urlParams);
Type parameterizedType = TypeToken.getParameterized(Pager.class, PerformanceObligation.class).getType();
return new Pager<>(path, null, this, parameterizedType);
}

/**
* List an invoice template's associated accounts
*
Expand Down Expand Up @@ -1462,7 +1557,7 @@ public Pager<ExternalSubscription> listExternalSubscriptions(QueryParams queryPa
* Fetch an external subscription
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription">get_external_subscription api documentation</a>
* @param externalSubscriptionId External subscription id
* @param externalSubscriptionId External subscription ID or external_id. For ID no prefix is used e.g. `e28zov4fw0v2`. For external_id use prefix `external-id-`, e.g. `external-id-123456`.
* @return Settings for an external subscription.
*/
public ExternalSubscription getExternalSubscription(String externalSubscriptionId) {
Expand Down Expand Up @@ -2838,12 +2933,12 @@ public Pager<ExternalPaymentPhase> listExternalSubscriptionExternalPaymentPhases
}

/**
* Fetch an external payment_phase
* Fetch an external payment phase
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription_external_payment_phase">get_external_subscription_external_payment_phase api documentation</a>
* @param externalSubscriptionId External subscription id
* @param externalPaymentPhaseId External payment phase ID, e.g. `a34ypb2ef9w1`.
* @return Details for an external payment_phase.
* @return Details for an external payment phase.
*/
public ExternalPaymentPhase getExternalSubscriptionExternalPaymentPhase(String externalSubscriptionId, String externalPaymentPhaseId) {
final String url = "/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}";
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/recurly/v3/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2273,4 +2273,37 @@ public enum ExternalInvoiceState {

};

public enum GeneralLedgerAccountType {
UNDEFINED,

@SerializedName("liability")
LIABILITY,

@SerializedName("revenue")
REVENUE,

};

public enum OriginTaxAddressSource {
UNDEFINED,

@SerializedName("origin")
ORIGIN,

@SerializedName("destination")
DESTINATION,

};

public enum DestinationTaxAddressSource {
UNDEFINED,

@SerializedName("destination")
DESTINATION,

@SerializedName("origin")
ORIGIN,

};

}
4 changes: 4 additions & 0 deletions src/main/java/com/recurly/v3/QueryParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public void setRelatedType(final Constants.RelatedType relatedType) {
this.add("related_type", relatedType);
}

public void setAccountType(final Constants.GeneralLedgerAccountType accountType) {
this.add("account_type", accountType);
}

public void setRefund(final Constants.RefundType refund) {
this.add("refund", refund);
}
Expand Down
86 changes: 80 additions & 6 deletions src/main/java/com/recurly/v3/requests/AddOnCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class AddOnCreate extends Request {
private String code;

/**
* * If `item_code`/`item_id` is part of the request and the item has a default currency then
* * If `item_code`/`item_id` is part of the request and the item has a default currency, then
* `currencies` is optional. If the item does not have a default currency, then `currencies` is
* required. If `item_code`/`item_id` is not present `currencies` is required. If the add-on's
* `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent. Must be
Expand All @@ -81,7 +81,7 @@ public class AddOnCreate extends Request {
private Boolean displayQuantity;

/**
* Unique code to identify an item. Available when the `Credit Invoices` feature are enabled. If
* Unique code to identify an item. Available when the `Credit Invoices` feature is enabled. If
* `item_id` and `item_code` are both present, `item_id` will be used.
*/
@SerializedName("item_code")
Expand All @@ -96,6 +96,14 @@ public class AddOnCreate extends Request {
@Expose
private String itemId;

/**
* The ID of a general ledger account. General ledger accounts are only accessible as a part of
* the Recurly RevRec Standard and Recurly RevRec Advanced features.
*/
@SerializedName("liability_gl_account_id")
@Expose
private String liabilityGlAccountId;

/**
* System-generated unique identifier for a measured unit to be associated with the add-on. Either
* `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If
Expand Down Expand Up @@ -143,11 +151,27 @@ public class AddOnCreate extends Request {
@Expose
private List<PercentageTiersByCurrency> percentageTiers;

/**
* The ID of a performance obligation. Performance obligations are only accessible as a part of
* the Recurly RevRec Standard and Recurly RevRec Advanced features.
*/
@SerializedName("performance_obligation_id")
@Expose
private String performanceObligationId;

/** Plan ID */
@SerializedName("plan_id")
@Expose
private String planId;

/**
* The ID of a general ledger account. General ledger accounts are only accessible as a part of
* the Recurly RevRec Standard and Recurly RevRec Advanced features.
*/
@SerializedName("revenue_gl_account_id")
@Expose
private String revenueGlAccountId;

/**
* When this add-on is invoiced, the line item will use this revenue schedule. If
* `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the
Expand Down Expand Up @@ -313,7 +337,7 @@ public void setCode(final String code) {
}

/**
* * If `item_code`/`item_id` is part of the request and the item has a default currency then
* * If `item_code`/`item_id` is part of the request and the item has a default currency, then
* `currencies` is optional. If the item does not have a default currency, then `currencies` is
* required. If `item_code`/`item_id` is not present `currencies` is required. If the add-on's
* `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must be absent. Must be
Expand All @@ -325,7 +349,7 @@ public List<AddOnPricing> getCurrencies() {

/**
* @param currencies * If `item_code`/`item_id` is part of the request and the item has a default
* currency then `currencies` is optional. If the item does not have a default currency, then
* currency, then `currencies` is optional. If the item does not have a default currency, then
* `currencies` is required. If `item_code`/`item_id` is not present `currencies` is required.
* If the add-on's `tier_type` is `tiered`, `volume`, or `stairstep`, then `currencies` must
* be absent. Must be absent if `add_on_type` is `usage` and `usage_type` is `percentage`.
Expand Down Expand Up @@ -358,7 +382,7 @@ public void setDisplayQuantity(final Boolean displayQuantity) {
}

/**
* Unique code to identify an item. Available when the `Credit Invoices` feature are enabled. If
* Unique code to identify an item. Available when the `Credit Invoices` feature is enabled. If
* `item_id` and `item_code` are both present, `item_id` will be used.
*/
public String getItemCode() {
Expand All @@ -367,7 +391,7 @@ public String getItemCode() {

/**
* @param itemCode Unique code to identify an item. Available when the `Credit Invoices` feature
* are enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
* is enabled. If `item_id` and `item_code` are both present, `item_id` will be used.
*/
public void setItemCode(final String itemCode) {
this.itemCode = itemCode;
Expand All @@ -390,6 +414,23 @@ public void setItemId(final String itemId) {
this.itemId = itemId;
}

/**
* The ID of a general ledger account. General ledger accounts are only accessible as a part of
* the Recurly RevRec Standard and Recurly RevRec Advanced features.
*/
public String getLiabilityGlAccountId() {
return this.liabilityGlAccountId;
}

/**
* @param liabilityGlAccountId The ID of a general ledger account. General ledger accounts are
* only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced
* features.
*/
public void setLiabilityGlAccountId(final String liabilityGlAccountId) {
this.liabilityGlAccountId = liabilityGlAccountId;
}

/**
* System-generated unique identifier for a measured unit to be associated with the add-on. Either
* `measured_unit_id` or `measured_unit_name` are required when `add_on_type` is `usage`. If
Expand Down Expand Up @@ -487,6 +528,23 @@ public void setPercentageTiers(final List<PercentageTiersByCurrency> percentageT
this.percentageTiers = percentageTiers;
}

/**
* The ID of a performance obligation. Performance obligations are only accessible as a part of
* the Recurly RevRec Standard and Recurly RevRec Advanced features.
*/
public String getPerformanceObligationId() {
return this.performanceObligationId;
}

/**
* @param performanceObligationId The ID of a performance obligation. Performance obligations are
* only accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced
* features.
*/
public void setPerformanceObligationId(final String performanceObligationId) {
this.performanceObligationId = performanceObligationId;
}

/** Plan ID */
public String getPlanId() {
return this.planId;
Expand All @@ -497,6 +555,22 @@ public void setPlanId(final String planId) {
this.planId = planId;
}

/**
* The ID of a general ledger account. General ledger accounts are only accessible as a part of
* the Recurly RevRec Standard and Recurly RevRec Advanced features.
*/
public String getRevenueGlAccountId() {
return this.revenueGlAccountId;
}

/**
* @param revenueGlAccountId The ID of a general ledger account. General ledger accounts are only
* accessible as a part of the Recurly RevRec Standard and Recurly RevRec Advanced features.
*/
public void setRevenueGlAccountId(final String revenueGlAccountId) {
this.revenueGlAccountId = revenueGlAccountId;
}

/**
* When this add-on is invoiced, the line item will use this revenue schedule. If
* `item_code`/`item_id` is part of the request then `revenue_schedule_type` must be absent in the
Expand Down
Loading

0 comments on commit d6ff069

Please sign in to comment.