Skip to content
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
923 changes: 609 additions & 314 deletions openapi/api.yaml

Large diffs are not rendered by default.

128 changes: 128 additions & 0 deletions src/main/java/com/recurly/v3/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -6870,6 +6870,37 @@ public Pager<DunningCampaign> listDunningCampaigns(ListDunningCampaignsParams qu
return new Pager<>(path, paramsMap, this, parameterizedType);
}

/**
* Create a new dunning campaign
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/create_dunning_campaign">create_dunning_campaign api documentation</a>
* @param body The body of the request.
* @return A new dunning campaign.
*/
public DunningCampaign createDunningCampaign(DunningCampaignCreate body) {
final String url = "/dunning_campaigns";
final HashMap<String, String> urlParams = new HashMap<String, String>();
final String path = this.interpolatePath(url, urlParams);
Type returnType = DunningCampaign.class;
return this.makeRequest("POST", path, body, returnType);
}

/**
* Create a new dunning campaign
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/create_dunning_campaign">create_dunning_campaign api documentation</a>
* @param body The body of the request.
* @param options The {@link RequestOptions} for this request.
* @return A new dunning campaign.
*/
public DunningCampaign createDunningCampaign(DunningCampaignCreate body, RequestOptions options) {
final String url = "/dunning_campaigns";
final HashMap<String, String> urlParams = new HashMap<String, String>();
final String path = this.interpolatePath(url, urlParams);
Type returnType = DunningCampaign.class;
return this.makeRequest("POST", path, body, options, returnType);
}

/**
* Fetch a dunning campaign
*
Expand Down Expand Up @@ -6903,6 +6934,103 @@ public DunningCampaign getDunningCampaign(String dunningCampaignId, RequestOptio
return this.makeRequest("GET", path, options, returnType);
}

/**
* Update a dunning campaign
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/update_dunning_campaign">update_dunning_campaign api documentation</a>
* @param dunningCampaignId Dunning Campaign ID, e.g. `e28zov4fw0v2`.
* @param body The body of the request.
* @return The updated dunning campaign.
*/
public DunningCampaign updateDunningCampaign(String dunningCampaignId, DunningCampaignUpdate body) {
final String url = "/dunning_campaigns/{dunning_campaign_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("dunning_campaign_id", dunningCampaignId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = DunningCampaign.class;
return this.makeRequest("PUT", path, body, returnType);
}

/**
* Update a dunning campaign
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/update_dunning_campaign">update_dunning_campaign api documentation</a>
* @param dunningCampaignId Dunning Campaign ID, e.g. `e28zov4fw0v2`.
* @param body The body of the request.
* @param options The {@link RequestOptions} for this request.
* @return The updated dunning campaign.
*/
public DunningCampaign updateDunningCampaign(String dunningCampaignId, DunningCampaignUpdate body, RequestOptions options) {
final String url = "/dunning_campaigns/{dunning_campaign_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("dunning_campaign_id", dunningCampaignId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = DunningCampaign.class;
return this.makeRequest("PUT", path, body, options, returnType);
}

/**
* Deactivate a dunning campaign
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/deactivate_dunning_campaign">deactivate_dunning_campaign api documentation</a>
* @param dunningCampaignId Dunning Campaign ID, e.g. `e28zov4fw0v2`.
* @return The deactivated dunning campaign.
*/
public DunningCampaign deactivateDunningCampaign(String dunningCampaignId) {
final String url = "/dunning_campaigns/{dunning_campaign_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("dunning_campaign_id", dunningCampaignId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = DunningCampaign.class;
return this.makeRequest("DELETE", path, returnType);
}

/**
* Deactivate a dunning campaign
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/deactivate_dunning_campaign">deactivate_dunning_campaign api documentation</a>
* @param dunningCampaignId Dunning Campaign ID, e.g. `e28zov4fw0v2`.
* @param options The {@link RequestOptions} for this request.
* @return The deactivated dunning campaign.
*/
public DunningCampaign deactivateDunningCampaign(String dunningCampaignId, RequestOptions options) {
final String url = "/dunning_campaigns/{dunning_campaign_id}";
final HashMap<String, String> urlParams = new HashMap<String, String>();
urlParams.put("dunning_campaign_id", dunningCampaignId);
final String path = this.interpolatePath(url, urlParams);
Type returnType = DunningCampaign.class;
return this.makeRequest("DELETE", path, options, returnType);
}

/**
* List the custom email templates assignable to a dunning campaign interval
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/list_dunning_campaign_email_templates">list_dunning_campaign_email_templates api documentation</a>
* @return A list of the site's assignable custom email templates.
*/
public Pager<DunningCampaignEmailTemplate> listDunningCampaignEmailTemplates() {
final String url = "/dunning_campaigns/email_templates";
final HashMap<String, String> urlParams = new HashMap<String, String>();
final String path = this.interpolatePath(url, urlParams);
Type parameterizedType = TypeToken.getParameterized(Pager.class, DunningCampaignEmailTemplate.class).getType();
return new Pager<>(path, null, this, parameterizedType);
}

/**
* List the custom email templates assignable to a dunning campaign interval
*
* @see <a href="https://developers.recurly.com/api/v2021-02-25#operation/list_dunning_campaign_email_templates">list_dunning_campaign_email_templates api documentation</a>
* @param options The {@link RequestOptions} for this request.
* @return A list of the site's assignable custom email templates.
*/
public Pager<DunningCampaignEmailTemplate> listDunningCampaignEmailTemplates(RequestOptions options) {
final String url = "/dunning_campaigns/email_templates";
final HashMap<String, String> urlParams = new HashMap<String, String>();
final String path = this.interpolatePath(url, urlParams);
Type parameterizedType = TypeToken.getParameterized(Pager.class, DunningCampaignEmailTemplate.class).getType();
return new Pager<>(path, null, this, parameterizedType);
}

/**
* Assign a dunning campaign to multiple plans
*
Expand Down
90 changes: 90 additions & 0 deletions src/main/java/com/recurly/v3/requests/DunningCampaignCreate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/**
* 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.requests;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.recurly.v3.Request;
import com.recurly.v3.resources.*;
import java.util.List;

public class DunningCampaignCreate extends Request {

/** Campaign code. */
@SerializedName("code")
@Expose
private String code;

/** Campaign description. */
@SerializedName("description")
@Expose
private String description;

/**
* Dunning Cycle settings. One entry per collection method (`automatic`, `manual`, `trial`); each
* type may appear at most once.
*/
@SerializedName("dunning_cycles")
@Expose
private List<DunningCycleCreate> dunningCycles;

/** Campaign name. */
@SerializedName("name")
@Expose
private String name;

/** Campaign code. */
public String getCode() {
return this.code;
}

/**
* @param code Campaign code.
*/
public void setCode(final String code) {
this.code = code;
}

/** Campaign description. */
public String getDescription() {
return this.description;
}

/**
* @param description Campaign description.
*/
public void setDescription(final String description) {
this.description = description;
}

/**
* Dunning Cycle settings. One entry per collection method (`automatic`, `manual`, `trial`); each
* type may appear at most once.
*/
public List<DunningCycleCreate> getDunningCycles() {
return this.dunningCycles;
}

/**
* @param dunningCycles Dunning Cycle settings. One entry per collection method (`automatic`,
* `manual`, `trial`); each type may appear at most once.
*/
public void setDunningCycles(final List<DunningCycleCreate> dunningCycles) {
this.dunningCycles = dunningCycles;
}

/** Campaign name. */
public String getName() {
return this.name;
}

/**
* @param name Campaign name.
*/
public void setName(final String name) {
this.name = name;
}
}
120 changes: 120 additions & 0 deletions src/main/java/com/recurly/v3/requests/DunningCampaignUpdate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/**
* 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.requests;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.recurly.v3.Request;
import com.recurly.v3.resources.*;
import java.util.List;

public class DunningCampaignUpdate extends Request {

/** Campaign code. */
@SerializedName("code")
@Expose
private String code;

/**
* Set to `true` to make this the default campaign for accounts or plans without an assigned
* dunning campaign. Cannot be set on an inactive campaign, and cannot be unset directly—assign a
* different campaign as the default instead.
*/
@SerializedName("default_campaign")
@Expose
private Boolean defaultCampaign;

/** Campaign description. */
@SerializedName("description")
@Expose
private String description;

/**
* Dunning Cycle settings. One entry per collection method (`automatic`, `manual`, `trial`); each
* type may appear at most once. Each cycle write fully replaces that cycle's current settings
* version.
*/
@SerializedName("dunning_cycles")
@Expose
private List<DunningCycleCreate> dunningCycles;

/** Campaign name. */
@SerializedName("name")
@Expose
private String name;

/** Campaign code. */
public String getCode() {
return this.code;
}

/**
* @param code Campaign code.
*/
public void setCode(final String code) {
this.code = code;
}

/**
* Set to `true` to make this the default campaign for accounts or plans without an assigned
* dunning campaign. Cannot be set on an inactive campaign, and cannot be unset directly—assign a
* different campaign as the default instead.
*/
public Boolean getDefaultCampaign() {
return this.defaultCampaign;
}

/**
* @param defaultCampaign Set to `true` to make this the default campaign for accounts or plans
* without an assigned dunning campaign. Cannot be set on an inactive campaign, and cannot be
* unset directly—assign a different campaign as the default instead.
*/
public void setDefaultCampaign(final Boolean defaultCampaign) {
this.defaultCampaign = defaultCampaign;
}

/** Campaign description. */
public String getDescription() {
return this.description;
}

/**
* @param description Campaign description.
*/
public void setDescription(final String description) {
this.description = description;
}

/**
* Dunning Cycle settings. One entry per collection method (`automatic`, `manual`, `trial`); each
* type may appear at most once. Each cycle write fully replaces that cycle's current settings
* version.
*/
public List<DunningCycleCreate> getDunningCycles() {
return this.dunningCycles;
}

/**
* @param dunningCycles Dunning Cycle settings. One entry per collection method (`automatic`,
* `manual`, `trial`); each type may appear at most once. Each cycle write fully replaces that
* cycle's current settings version.
*/
public void setDunningCycles(final List<DunningCycleCreate> dunningCycles) {
this.dunningCycles = dunningCycles;
}

/** Campaign name. */
public String getName() {
return this.name;
}

/**
* @param name Campaign name.
*/
public void setName(final String name) {
this.name = name;
}
}
Loading
Loading