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 (External Subscriptions feature) #226

Merged
merged 1 commit into from
Nov 9, 2022
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
376 changes: 376 additions & 0 deletions openapi/api.yaml

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions src/main/java/com/recurly/v3/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,72 @@ public MeasuredUnit removeMeasuredUnit(String measuredUnitId) {
return this.makeRequest("DELETE", path, returnType);
}

/**
* List a site's external products
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/list_external_products">list_external_products api documentation</a>
* @param queryParams The {@link QueryParams} for this endpoint.
* @return A list of the the external_products on a site.
*/
public Pager<ExternalProduct> listExternalProducts(QueryParams queryParams) {
final String url = "/external_products";
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, ExternalProduct.class).getType();
return new Pager<>(path, paramsMap, this, parameterizedType);
}

/**
* Fetch an external product
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/get_external_product">get_external_product api documentation</a>
* @param externalProductId External product id
* @return Settings for an external product.
*/
public ExternalProduct getExternalProduct(String externalProductId) {
final String url = "/external_products/{external_product_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("external_product_id", externalProductId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = ExternalProduct.class;
return this.makeRequest("GET", path, returnType);
}

/**
* List a site's external subscriptions
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscriptions">list_external_subscriptions api documentation</a>
* @param queryParams The {@link QueryParams} for this endpoint.
* @return A list of the the external_subscriptions on a site.
*/
public Pager<ExternalSubscription> listExternalSubscriptions(QueryParams queryParams) {
final String url = "/external_subscriptions";
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, ExternalSubscription.class).getType();
return new Pager<>(path, paramsMap, this, parameterizedType);
}

/**
* 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
* @return Settings for an external subscription.
*/
public ExternalSubscription getExternalSubscription(String externalSubscriptionId) {
final String url = "/external_subscriptions/{external_subscription_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("external_subscription_id", externalSubscriptionId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = ExternalSubscription.class;
return this.makeRequest("GET", path, returnType);
}

/**
* List a site's invoices
*
Expand Down Expand Up @@ -2428,4 +2494,23 @@ public Pager<Entitlements> listEntitlements(String accountId, QueryParams queryP
Type parameterizedType = TypeToken.getParameterized(Pager.class, Entitlements.class).getType();
return new Pager<>(path, paramsMap, this, parameterizedType);
}

/**
* List an account's external subscriptions
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_subscriptions">list_account_external_subscriptions api documentation</a>
* @param accountId Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
* @param queryParams The {@link QueryParams} for this endpoint.
* @return A list of the the external_subscriptions on an account.
*/
public Pager<ExternalSubscription> listAccountExternalSubscriptions(String accountId, QueryParams queryParams) {
final String url = "/accounts/{account_id}/external_subscriptions";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("account_id", accountId);
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, ExternalSubscription.class).getType();
return new Pager<>(path, paramsMap, this, parameterizedType);
}
}
11 changes: 11 additions & 0 deletions src/main/java/com/recurly/v3/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ public enum UsageType {

};

public enum UsageCalculationType {
UNDEFINED,

@SerializedName("cumulative")
CUMULATIVE,

@SerializedName("last_in_period")
LAST_IN_PERIOD,

};

public enum BillingStatus {
UNDEFINED,

Expand Down
30 changes: 30 additions & 0 deletions src/main/java/com/recurly/v3/requests/AddOnCreate.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ public class AddOnCreate extends Request {
@Expose
private List<Tier> tiers;

/**
* The type of calculation to be employed for an add-on. Cumulative billing will sum all usage
* records created in the current billing cycle. Last-in-period billing will apply only the most
* recent usage record in the billing period. If no value is specified, cumulative billing will be
* used.
*/
@SerializedName("usage_calculation_type")
@Expose
private Constants.UsageCalculationType usageCalculationType;

/**
* 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, `tier_type` is
Expand Down Expand Up @@ -563,6 +573,26 @@ public void setTiers(final List<Tier> tiers) {
this.tiers = tiers;
}

/**
* The type of calculation to be employed for an add-on. Cumulative billing will sum all usage
* records created in the current billing cycle. Last-in-period billing will apply only the most
* recent usage record in the billing period. If no value is specified, cumulative billing will be
* used.
*/
public Constants.UsageCalculationType getUsageCalculationType() {
return this.usageCalculationType;
}

/**
* @param usageCalculationType The type of calculation to be employed for an add-on. Cumulative
* billing will sum all usage records created in the current billing cycle. Last-in-period
* billing will apply only the most recent usage record in the billing period. If no value is
* specified, cumulative billing will be used.
*/
public void setUsageCalculationType(final Constants.UsageCalculationType usageCalculationType) {
this.usageCalculationType = usageCalculationType;
}

/**
* 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, `tier_type` is
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/com/recurly/v3/requests/AddOnUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ public class AddOnUpdate extends Request {
@Expose
private List<Tier> tiers;

/**
* The type of calculation to be employed for an add-on. Cumulative billing will sum all usage
* records created in the current billing cycle. Last-in-period billing will apply only the most
* recent usage record in the billing period. If no value is specified, cumulative billing will be
* used.
*/
@SerializedName("usage_calculation_type")
@Expose
private Constants.UsageCalculationType usageCalculationType;

/**
* 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, `tier_type` is
Expand Down Expand Up @@ -438,6 +448,26 @@ public void setTiers(final List<Tier> tiers) {
this.tiers = tiers;
}

/**
* The type of calculation to be employed for an add-on. Cumulative billing will sum all usage
* records created in the current billing cycle. Last-in-period billing will apply only the most
* recent usage record in the billing period. If no value is specified, cumulative billing will be
* used.
*/
public Constants.UsageCalculationType getUsageCalculationType() {
return this.usageCalculationType;
}

/**
* @param usageCalculationType The type of calculation to be employed for an add-on. Cumulative
* billing will sum all usage records created in the current billing cycle. Last-in-period
* billing will apply only the most recent usage record in the billing period. If no value is
* specified, cumulative billing will be used.
*/
public void setUsageCalculationType(final Constants.UsageCalculationType usageCalculationType) {
this.usageCalculationType = usageCalculationType;
}

/**
* 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, `tier_type` is
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/com/recurly/v3/resources/AddOn.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ public class AddOn extends Resource {
@Expose
private DateTime updatedAt;

/**
* The type of calculation to be employed for an add-on. Cumulative billing will sum all usage
* records created in the current billing cycle. Last-in-period billing will apply only the most
* recent usage record in the billing period. If no value is specified, cumulative billing will be
* used.
*/
@SerializedName("usage_calculation_type")
@Expose
private Constants.UsageCalculationType usageCalculationType;

/**
* 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.
Expand Down Expand Up @@ -509,6 +519,26 @@ public void setUpdatedAt(final DateTime updatedAt) {
this.updatedAt = updatedAt;
}

/**
* The type of calculation to be employed for an add-on. Cumulative billing will sum all usage
* records created in the current billing cycle. Last-in-period billing will apply only the most
* recent usage record in the billing period. If no value is specified, cumulative billing will be
* used.
*/
public Constants.UsageCalculationType getUsageCalculationType() {
return this.usageCalculationType;
}

/**
* @param usageCalculationType The type of calculation to be employed for an add-on. Cumulative
* billing will sum all usage records created in the current billing cycle. Last-in-period
* billing will apply only the most recent usage record in the billing period. If no value is
* specified, cumulative billing will be used.
*/
public void setUsageCalculationType(final Constants.UsageCalculationType usageCalculationType) {
this.usageCalculationType = usageCalculationType;
}

/**
* 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.
Expand Down
125 changes: 125 additions & 0 deletions src/main/java/com/recurly/v3/resources/ExternalProduct.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
/**
* This file is automatically created by Recurly's OpenAPI generation process and thus any edits you
* make by hand will be lost. If you wish to make a change to this file, please create a Github
* issue explaining the changes you need and we will usher them to the appropriate places.
*/
package com.recurly.v3.resources;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.recurly.v3.Resource;
import java.util.List;
import org.joda.time.DateTime;

public class ExternalProduct extends Resource {

/** When the external product was created in Recurly. */
@SerializedName("created_at")
@Expose
private DateTime createdAt;

/** List of external product references of the external product. */
@SerializedName("external_product_references")
@Expose
private List<ExternalProductReferenceMini> externalProductReferences;

/** System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`. */
@SerializedName("id")
@Expose
private String id;

/** Name to identify the external product in Recurly. */
@SerializedName("name")
@Expose
private String name;

/** Object type */
@SerializedName("object")
@Expose
private String object;

/** Just the important parts. */
@SerializedName("plan")
@Expose
private PlanMini plan;

/** When the external product was updated in Recurly. */
@SerializedName("updated_at")
@Expose
private DateTime updatedAt;

/** When the external product was created in Recurly. */
public DateTime getCreatedAt() {
return this.createdAt;
}

/** @param createdAt When the external product was created in Recurly. */
public void setCreatedAt(final DateTime createdAt) {
this.createdAt = createdAt;
}

/** List of external product references of the external product. */
public List<ExternalProductReferenceMini> getExternalProductReferences() {
return this.externalProductReferences;
}

/**
* @param externalProductReferences List of external product references of the external product.
*/
public void setExternalProductReferences(
final List<ExternalProductReferenceMini> externalProductReferences) {
this.externalProductReferences = externalProductReferences;
}

/** System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`. */
public String getId() {
return this.id;
}

/**
* @param id System-generated unique identifier for an external product ID, e.g. `e28zov4fw0v2`.
*/
public void setId(final String id) {
this.id = id;
}

/** Name to identify the external product in Recurly. */
public String getName() {
return this.name;
}

/** @param name Name to identify the external product in Recurly. */
public void setName(final String name) {
this.name = name;
}

/** Object type */
public String getObject() {
return this.object;
}

/** @param object Object type */
public void setObject(final String object) {
this.object = object;
}

/** Just the important parts. */
public PlanMini getPlan() {
return this.plan;
}

/** @param plan Just the important parts. */
public void setPlan(final PlanMini plan) {
this.plan = plan;
}

/** When the external product was updated in Recurly. */
public DateTime getUpdatedAt() {
return this.updatedAt;
}

/** @param updatedAt When the external product was updated in Recurly. */
public void setUpdatedAt(final DateTime updatedAt) {
this.updatedAt = updatedAt;
}
}
Loading