From eb175b38e1bf47fe5929ddcc61490f89d0ef2cfe Mon Sep 17 00:00:00 2001 From: DX Codefresh Date: Wed, 1 Sep 2021 16:32:11 +0000 Subject: [PATCH] Generated Latest Changes for v2019-10-10 --- openapi/api.yaml | 317 ++++++++++++++++++ src/main/java/com/recurly/v3/Client.java | 48 +++ .../recurly/v3/requests/AccountCreate.java | 30 ++ .../recurly/v3/requests/AccountPurchase.java | 30 ++ .../recurly/v3/requests/AccountUpdate.java | 30 ++ .../requests/DunningCampaignsBulkUpdate.java | 63 ++++ .../com/recurly/v3/requests/PlanCreate.java | 30 ++ .../com/recurly/v3/requests/PlanUpdate.java | 30 ++ .../com/recurly/v3/resources/Account.java | 30 ++ .../com/recurly/v3/resources/AccountMini.java | 30 ++ .../recurly/v3/resources/DunningCampaign.java | 172 ++++++++++ .../DunningCampaignsBulkUpdateResponse.java | 44 +++ .../recurly/v3/resources/DunningCycle.java | 228 +++++++++++++ .../recurly/v3/resources/DunningInterval.java | 43 +++ .../com/recurly/v3/resources/Invoice.java | 27 ++ .../java/com/recurly/v3/resources/Plan.java | 30 ++ 16 files changed, 1182 insertions(+) create mode 100644 src/main/java/com/recurly/v3/requests/DunningCampaignsBulkUpdate.java create mode 100644 src/main/java/com/recurly/v3/resources/DunningCampaign.java create mode 100644 src/main/java/com/recurly/v3/resources/DunningCampaignsBulkUpdateResponse.java create mode 100644 src/main/java/com/recurly/v3/resources/DunningCycle.java create mode 100644 src/main/java/com/recurly/v3/resources/DunningInterval.java diff --git a/openapi/api.yaml b/openapi/api.yaml index cf5146f8..804ab68c 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -218,6 +218,7 @@ x-tagGroups: - site - custom_field_definition - shipping_method + - dunning_campaigns tags: - name: site x-displayName: Site @@ -331,6 +332,9 @@ tags: - name: automated_exports x-displayName: Automated Exports description: Automated exports of customer data. +- name: dunning_campaigns + x-displayName: Dunning Campaigns + description: Settings used when attempting to dun customers whose payments are declined. paths: "/sites": get: @@ -14378,6 +14382,107 @@ paths: err.(*recurly.Error); ok {\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfor _, file := range exportFiles.Files {\n\tfmt.Println(\"Export file download URL: \", file.Href)\n}" + "/sites/{site_id}/dunning_campaigns": + get: + tags: + - dunning_campaigns + operationId: list_dunning_campaigns + summary: Show the dunning campaigns for a site + description: See the [Pagination Guide](/guides/pagination.html) to learn how + to use pagination in the API and Client Libraries. + parameters: + - "$ref": "#/components/parameters/sort_dates" + responses: + '200': + description: A list of the the dunning_campaigns on an account. + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaignList" + '404': + description: Incorrect site. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/dunning_campaigns/{dunning_campaign_id}": + parameters: + - "$ref": "#/components/parameters/dunning_campaign_id" + get: + tags: + - dunning_campaigns + operationId: get_dunning_campaign + summary: Show the settings for a dunning campaign + responses: + '200': + description: Settings for a dunning campaign. + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaign" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: Incorrect site or campaign ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/dunning_campaigns/{dunning_campaign_id}/bulk_update": + put: + tags: + - dunning_campaigns + operationId: put_dunning_campaign_bulk_update + summary: Assign a dunning campaign to multiple plans + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaignsBulkUpdate" + responses: + '200': + description: A list of updated plans. + content: + application/json: + schema: + "$ref": "#/components/schemas/DunningCampaignsBulkUpdateResponse" + '400': + description: Bad request; perhaps missing or invalid parameters. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: Incorrect site or campaign ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] servers: - url: https://v3.recurly.com components: @@ -14521,6 +14626,13 @@ components: required: true schema: type: string + dunning_campaign_id: + name: dunning_campaign_id + in: path + description: Dunning Campaign ID, e.g. `e28zov4fw0v2`. + required: true + schema: + type: string ids: name: ids in: query @@ -15362,6 +15474,14 @@ components: mail order and telephone transactions. enum: - moto + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify a dunning campaign. Available when the + Dunning Campaigns feature is enabled. Used to specify if a non-default + dunning campaign should be assigned to this account. For sites without + multiple dunning campaigns enabled, the default dunning campaign will + always be used. address: "$ref": "#/components/schemas/Address" billing_info: @@ -15458,6 +15578,14 @@ components: enum: - self - parent + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify a dunning campaign. Available when the + Dunning Campaigns feature is enabled. Used to specify if a non-default + dunning campaign should be assigned to this account. For sites without + multiple dunning campaigns enabled, the default dunning campaign will + always be used. address: "$ref": "#/components/schemas/Address" billing_info: @@ -15523,6 +15651,14 @@ components: bill_to: type: string maxLength: 6 + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify a dunning campaign. Available when the + Dunning Campaigns feature is enabled. Used to specify if a non-default + dunning campaign should be assigned to this account. For sites without + multiple dunning campaigns enabled, the default dunning campaign will + always be used. AccountBalance: type: object properties: @@ -17679,6 +17815,13 @@ components: format: date-time title: Closed at description: Date invoice was marked paid or failed. + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify the dunning campaign used when dunning + the invoice. Available when the Dunning Campaigns feature is enabled. + For sites without multiple dunning campaigns enabled, this will always + be the default dunning campaign. InvoiceCreate: type: object properties: @@ -18697,6 +18840,14 @@ components: Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used. + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify a dunning campaign. Available when the + Dunning Campaigns feature is enabled. Used to specify if a non-default + dunning campaign should be assigned to this plan. For sites without multiple + dunning campaigns enabled, the default dunning campaign will always be + used. created_at: type: string format: date-time @@ -18869,6 +19020,14 @@ components: Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used. + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify a dunning campaign. Available when the + Dunning Campaigns feature is enabled. Used to specify if a non-default + dunning campaign should be assigned to this plan. For sites without multiple + dunning campaigns enabled, the default dunning campaign will always be + used. required: - code - name @@ -19058,6 +19217,14 @@ components: Used to determine whether items can be assigned as add-ons to individual subscriptions. If `true`, items can be assigned as add-ons to individual subscription add-ons. If `false`, only plan add-ons can be used. + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify a dunning campaign. Available when the + Dunning Campaigns feature is enabled. Used to specify if a non-default + dunning campaign should be assigned to this plan. For sites without multiple + dunning campaigns enabled, the default dunning campaign will always be + used. AddOnPricing: type: object properties: @@ -21372,6 +21539,155 @@ components: required: - currency - account + DunningCampaign: + type: object + description: Settings for a dunning campaign. + properties: + id: + type: string + object: + type: string + title: Object type + code: + type: string + description: Campaign code. + name: + type: string + description: Campaign name. + description: + type: string + description: Campaign description. + default_campaign: + type: boolean + description: Whether or not this is the default campaign for accounts or + plans without an assigned dunning campaign. + dunning_cycles: + type: array + description: Dunning Cycle settings. + items: + "$ref": "#/components/schemas/DunningCycle" + created_at: + type: string + format: date-time + description: When the current campaign was created in Recurly. + updated_at: + type: string + format: date-time + description: When the current campaign was updated in Recurly. + deleted_at: + type: string + format: date-time + description: When the current campaign was deleted in Recurly. + DunningCampaignList: + type: object + properties: + object: + type: string + title: Object type + description: Will always be List. + has_more: + type: boolean + description: Indicates there are more results on subsequent pages. + next: + type: string + description: Path to subsequent page of results. + data: + type: array + items: + "$ref": "#/components/schemas/DunningCampaign" + DunningCycle: + type: object + properties: + type: + type: string + description: The type of invoice this cycle applies to. + enum: + - automatic + - manual + - trial + applies_to_manual_trial: + type: boolean + description: Whether the dunning settings will be applied to manual trials. + Only applies to trial cycles. + first_communication_interval: + type: integer + description: The number of days after a transaction failure before the first + dunning email is sent. + send_immediately_on_hard_decline: + type: boolean + description: Whether or not to send an extra email immediately to customers + whose initial payment attempt fails with either a hard decline or invalid + billing info. + intervals: + type: array + description: Dunning intervals. + items: + "$ref": "#/components/schemas/DunningInterval" + expire_subscription: + type: boolean + description: Whether the subscription(s) should be cancelled at the end + of the dunning cycle. + fail_invoice: + type: boolean + description: Whether the invoice should be failed at the end of the dunning + cycle. + total_dunning_days: + type: integer + description: The number of days between the first dunning email being sent + and the end of the dunning cycle. + total_recycling_days: + type: integer + description: The number of days between a transaction failure and the end + of the dunning cycle. + version: + type: integer + description: Current campaign version. + created_at: + type: string + format: date-time + description: When the current settings were created in Recurly. + updated_at: + type: string + format: date-time + description: When the current settings were updated in Recurly. + DunningInterval: + properties: + days: + type: integer + description: Number of days before sending the next email. + email_template: + type: string + description: Email template being used. + DunningCampaignsBulkUpdate: + properties: + plan_codes: + type: array + maxItems: 200 + description: List of `plan_codes` associated with the Plans for which the + dunning campaign should be updated. Required unless `plan_ids` is present. + items: + type: string + plan_ids: + type: array + maxItems: 200 + description: List of `plan_ids` associated with the Plans for which the + dunning campaign should be updated. Required unless `plan_codes` is present. + items: + type: string + DunningCampaignsBulkUpdateResponse: + properties: + object: + type: string + title: Object type + readOnly: true + plans: + type: array + title: Plans + description: An array containing all of the `Plan` resources that have been + updated. + maxItems: 200 + items: + "$ref": "#/components/schemas/Plan" PaymentMethod: properties: object: @@ -21410,6 +21726,7 @@ components: - Union Pay - Unknown - Visa + - Tarjeta Naranja first_six: type: string description: Credit card number's first six digits. diff --git a/src/main/java/com/recurly/v3/Client.java b/src/main/java/com/recurly/v3/Client.java index 6408fcc5..4999b7e1 100644 --- a/src/main/java/com/recurly/v3/Client.java +++ b/src/main/java/com/recurly/v3/Client.java @@ -2252,4 +2252,52 @@ public ExportFiles getExportFiles(String exportDate) { Type returnType = ExportFiles.class; return this.makeRequest("GET", path, returnType); } + + /** + * Show the dunning campaigns for a site + * + * @see list_dunning_campaigns api documentation + * @param queryParams The {@link QueryParams} for this endpoint. + * @return A list of the the dunning_campaigns on an account. + */ + public Pager listDunningCampaigns(QueryParams queryParams) { + final String url = "/dunning_campaigns"; + final HashMap urlParams = new HashMap(); + if (queryParams == null) queryParams = new QueryParams(); + final HashMap paramsMap = queryParams.getParams(); + final String path = this.interpolatePath(url, urlParams); + Type parameterizedType = TypeToken.getParameterized(Pager.class, DunningCampaign.class).getType(); + return new Pager<>(path, paramsMap, this, parameterizedType); + } + + /** + * Show the settings for a dunning campaign + * + * @see get_dunning_campaign api documentation + * @param dunningCampaignId Dunning Campaign ID, e.g. `e28zov4fw0v2`. + * @return Settings for a dunning campaign. + */ + public DunningCampaign getDunningCampaign(String dunningCampaignId) { + final String url = "/dunning_campaigns/{dunning_campaign_id}"; + final HashMap urlParams = new HashMap(); + urlParams.put("dunning_campaign_id", dunningCampaignId); + final String path = this.interpolatePath(url, urlParams); + Type returnType = DunningCampaign.class; + return this.makeRequest("GET", path, returnType); + } + + /** + * Assign a dunning campaign to multiple plans + * + * @see put_dunning_campaign_bulk_update api documentation + * @param body The body of the request. + * @return A list of updated plans. + */ + public DunningCampaignsBulkUpdateResponse putDunningCampaignBulkUpdate(DunningCampaignsBulkUpdate body) { + final String url = "/dunning_campaigns/{dunning_campaign_id}/bulk_update"; + final HashMap urlParams = new HashMap(); + final String path = this.interpolatePath(url, urlParams); + Type returnType = DunningCampaignsBulkUpdateResponse.class; + return this.makeRequest("PUT", path, body, returnType); + } } diff --git a/src/main/java/com/recurly/v3/requests/AccountCreate.java b/src/main/java/com/recurly/v3/requests/AccountCreate.java index 92ae518c..53a4d15b 100644 --- a/src/main/java/com/recurly/v3/requests/AccountCreate.java +++ b/src/main/java/com/recurly/v3/requests/AccountCreate.java @@ -59,6 +59,16 @@ public class AccountCreate extends Request { @Expose private List customFields; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be @@ -248,6 +258,26 @@ public void setCustomFields(final List customFields) { this.customFields = customFields; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this account. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be diff --git a/src/main/java/com/recurly/v3/requests/AccountPurchase.java b/src/main/java/com/recurly/v3/requests/AccountPurchase.java index ef972d2d..77e320f4 100644 --- a/src/main/java/com/recurly/v3/requests/AccountPurchase.java +++ b/src/main/java/com/recurly/v3/requests/AccountPurchase.java @@ -59,6 +59,16 @@ public class AccountPurchase extends Request { @Expose private List customFields; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be @@ -252,6 +262,26 @@ public void setCustomFields(final List customFields) { this.customFields = customFields; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this account. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be diff --git a/src/main/java/com/recurly/v3/requests/AccountUpdate.java b/src/main/java/com/recurly/v3/requests/AccountUpdate.java index ef223696..1dbc210a 100644 --- a/src/main/java/com/recurly/v3/requests/AccountUpdate.java +++ b/src/main/java/com/recurly/v3/requests/AccountUpdate.java @@ -50,6 +50,16 @@ public class AccountUpdate extends Request { @Expose private List customFields; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be @@ -213,6 +223,26 @@ public void setCustomFields(final List customFields) { this.customFields = customFields; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this account. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be diff --git a/src/main/java/com/recurly/v3/requests/DunningCampaignsBulkUpdate.java b/src/main/java/com/recurly/v3/requests/DunningCampaignsBulkUpdate.java new file mode 100644 index 00000000..9dbaf988 --- /dev/null +++ b/src/main/java/com/recurly/v3/requests/DunningCampaignsBulkUpdate.java @@ -0,0 +1,63 @@ +/** + * 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 DunningCampaignsBulkUpdate extends Request { + + /** + * List of `plan_codes` associated with the Plans for which the dunning campaign should be + * updated. Required unless `plan_ids` is present. + */ + @SerializedName("plan_codes") + @Expose + private List planCodes; + + /** + * List of `plan_ids` associated with the Plans for which the dunning campaign should be updated. + * Required unless `plan_codes` is present. + */ + @SerializedName("plan_ids") + @Expose + private List planIds; + + /** + * List of `plan_codes` associated with the Plans for which the dunning campaign should be + * updated. Required unless `plan_ids` is present. + */ + public List getPlanCodes() { + return this.planCodes; + } + + /** + * @param planCodes List of `plan_codes` associated with the Plans for which the dunning campaign + * should be updated. Required unless `plan_ids` is present. + */ + public void setPlanCodes(final List planCodes) { + this.planCodes = planCodes; + } + + /** + * List of `plan_ids` associated with the Plans for which the dunning campaign should be updated. + * Required unless `plan_codes` is present. + */ + public List getPlanIds() { + return this.planIds; + } + + /** + * @param planIds List of `plan_ids` associated with the Plans for which the dunning campaign + * should be updated. Required unless `plan_codes` is present. + */ + public void setPlanIds(final List planIds) { + this.planIds = planIds; + } +} diff --git a/src/main/java/com/recurly/v3/requests/PlanCreate.java b/src/main/java/com/recurly/v3/requests/PlanCreate.java index 23e8b62b..b1ce0dc9 100644 --- a/src/main/java/com/recurly/v3/requests/PlanCreate.java +++ b/src/main/java/com/recurly/v3/requests/PlanCreate.java @@ -83,6 +83,16 @@ public class PlanCreate extends Request { @Expose private String description; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For + * sites without multiple dunning campaigns enabled, the default dunning campaign will always be + * used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** Hosted pages settings */ @SerializedName("hosted_pages") @Expose @@ -302,6 +312,26 @@ public void setDescription(final String description) { this.description = description; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For + * sites without multiple dunning campaigns enabled, the default dunning campaign will always be + * used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this plan. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** Hosted pages settings */ public PlanHostedPages getHostedPages() { return this.hostedPages; diff --git a/src/main/java/com/recurly/v3/requests/PlanUpdate.java b/src/main/java/com/recurly/v3/requests/PlanUpdate.java index 853ea568..7c048c26 100644 --- a/src/main/java/com/recurly/v3/requests/PlanUpdate.java +++ b/src/main/java/com/recurly/v3/requests/PlanUpdate.java @@ -78,6 +78,16 @@ public class PlanUpdate extends Request { @Expose private String description; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For + * sites without multiple dunning campaigns enabled, the default dunning campaign will always be + * used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** Hosted pages settings */ @SerializedName("hosted_pages") @Expose @@ -282,6 +292,26 @@ public void setDescription(final String description) { this.description = description; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For + * sites without multiple dunning campaigns enabled, the default dunning campaign will always be + * used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this plan. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** Hosted pages settings */ public PlanHostedPages getHostedPages() { return this.hostedPages; diff --git a/src/main/java/com/recurly/v3/resources/Account.java b/src/main/java/com/recurly/v3/resources/Account.java index 12c2968f..e4660a2a 100644 --- a/src/main/java/com/recurly/v3/resources/Account.java +++ b/src/main/java/com/recurly/v3/resources/Account.java @@ -65,6 +65,16 @@ public class Account extends Resource { @Expose private DateTime deletedAt; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be @@ -301,6 +311,26 @@ public void setDeletedAt(final DateTime deletedAt) { this.deletedAt = deletedAt; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this account. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** * The email address used for communicating with this customer. The customer will also use this * email address to log into your hosted account management pages. This value does not need to be diff --git a/src/main/java/com/recurly/v3/resources/AccountMini.java b/src/main/java/com/recurly/v3/resources/AccountMini.java index 76a22db8..d29810ae 100644 --- a/src/main/java/com/recurly/v3/resources/AccountMini.java +++ b/src/main/java/com/recurly/v3/resources/AccountMini.java @@ -24,6 +24,16 @@ public class AccountMini extends Resource { @Expose private String company; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** The email address used for communicating with this customer. */ @SerializedName("email") @Expose @@ -78,6 +88,26 @@ public void setCompany(final String company) { this.company = company; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this account. + * For sites without multiple dunning campaigns enabled, the default dunning campaign will always + * be used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this account. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** The email address used for communicating with this customer. */ public String getEmail() { return this.email; diff --git a/src/main/java/com/recurly/v3/resources/DunningCampaign.java b/src/main/java/com/recurly/v3/resources/DunningCampaign.java new file mode 100644 index 00000000..10429df8 --- /dev/null +++ b/src/main/java/com/recurly/v3/resources/DunningCampaign.java @@ -0,0 +1,172 @@ +/** + * 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 DunningCampaign extends Resource { + + /** Campaign code. */ + @SerializedName("code") + @Expose + private String code; + + /** When the current campaign was created in Recurly. */ + @SerializedName("created_at") + @Expose + private DateTime createdAt; + + /** + * Whether or not this is the default campaign for accounts or plans without an assigned dunning + * campaign. + */ + @SerializedName("default_campaign") + @Expose + private Boolean defaultCampaign; + + /** When the current campaign was deleted in Recurly. */ + @SerializedName("deleted_at") + @Expose + private DateTime deletedAt; + + /** Campaign description. */ + @SerializedName("description") + @Expose + private String description; + + /** Dunning Cycle settings. */ + @SerializedName("dunning_cycles") + @Expose + private List dunningCycles; + + @SerializedName("id") + @Expose + private String id; + + /** Campaign name. */ + @SerializedName("name") + @Expose + private String name; + + /** Object type */ + @SerializedName("object") + @Expose + private String object; + + /** When the current campaign was updated in Recurly. */ + @SerializedName("updated_at") + @Expose + private DateTime updatedAt; + + /** Campaign code. */ + public String getCode() { + return this.code; + } + + /** @param code Campaign code. */ + public void setCode(final String code) { + this.code = code; + } + + /** When the current campaign was created in Recurly. */ + public DateTime getCreatedAt() { + return this.createdAt; + } + + /** @param createdAt When the current campaign was created in Recurly. */ + public void setCreatedAt(final DateTime createdAt) { + this.createdAt = createdAt; + } + + /** + * Whether or not this is the default campaign for accounts or plans without an assigned dunning + * campaign. + */ + public Boolean getDefaultCampaign() { + return this.defaultCampaign; + } + + /** + * @param defaultCampaign Whether or not this is the default campaign for accounts or plans + * without an assigned dunning campaign. + */ + public void setDefaultCampaign(final Boolean defaultCampaign) { + this.defaultCampaign = defaultCampaign; + } + + /** When the current campaign was deleted in Recurly. */ + public DateTime getDeletedAt() { + return this.deletedAt; + } + + /** @param deletedAt When the current campaign was deleted in Recurly. */ + public void setDeletedAt(final DateTime deletedAt) { + this.deletedAt = deletedAt; + } + + /** Campaign description. */ + public String getDescription() { + return this.description; + } + + /** @param description Campaign description. */ + public void setDescription(final String description) { + this.description = description; + } + + /** Dunning Cycle settings. */ + public List getDunningCycles() { + return this.dunningCycles; + } + + /** @param dunningCycles Dunning Cycle settings. */ + public void setDunningCycles(final List dunningCycles) { + this.dunningCycles = dunningCycles; + } + + public String getId() { + return this.id; + } + + /** @param id */ + public void setId(final String id) { + this.id = id; + } + + /** Campaign name. */ + public String getName() { + return this.name; + } + + /** @param name Campaign name. */ + 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; + } + + /** When the current campaign was updated in Recurly. */ + public DateTime getUpdatedAt() { + return this.updatedAt; + } + + /** @param updatedAt When the current campaign was updated in Recurly. */ + public void setUpdatedAt(final DateTime updatedAt) { + this.updatedAt = updatedAt; + } +} diff --git a/src/main/java/com/recurly/v3/resources/DunningCampaignsBulkUpdateResponse.java b/src/main/java/com/recurly/v3/resources/DunningCampaignsBulkUpdateResponse.java new file mode 100644 index 00000000..ecc28dc6 --- /dev/null +++ b/src/main/java/com/recurly/v3/resources/DunningCampaignsBulkUpdateResponse.java @@ -0,0 +1,44 @@ +/** + * 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; + +public class DunningCampaignsBulkUpdateResponse extends Resource { + + /** Object type */ + @SerializedName("object") + @Expose + private String object; + + /** An array containing all of the `Plan` resources that have been updated. */ + @SerializedName("plans") + @Expose + private List plans; + + /** Object type */ + public String getObject() { + return this.object; + } + + /** @param object Object type */ + public void setObject(final String object) { + this.object = object; + } + + /** An array containing all of the `Plan` resources that have been updated. */ + public List getPlans() { + return this.plans; + } + + /** @param plans An array containing all of the `Plan` resources that have been updated. */ + public void setPlans(final List plans) { + this.plans = plans; + } +} diff --git a/src/main/java/com/recurly/v3/resources/DunningCycle.java b/src/main/java/com/recurly/v3/resources/DunningCycle.java new file mode 100644 index 00000000..6e36729e --- /dev/null +++ b/src/main/java/com/recurly/v3/resources/DunningCycle.java @@ -0,0 +1,228 @@ +/** + * 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 DunningCycle extends Resource { + + /** + * Whether the dunning settings will be applied to manual trials. Only applies to trial cycles. + */ + @SerializedName("applies_to_manual_trial") + @Expose + private Boolean appliesToManualTrial; + + /** When the current settings were created in Recurly. */ + @SerializedName("created_at") + @Expose + private DateTime createdAt; + + /** Whether the subscription(s) should be cancelled at the end of the dunning cycle. */ + @SerializedName("expire_subscription") + @Expose + private Boolean expireSubscription; + + /** Whether the invoice should be failed at the end of the dunning cycle. */ + @SerializedName("fail_invoice") + @Expose + private Boolean failInvoice; + + /** The number of days after a transaction failure before the first dunning email is sent. */ + @SerializedName("first_communication_interval") + @Expose + private Integer firstCommunicationInterval; + + /** Dunning intervals. */ + @SerializedName("intervals") + @Expose + private List intervals; + + /** + * Whether or not to send an extra email immediately to customers whose initial payment attempt + * fails with either a hard decline or invalid billing info. + */ + @SerializedName("send_immediately_on_hard_decline") + @Expose + private Boolean sendImmediatelyOnHardDecline; + + /** + * The number of days between the first dunning email being sent and the end of the dunning cycle. + */ + @SerializedName("total_dunning_days") + @Expose + private Integer totalDunningDays; + + /** The number of days between a transaction failure and the end of the dunning cycle. */ + @SerializedName("total_recycling_days") + @Expose + private Integer totalRecyclingDays; + + /** The type of invoice this cycle applies to. */ + @SerializedName("type") + @Expose + private String type; + + /** When the current settings were updated in Recurly. */ + @SerializedName("updated_at") + @Expose + private DateTime updatedAt; + + /** Current campaign version. */ + @SerializedName("version") + @Expose + private Integer version; + + /** + * Whether the dunning settings will be applied to manual trials. Only applies to trial cycles. + */ + public Boolean getAppliesToManualTrial() { + return this.appliesToManualTrial; + } + + /** + * @param appliesToManualTrial Whether the dunning settings will be applied to manual trials. Only + * applies to trial cycles. + */ + public void setAppliesToManualTrial(final Boolean appliesToManualTrial) { + this.appliesToManualTrial = appliesToManualTrial; + } + + /** When the current settings were created in Recurly. */ + public DateTime getCreatedAt() { + return this.createdAt; + } + + /** @param createdAt When the current settings were created in Recurly. */ + public void setCreatedAt(final DateTime createdAt) { + this.createdAt = createdAt; + } + + /** Whether the subscription(s) should be cancelled at the end of the dunning cycle. */ + public Boolean getExpireSubscription() { + return this.expireSubscription; + } + + /** + * @param expireSubscription Whether the subscription(s) should be cancelled at the end of the + * dunning cycle. + */ + public void setExpireSubscription(final Boolean expireSubscription) { + this.expireSubscription = expireSubscription; + } + + /** Whether the invoice should be failed at the end of the dunning cycle. */ + public Boolean getFailInvoice() { + return this.failInvoice; + } + + /** @param failInvoice Whether the invoice should be failed at the end of the dunning cycle. */ + public void setFailInvoice(final Boolean failInvoice) { + this.failInvoice = failInvoice; + } + + /** The number of days after a transaction failure before the first dunning email is sent. */ + public Integer getFirstCommunicationInterval() { + return this.firstCommunicationInterval; + } + + /** + * @param firstCommunicationInterval The number of days after a transaction failure before the + * first dunning email is sent. + */ + public void setFirstCommunicationInterval(final Integer firstCommunicationInterval) { + this.firstCommunicationInterval = firstCommunicationInterval; + } + + /** Dunning intervals. */ + public List getIntervals() { + return this.intervals; + } + + /** @param intervals Dunning intervals. */ + public void setIntervals(final List intervals) { + this.intervals = intervals; + } + + /** + * Whether or not to send an extra email immediately to customers whose initial payment attempt + * fails with either a hard decline or invalid billing info. + */ + public Boolean getSendImmediatelyOnHardDecline() { + return this.sendImmediatelyOnHardDecline; + } + + /** + * @param sendImmediatelyOnHardDecline Whether or not to send an extra email immediately to + * customers whose initial payment attempt fails with either a hard decline or invalid billing + * info. + */ + public void setSendImmediatelyOnHardDecline(final Boolean sendImmediatelyOnHardDecline) { + this.sendImmediatelyOnHardDecline = sendImmediatelyOnHardDecline; + } + + /** + * The number of days between the first dunning email being sent and the end of the dunning cycle. + */ + public Integer getTotalDunningDays() { + return this.totalDunningDays; + } + + /** + * @param totalDunningDays The number of days between the first dunning email being sent and the + * end of the dunning cycle. + */ + public void setTotalDunningDays(final Integer totalDunningDays) { + this.totalDunningDays = totalDunningDays; + } + + /** The number of days between a transaction failure and the end of the dunning cycle. */ + public Integer getTotalRecyclingDays() { + return this.totalRecyclingDays; + } + + /** + * @param totalRecyclingDays The number of days between a transaction failure and the end of the + * dunning cycle. + */ + public void setTotalRecyclingDays(final Integer totalRecyclingDays) { + this.totalRecyclingDays = totalRecyclingDays; + } + + /** The type of invoice this cycle applies to. */ + public String getType() { + return this.type; + } + + /** @param type The type of invoice this cycle applies to. */ + public void setType(final String type) { + this.type = type; + } + + /** When the current settings were updated in Recurly. */ + public DateTime getUpdatedAt() { + return this.updatedAt; + } + + /** @param updatedAt When the current settings were updated in Recurly. */ + public void setUpdatedAt(final DateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** Current campaign version. */ + public Integer getVersion() { + return this.version; + } + + /** @param version Current campaign version. */ + public void setVersion(final Integer version) { + this.version = version; + } +} diff --git a/src/main/java/com/recurly/v3/resources/DunningInterval.java b/src/main/java/com/recurly/v3/resources/DunningInterval.java new file mode 100644 index 00000000..a75af925 --- /dev/null +++ b/src/main/java/com/recurly/v3/resources/DunningInterval.java @@ -0,0 +1,43 @@ +/** + * 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; + +public class DunningInterval extends Resource { + + /** Number of days before sending the next email. */ + @SerializedName("days") + @Expose + private Integer days; + + /** Email template being used. */ + @SerializedName("email_template") + @Expose + private String emailTemplate; + + /** Number of days before sending the next email. */ + public Integer getDays() { + return this.days; + } + + /** @param days Number of days before sending the next email. */ + public void setDays(final Integer days) { + this.days = days; + } + + /** Email template being used. */ + public String getEmailTemplate() { + return this.emailTemplate; + } + + /** @param emailTemplate Email template being used. */ + public void setEmailTemplate(final String emailTemplate) { + this.emailTemplate = emailTemplate; + } +} diff --git a/src/main/java/com/recurly/v3/resources/Invoice.java b/src/main/java/com/recurly/v3/resources/Invoice.java index 1039fc71..ad68aef8 100644 --- a/src/main/java/com/recurly/v3/resources/Invoice.java +++ b/src/main/java/com/recurly/v3/resources/Invoice.java @@ -85,6 +85,15 @@ public class Invoice extends Resource { @Expose private DateTime dueAt; + /** + * Unique ID to identify the dunning campaign used when dunning the invoice. Available when the + * Dunning Campaigns feature is enabled. For sites without multiple dunning campaigns enabled, + * this will always be the default dunning campaign. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** Invoice ID */ @SerializedName("id") @Expose @@ -371,6 +380,24 @@ public void setDueAt(final DateTime dueAt) { this.dueAt = dueAt; } + /** + * Unique ID to identify the dunning campaign used when dunning the invoice. Available when the + * Dunning Campaigns feature is enabled. For sites without multiple dunning campaigns enabled, + * this will always be the default dunning campaign. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify the dunning campaign used when dunning the + * invoice. Available when the Dunning Campaigns feature is enabled. For sites without + * multiple dunning campaigns enabled, this will always be the default dunning campaign. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** Invoice ID */ public String getId() { return this.id; diff --git a/src/main/java/com/recurly/v3/resources/Plan.java b/src/main/java/com/recurly/v3/resources/Plan.java index 12da69f5..bb584cc5 100644 --- a/src/main/java/com/recurly/v3/resources/Plan.java +++ b/src/main/java/com/recurly/v3/resources/Plan.java @@ -88,6 +88,16 @@ public class Plan extends Resource { @Expose private String description; + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For + * sites without multiple dunning campaigns enabled, the default dunning campaign will always be + * used. + */ + @SerializedName("dunning_campaign_id") + @Expose + private String dunningCampaignId; + /** Hosted pages settings */ @SerializedName("hosted_pages") @Expose @@ -337,6 +347,26 @@ public void setDescription(final String description) { this.description = description; } + /** + * Unique ID to identify a dunning campaign. Available when the Dunning Campaigns feature is + * enabled. Used to specify if a non-default dunning campaign should be assigned to this plan. For + * sites without multiple dunning campaigns enabled, the default dunning campaign will always be + * used. + */ + public String getDunningCampaignId() { + return this.dunningCampaignId; + } + + /** + * @param dunningCampaignId Unique ID to identify a dunning campaign. Available when the Dunning + * Campaigns feature is enabled. Used to specify if a non-default dunning campaign should be + * assigned to this plan. For sites without multiple dunning campaigns enabled, the default + * dunning campaign will always be used. + */ + public void setDunningCampaignId(final String dunningCampaignId) { + this.dunningCampaignId = dunningCampaignId; + } + /** Hosted pages settings */ public PlanHostedPages getHostedPages() { return this.hostedPages;