From 91227016c63e21be0a81f86a1bf294afe714df46 Mon Sep 17 00:00:00 2001 From: Recurly Integrations Date: Tue, 9 Jun 2026 17:12:52 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- openapi/api.yaml | 381 +++++++++++++++++- src/main/java/com/recurly/v3/Client.java | 15 + src/main/java/com/recurly/v3/Constants.java | 3 + .../com/recurly/v3/requests/CouponCreate.java | 20 +- .../v3/requests/RecoveryAccountCreate.java | 142 +++++++ .../recurly/v3/requests/RecoveryAddress.java | 119 ++++++ .../requests/RecoveryBillingInfoCreate.java | 243 +++++++++++ .../v3/requests/RecoveryInvoiceCreate.java | 123 ++++++ .../v3/requests/RecoveryLineItemCreate.java | 169 ++++++++ .../requests/RecoveryTransactionCreate.java | 72 ++++ .../v3/resources/CouponDiscountTrial.java | 15 +- .../v3/resources/CouponRedemption.java | 13 + .../v3/resources/CouponRedemptionMini.java | 19 +- .../CouponRedemptionRemainingDuration.java | 63 +++ .../com/recurly/v3/resources/Invoice.java | 15 + .../com/recurly/v3/resources/LineItem.java | 21 +- .../v3/resources/LineItemDiscount.java | 107 +++++ 17 files changed, 1521 insertions(+), 19 deletions(-) create mode 100644 src/main/java/com/recurly/v3/requests/RecoveryAccountCreate.java create mode 100644 src/main/java/com/recurly/v3/requests/RecoveryAddress.java create mode 100644 src/main/java/com/recurly/v3/requests/RecoveryBillingInfoCreate.java create mode 100644 src/main/java/com/recurly/v3/requests/RecoveryInvoiceCreate.java create mode 100644 src/main/java/com/recurly/v3/requests/RecoveryLineItemCreate.java create mode 100644 src/main/java/com/recurly/v3/requests/RecoveryTransactionCreate.java create mode 100644 src/main/java/com/recurly/v3/resources/CouponRedemptionRemainingDuration.java create mode 100644 src/main/java/com/recurly/v3/resources/LineItemDiscount.java diff --git a/openapi/api.yaml b/openapi/api.yaml index 3582bec5..b6c4aae4 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -206,6 +206,7 @@ x-tagGroups: - line_item - credit_payment - transaction + - revenue_recovery - name: Products and Promotions tags: - item @@ -310,6 +311,9 @@ tags: subscription is created or renewed or a charge is created on the account, Recurly will sum the charges, discount or tax as appropriate, and send the invoice out for collection. +- name: revenue_recovery + x-displayName: Revenue Recovery + description: Revenue recovery - name: line_item x-displayName: Line Item description: Line items are the charges and credits on your customer's invoices. @@ -10505,6 +10509,51 @@ paths: {\n\t\tfmt.Printf(\"Failed validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Refunded Invoice: %v\", invoice)" + "/invoices/recovery": + post: + tags: + - revenue_recovery + operationId: create_invoice_retry + summary: Create an invoice for revenue recovery + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/RecoveryInvoiceCreate" + required: true + responses: + '201': + description: Returns the new invoices. + content: + application/json: + schema: + "$ref": "#/components/schemas/InvoiceCollection" + '400': + description: Bad request, perhaps invalid JSON? + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '404': + description: Incorrect site ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Invalid parameters, no pending line items, or error running + the transaction. + content: + application/json: + schema: + "$ref": "#/components/schemas/ErrorMayHaveTransaction" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/line_items": get: tags: @@ -18621,6 +18670,251 @@ components: maxLength: 20 description: Code that represents a geographic entity (location or object). Only returned when Vertex or Avalara for Communications is enabled. + RecoveryAddress: + type: object + properties: + phone: + type: string + title: Phone number + street1: + type: string + title: Street 1 + maxLength: 50 + street2: + type: string + title: Street 2 + maxLength: 50 + city: + type: string + title: City + region: + type: string + title: State/Province + description: State or province. + postal_code: + type: string + title: Zip/Postal code + description: Zip or postal code. + country: + type: string + title: Country + description: Country, 2-letter ISO 3166-1 alpha-2 code. + RecoveryInvoiceCreate: + type: object + properties: + currency: + type: string + title: Currency + description: 3-letter ISO 4217 currency code. + maxLength: 3 + due_at: + type: string + format: date-time + title: Due at + description: Date invoice was originally due. Must be in the past. + po_number: + type: string + title: Purchase order number + description: This identifies the PO number associated with the subscription. + maxLength: 50 + external_recovery_eligible: + type: boolean + title: External recovery eligible + description: Must be set to `true` to acknowledge that the invoice is eligible + for external recovery. Requests with `false`, omitted, or non-boolean + values will be rejected. + account: + "$ref": "#/components/schemas/RecoveryAccountCreate" + line_items: + type: array + title: Line items + description: Line items to include on the invoice. Currency is specified + at the root level and must not be included in individual line items. + items: + "$ref": "#/components/schemas/RecoveryLineItemCreate" + required: + - currency + - due_at + - external_recovery_eligible + - account + - line_items + RecoveryBillingInfoCreate: + type: object + title: Recovery billing info + properties: + first_name: + type: string + title: First name + maxLength: 50 + last_name: + type: string + title: Last name + maxLength: 50 + company: + type: string + title: Company name + maxLength: 100 + address: + "$ref": "#/components/schemas/RecoveryAddress" + ip_address: + type: string + title: IP address + description: "*STRONGLY RECOMMENDED* Customer's IP address when updating + their billing information." + maxLength: 20 + gateway_code: + type: string + title: An identifier for a specific payment gateway. + maxLength: 12 + primary_payment_method: + type: boolean + title: Primary Payment Method + description: The `primary_payment_method` field is used to designate the + primary billing info on the account. An account can have a maximum of + 1 primary. If a user sets a different payment method as a primary, then + the existing primary will no longer be marked as such. + backup_payment_method: + type: boolean + description: The `backup_payment_method` field is used to designate a billing + info as a backup on the account that will be tried if the initial billing + info used for an invoice is declined. All payment methods, including the + billing info marked `primary_payment_method` can be set as a backup. An + account can have a maximum of 1 backup, if a user sets a different payment + method as a backup, the existing backup will no longer be marked as such. + payment_gateway_references: + type: array + description: Array of Payment Gateway References, each a reference to a + third-party gateway object of varying types. + items: + "$ref": "#/components/schemas/PaymentGatewayReferences" + network_transaction_id: + type: string + title: Network Transaction ID + description: | + Network transaction ID from the previous customer-in-session subscription signup or billing info storage. + + - 10-15 alphanumeric characters for Mastercard + - 14-15 alphanumeric for Visa + - 15 digits for all other brands + - 16 alphanumeric characters for Cartes Bancaires, which are processed as Visa or Mastercard + maxLength: 16 + transactions: + type: array + title: Transactions + description: Transactions from previous collection attempts for this payment + method. + items: + "$ref": "#/components/schemas/RecoveryTransactionCreate" + required: + - gateway_code + - payment_gateway_references + - transactions + RecoveryAccountCreate: + type: object + properties: + address: + "$ref": "#/components/schemas/RecoveryAddress" + billing_infos: + type: array + title: Billing Infos + description: If the premium Wallet feature is enabled, more than one payment + method can be associated with an account, and one can be designated as + a primary and one as a backup. Without the Wallet feature, only one payment + method will be accepted. + items: + "$ref": "#/components/schemas/RecoveryBillingInfoCreate" + code: + type: string + description: The unique identifier of the account. This cannot be changed + once the account is created. + maxLength: 50 + email: + type: string + format: email + description: The email address used for communicating with this customer. + maxLength: 255 + custom_fields: + "$ref": "#/components/schemas/CustomFields" + dunning_campaign_id: + type: string + title: Dunning Campaign ID + description: Unique ID to identify a dunning campaign. 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. + required: + - code + - billing_infos + RecoveryLineItemCreate: + required: + - unit_amount + type: object + title: Recovery line item + properties: + tax: + type: number + format: float + title: Tax + description: The tax amount for the line item. + custom_fields: + "$ref": "#/components/schemas/CustomFields" + harmonized_system_code: + type: string + title: Harmonized System Code + description: The Harmonized System (HS) code is an internationally standardized + system of names and numbers to classify traded products. The HS code, + sometimes called Commodity Code, is used by customs authorities around + the world to identify products when assessing duties and taxes. The HS + code may also be referred to as the tariff code or customs code. Values + should contain only digits and decimals. + maxLength: 25 + pattern: "^\\d+(\\.\\d+)*$" + product_code: + type: string + title: Product code + description: Optional field to track a product code or SKU for the line + item. This can be used to later reporting on product purchases. + maxLength: 50 + quantity: + type: integer + title: Quantity + description: This number will be multiplied by the unit amount to compute + the subtotal before any discounts or taxes. + default: 1 + description: + type: string + title: Description + description: Description that appears on the invoice. + maxLength: 255 + unit_amount: + type: number + format: float + title: Unit amount + description: A positive or negative amount will result in a positive `unit_amount`. + RecoveryTransactionCreate: + required: + - gateway_error_code + - attempted_collection_date + type: object + properties: + gateway_error_code: + type: string + title: Gateway error code + description: The error code returned by the payment gateway for the original + payment collection attempt. + maxLength: 50 + merchant_advice_code: + type: string + title: Merchant advice code + description: The advice code returned by the payment gateway for the original + payment collection attempt. This field is only applicable for certain + gateways. + maxLength: 2 + attempted_collection_date: + type: string + format: date-time + title: Attempted collection date + description: The date the original payment collection was attempted. AddressWithName: allOf: - "$ref": "#/components/schemas/Address" @@ -19579,6 +19873,44 @@ components: token_id: type: string description: A token [generated by Recurly.js](https://recurly.com/developers/reference/recurly-js/#getting-a-token). + LineItemDiscount: + type: object + title: Line item discount + description: A discount applied to a line item charge by a coupon redemption. + properties: + object: + type: string + title: Object type + description: Will always be `line_item_discount`. + readOnly: true + coupon_id: + type: string + title: Coupon ID + description: The ID of the coupon that generated this discount. + readOnly: true + coupon_redemption_id: + type: string + title: Coupon Redemption ID + description: The ID of the coupon redemption that generated this discount. + readOnly: true + order_applied: + type: integer + title: Order applied + description: The order in which this discount was applied when multiple + coupons were redeemed. + readOnly: true + discount_amount: + type: number + format: float + title: Discount amount + description: The amount discounted on this line item by this coupon redemption. + readOnly: true + currency: + type: string + title: Currency + description: 3-letter ISO 4217 currency code. + maxLength: 3 + readOnly: true Coupon: type: object properties: @@ -19764,7 +20096,8 @@ components: title: Free trial unit description: Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is - for. Required if `discount_type` is `free_trial`. + for. Required if `discount_type` is `free_trial`. Use `billing_period` + to grant a free trial for a number of billing cycles. "$ref": "#/components/schemas/FreeTrialUnitEnum" free_trial_amount: type: integer @@ -19842,6 +20175,8 @@ components: by `temporal_amount` to define the duration that the coupon will be applied to invoices for. Use "billing_period" to apply the coupon for a fixed number of billing cycles. Requires `redemption_resource=subscription`. + Not compatible with `discount_type=free_trial`; use `free_trial_unit=billing_period` + and `free_trial_amount` instead. "$ref": "#/components/schemas/TemporalUnitEnum" coupon_type: title: Coupon type @@ -19903,7 +20238,8 @@ components: properties: unit: title: Trial unit - description: Temporal unit of the free trial + description: Temporal unit of the free trial. When `billing_period`, + `length` represents the number of billing cycles. "$ref": "#/components/schemas/FreeTrialUnitEnum" length: type: integer @@ -20016,6 +20352,9 @@ components: title: Coupon Redemption state default: active "$ref": "#/components/schemas/ActiveStateEnum" + remaining_duration: + readOnly: true + "$ref": "#/components/schemas/CouponRedemptionRemainingDuration" currency: type: string title: Currency @@ -20043,6 +20382,23 @@ components: description: The date and time the redemption was removed from the account (un-redeemed). format: date-time + CouponRedemptionRemainingDuration: + type: object + properties: + type: + type: string + title: Duration Type + description: The coupon's duration type. `temporal` includes an `expires_at` + timestamp. `forever` and `single_use` have no additional fields. + "$ref": "#/components/schemas/CouponDurationEnum" + readOnly: true + expires_at: + type: string + title: Expires at + format: date-time + description: Present when `type` is `temporal`. The datetime after which + this redemption will no longer apply. + readOnly: true CouponRedemptionCreate: type: object properties: @@ -20074,8 +20430,11 @@ components: coupon: "$ref": "#/components/schemas/CouponMini" state: - title: Invoice state + title: Coupon Redemption state "$ref": "#/components/schemas/ActiveStateEnum" + remaining_duration: + readOnly: true + "$ref": "#/components/schemas/CouponRedemptionRemainingDuration" discounted: type: number format: float @@ -20972,6 +21331,12 @@ components: format: float title: Discount description: Total discounts applied to this invoice. + coupon_redemptions: + type: array + title: Coupon Redemptions + description: The coupon redemptions applied to this invoice. + items: + "$ref": "#/components/schemas/CouponRedemptionMini" subtotal: type: number format: float @@ -21684,7 +22049,14 @@ components: type: number format: float title: Discount - description: The discount applied to the line item. + description: The sum of all discounts applied to the line item. + discounts: + type: array + title: Discounts + description: The breakdown of discounts applied to the line item by coupon + redemption. + items: + "$ref": "#/components/schemas/LineItemDiscount" liability_gl_account_code: type: string title: Accounting code for the ledger account. @@ -27239,6 +27611,7 @@ components: - day - month - week + - billing_period RedemptionResourceEnum: type: string enum: diff --git a/src/main/java/com/recurly/v3/Client.java b/src/main/java/com/recurly/v3/Client.java index 4860c5e9..35421c58 100644 --- a/src/main/java/com/recurly/v3/Client.java +++ b/src/main/java/com/recurly/v3/Client.java @@ -2078,6 +2078,21 @@ public Invoice refundInvoice(String invoiceId, InvoiceRefund body) { return this.makeRequest("POST", path, body, returnType); } + /** + * Create an invoice for revenue recovery + * + * @see create_invoice_retry api documentation + * @param body The body of the request. + * @return Returns the new invoices. + */ + public InvoiceCollection createInvoiceRetry(RecoveryInvoiceCreate body) { + final String url = "/invoices/recovery"; + final HashMap urlParams = new HashMap(); + final String path = this.interpolatePath(url, urlParams); + Type returnType = InvoiceCollection.class; + return this.makeRequest("POST", path, body, returnType); + } + /** * List a site's line items * diff --git a/src/main/java/com/recurly/v3/Constants.java b/src/main/java/com/recurly/v3/Constants.java index 06955b6f..55703b61 100644 --- a/src/main/java/com/recurly/v3/Constants.java +++ b/src/main/java/com/recurly/v3/Constants.java @@ -561,6 +561,9 @@ public enum FreeTrialUnit { @SerializedName("week") WEEK, + @SerializedName("billing_period") + BILLING_PERIOD, + }; public enum RedemptionResource { diff --git a/src/main/java/com/recurly/v3/requests/CouponCreate.java b/src/main/java/com/recurly/v3/requests/CouponCreate.java index decab644..465cfc3f 100644 --- a/src/main/java/com/recurly/v3/requests/CouponCreate.java +++ b/src/main/java/com/recurly/v3/requests/CouponCreate.java @@ -90,7 +90,8 @@ public class CouponCreate extends Request { /** * Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine - * the duration of time the coupon is for. Required if `discount_type` is `free_trial`. + * the duration of time the coupon is for. Required if `discount_type` is `free_trial`. Use + * `billing_period` to grant a free trial for a number of billing cycles. */ @SerializedName("free_trial_unit") @Expose @@ -176,7 +177,9 @@ public class CouponCreate extends Request { /** * If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define * the duration that the coupon will be applied to invoices for. Use "billing_period" to apply the - * coupon for a fixed number of billing cycles. Requires `redemption_resource=subscription`. + * coupon for a fixed number of billing cycles. Requires `redemption_resource=subscription`. Not + * compatible with `discount_type=free_trial`; use `free_trial_unit=billing_period` and + * `free_trial_amount` instead. */ @SerializedName("temporal_unit") @Expose @@ -349,7 +352,8 @@ public void setFreeTrialAmount(final Integer freeTrialAmount) { /** * Description of the unit of time the coupon is for. Used with `free_trial_amount` to determine - * the duration of time the coupon is for. Required if `discount_type` is `free_trial`. + * the duration of time the coupon is for. Required if `discount_type` is `free_trial`. Use + * `billing_period` to grant a free trial for a number of billing cycles. */ public Constants.FreeTrialUnit getFreeTrialUnit() { return this.freeTrialUnit; @@ -358,7 +362,8 @@ public Constants.FreeTrialUnit getFreeTrialUnit() { /** * @param freeTrialUnit Description of the unit of time the coupon is for. Used with * `free_trial_amount` to determine the duration of time the coupon is for. Required if - * `discount_type` is `free_trial`. + * `discount_type` is `free_trial`. Use `billing_period` to grant a free trial for a number of + * billing cycles. */ public void setFreeTrialUnit(final Constants.FreeTrialUnit freeTrialUnit) { this.freeTrialUnit = freeTrialUnit; @@ -524,7 +529,9 @@ public void setTemporalAmount(final Integer temporalAmount) { /** * If `duration` is "temporal" than `temporal_unit` is multiplied by `temporal_amount` to define * the duration that the coupon will be applied to invoices for. Use "billing_period" to apply the - * coupon for a fixed number of billing cycles. Requires `redemption_resource=subscription`. + * coupon for a fixed number of billing cycles. Requires `redemption_resource=subscription`. Not + * compatible with `discount_type=free_trial`; use `free_trial_unit=billing_period` and + * `free_trial_amount` instead. */ public Constants.TemporalUnit getTemporalUnit() { return this.temporalUnit; @@ -534,7 +541,8 @@ public Constants.TemporalUnit getTemporalUnit() { * @param temporalUnit If `duration` is "temporal" than `temporal_unit` is multiplied by * `temporal_amount` to define the duration that the coupon will be applied to invoices for. * Use "billing_period" to apply the coupon for a fixed number of billing cycles. Requires - * `redemption_resource=subscription`. + * `redemption_resource=subscription`. Not compatible with `discount_type=free_trial`; use + * `free_trial_unit=billing_period` and `free_trial_amount` instead. */ public void setTemporalUnit(final Constants.TemporalUnit temporalUnit) { this.temporalUnit = temporalUnit; diff --git a/src/main/java/com/recurly/v3/requests/RecoveryAccountCreate.java b/src/main/java/com/recurly/v3/requests/RecoveryAccountCreate.java new file mode 100644 index 00000000..aafe258f --- /dev/null +++ b/src/main/java/com/recurly/v3/requests/RecoveryAccountCreate.java @@ -0,0 +1,142 @@ +/** + * 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 RecoveryAccountCreate extends Request { + + @SerializedName("address") + @Expose + private RecoveryAddress address; + + /** + * If the premium Wallet feature is enabled, more than one payment method can be associated with + * an account, and one can be designated as a primary and one as a backup. Without the Wallet + * feature, only one payment method will be accepted. + */ + @SerializedName("billing_infos") + @Expose + private List billingInfos; + + /** The unique identifier of the account. This cannot be changed once the account is created. */ + @SerializedName("code") + @Expose + private String code; + + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ + @SerializedName("custom_fields") + @Expose + private List customFields; + + /** + * Unique ID to identify a dunning campaign. 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 + private String email; + + public RecoveryAddress getAddress() { + return this.address; + } + + /** @param address */ + public void setAddress(final RecoveryAddress address) { + this.address = address; + } + + /** + * If the premium Wallet feature is enabled, more than one payment method can be associated with + * an account, and one can be designated as a primary and one as a backup. Without the Wallet + * feature, only one payment method will be accepted. + */ + public List getBillingInfos() { + return this.billingInfos; + } + + /** + * @param billingInfos If the premium Wallet feature is enabled, more than one payment method can + * be associated with an account, and one can be designated as a primary and one as a backup. + * Without the Wallet feature, only one payment method will be accepted. + */ + public void setBillingInfos(final List billingInfos) { + this.billingInfos = billingInfos; + } + + /** The unique identifier of the account. This cannot be changed once the account is created. */ + public String getCode() { + return this.code; + } + + /** + * @param code The unique identifier of the account. This cannot be changed once the account is + * created. + */ + public void setCode(final String code) { + this.code = code; + } + + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ + public List getCustomFields() { + return this.customFields; + } + + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ + public void setCustomFields(final List customFields) { + this.customFields = customFields; + } + + /** + * Unique ID to identify a dunning campaign. 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. 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; + } + + /** @param email The email address used for communicating with this customer. */ + public void setEmail(final String email) { + this.email = email; + } +} diff --git a/src/main/java/com/recurly/v3/requests/RecoveryAddress.java b/src/main/java/com/recurly/v3/requests/RecoveryAddress.java new file mode 100644 index 00000000..94954884 --- /dev/null +++ b/src/main/java/com/recurly/v3/requests/RecoveryAddress.java @@ -0,0 +1,119 @@ +/** + * 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.*; + +public class RecoveryAddress extends Request { + + /** City */ + @SerializedName("city") + @Expose + private String city; + + /** Country, 2-letter ISO 3166-1 alpha-2 code. */ + @SerializedName("country") + @Expose + private String country; + + /** Phone number */ + @SerializedName("phone") + @Expose + private String phone; + + /** Zip or postal code. */ + @SerializedName("postal_code") + @Expose + private String postalCode; + + /** State or province. */ + @SerializedName("region") + @Expose + private String region; + + /** Street 1 */ + @SerializedName("street1") + @Expose + private String street1; + + /** Street 2 */ + @SerializedName("street2") + @Expose + private String street2; + + /** City */ + public String getCity() { + return this.city; + } + + /** @param city City */ + public void setCity(final String city) { + this.city = city; + } + + /** Country, 2-letter ISO 3166-1 alpha-2 code. */ + public String getCountry() { + return this.country; + } + + /** @param country Country, 2-letter ISO 3166-1 alpha-2 code. */ + public void setCountry(final String country) { + this.country = country; + } + + /** Phone number */ + public String getPhone() { + return this.phone; + } + + /** @param phone Phone number */ + public void setPhone(final String phone) { + this.phone = phone; + } + + /** Zip or postal code. */ + public String getPostalCode() { + return this.postalCode; + } + + /** @param postalCode Zip or postal code. */ + public void setPostalCode(final String postalCode) { + this.postalCode = postalCode; + } + + /** State or province. */ + public String getRegion() { + return this.region; + } + + /** @param region State or province. */ + public void setRegion(final String region) { + this.region = region; + } + + /** Street 1 */ + public String getStreet1() { + return this.street1; + } + + /** @param street1 Street 1 */ + public void setStreet1(final String street1) { + this.street1 = street1; + } + + /** Street 2 */ + public String getStreet2() { + return this.street2; + } + + /** @param street2 Street 2 */ + public void setStreet2(final String street2) { + this.street2 = street2; + } +} diff --git a/src/main/java/com/recurly/v3/requests/RecoveryBillingInfoCreate.java b/src/main/java/com/recurly/v3/requests/RecoveryBillingInfoCreate.java new file mode 100644 index 00000000..1f4e8831 --- /dev/null +++ b/src/main/java/com/recurly/v3/requests/RecoveryBillingInfoCreate.java @@ -0,0 +1,243 @@ +/** + * 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 RecoveryBillingInfoCreate extends Request { + + @SerializedName("address") + @Expose + private RecoveryAddress address; + + /** + * The `backup_payment_method` field is used to designate a billing info as a backup on the + * account that will be tried if the initial billing info used for an invoice is declined. All + * payment methods, including the billing info marked `primary_payment_method` can be set as a + * backup. An account can have a maximum of 1 backup, if a user sets a different payment method as + * a backup, the existing backup will no longer be marked as such. + */ + @SerializedName("backup_payment_method") + @Expose + private Boolean backupPaymentMethod; + + /** Company name */ + @SerializedName("company") + @Expose + private String company; + + /** First name */ + @SerializedName("first_name") + @Expose + private String firstName; + + /** An identifier for a specific payment gateway. */ + @SerializedName("gateway_code") + @Expose + private String gatewayCode; + + /** *STRONGLY RECOMMENDED* Customer's IP address when updating their billing information. */ + @SerializedName("ip_address") + @Expose + private String ipAddress; + + /** Last name */ + @SerializedName("last_name") + @Expose + private String lastName; + + /** + * Network transaction ID from the previous customer-in-session subscription signup or billing + * info storage. + * + *

- 10-15 alphanumeric characters for Mastercard - 14-15 alphanumeric for Visa - 15 digits for + * all other brands - 16 alphanumeric characters for Cartes Bancaires, which are processed as Visa + * or Mastercard + */ + @SerializedName("network_transaction_id") + @Expose + private String networkTransactionId; + + /** + * Array of Payment Gateway References, each a reference to a third-party gateway object of + * varying types. + */ + @SerializedName("payment_gateway_references") + @Expose + private List paymentGatewayReferences; + + /** + * The `primary_payment_method` field is used to designate the primary billing info on the + * account. An account can have a maximum of 1 primary. If a user sets a different payment method + * as a primary, then the existing primary will no longer be marked as such. + */ + @SerializedName("primary_payment_method") + @Expose + private Boolean primaryPaymentMethod; + + /** Transactions from previous collection attempts for this payment method. */ + @SerializedName("transactions") + @Expose + private List transactions; + + public RecoveryAddress getAddress() { + return this.address; + } + + /** @param address */ + public void setAddress(final RecoveryAddress address) { + this.address = address; + } + + /** + * The `backup_payment_method` field is used to designate a billing info as a backup on the + * account that will be tried if the initial billing info used for an invoice is declined. All + * payment methods, including the billing info marked `primary_payment_method` can be set as a + * backup. An account can have a maximum of 1 backup, if a user sets a different payment method as + * a backup, the existing backup will no longer be marked as such. + */ + public Boolean getBackupPaymentMethod() { + return this.backupPaymentMethod; + } + + /** + * @param backupPaymentMethod The `backup_payment_method` field is used to designate a billing + * info as a backup on the account that will be tried if the initial billing info used for an + * invoice is declined. All payment methods, including the billing info marked + * `primary_payment_method` can be set as a backup. An account can have a maximum of 1 backup, + * if a user sets a different payment method as a backup, the existing backup will no longer + * be marked as such. + */ + public void setBackupPaymentMethod(final Boolean backupPaymentMethod) { + this.backupPaymentMethod = backupPaymentMethod; + } + + /** Company name */ + public String getCompany() { + return this.company; + } + + /** @param company Company name */ + public void setCompany(final String company) { + this.company = company; + } + + /** First name */ + public String getFirstName() { + return this.firstName; + } + + /** @param firstName First name */ + public void setFirstName(final String firstName) { + this.firstName = firstName; + } + + /** An identifier for a specific payment gateway. */ + public String getGatewayCode() { + return this.gatewayCode; + } + + /** @param gatewayCode An identifier for a specific payment gateway. */ + public void setGatewayCode(final String gatewayCode) { + this.gatewayCode = gatewayCode; + } + + /** *STRONGLY RECOMMENDED* Customer's IP address when updating their billing information. */ + public String getIpAddress() { + return this.ipAddress; + } + + /** + * @param ipAddress *STRONGLY RECOMMENDED* Customer's IP address when updating their billing + * information. + */ + public void setIpAddress(final String ipAddress) { + this.ipAddress = ipAddress; + } + + /** Last name */ + public String getLastName() { + return this.lastName; + } + + /** @param lastName Last name */ + public void setLastName(final String lastName) { + this.lastName = lastName; + } + + /** + * Network transaction ID from the previous customer-in-session subscription signup or billing + * info storage. + * + *

- 10-15 alphanumeric characters for Mastercard - 14-15 alphanumeric for Visa - 15 digits for + * all other brands - 16 alphanumeric characters for Cartes Bancaires, which are processed as Visa + * or Mastercard + */ + public String getNetworkTransactionId() { + return this.networkTransactionId; + } + + /** + * @param networkTransactionId Network transaction ID from the previous customer-in-session + * subscription signup or billing info storage. + *

- 10-15 alphanumeric characters for Mastercard - 14-15 alphanumeric for Visa - 15 digits + * for all other brands - 16 alphanumeric characters for Cartes Bancaires, which are processed + * as Visa or Mastercard + */ + public void setNetworkTransactionId(final String networkTransactionId) { + this.networkTransactionId = networkTransactionId; + } + + /** + * Array of Payment Gateway References, each a reference to a third-party gateway object of + * varying types. + */ + public List getPaymentGatewayReferences() { + return this.paymentGatewayReferences; + } + + /** + * @param paymentGatewayReferences Array of Payment Gateway References, each a reference to a + * third-party gateway object of varying types. + */ + public void setPaymentGatewayReferences( + final List paymentGatewayReferences) { + this.paymentGatewayReferences = paymentGatewayReferences; + } + + /** + * The `primary_payment_method` field is used to designate the primary billing info on the + * account. An account can have a maximum of 1 primary. If a user sets a different payment method + * as a primary, then the existing primary will no longer be marked as such. + */ + public Boolean getPrimaryPaymentMethod() { + return this.primaryPaymentMethod; + } + + /** + * @param primaryPaymentMethod The `primary_payment_method` field is used to designate the primary + * billing info on the account. An account can have a maximum of 1 primary. If a user sets a + * different payment method as a primary, then the existing primary will no longer be marked + * as such. + */ + public void setPrimaryPaymentMethod(final Boolean primaryPaymentMethod) { + this.primaryPaymentMethod = primaryPaymentMethod; + } + + /** Transactions from previous collection attempts for this payment method. */ + public List getTransactions() { + return this.transactions; + } + + /** @param transactions Transactions from previous collection attempts for this payment method. */ + public void setTransactions(final List transactions) { + this.transactions = transactions; + } +} diff --git a/src/main/java/com/recurly/v3/requests/RecoveryInvoiceCreate.java b/src/main/java/com/recurly/v3/requests/RecoveryInvoiceCreate.java new file mode 100644 index 00000000..df7f6abd --- /dev/null +++ b/src/main/java/com/recurly/v3/requests/RecoveryInvoiceCreate.java @@ -0,0 +1,123 @@ +/** + * 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; +import org.joda.time.DateTime; + +public class RecoveryInvoiceCreate extends Request { + + @SerializedName("account") + @Expose + private RecoveryAccountCreate account; + + /** 3-letter ISO 4217 currency code. */ + @SerializedName("currency") + @Expose + private String currency; + + /** Date invoice was originally due. Must be in the past. */ + @SerializedName("due_at") + @Expose + private DateTime dueAt; + + /** + * Must be set to `true` to acknowledge that the invoice is eligible for external recovery. + * Requests with `false`, omitted, or non-boolean values will be rejected. + */ + @SerializedName("external_recovery_eligible") + @Expose + private Boolean externalRecoveryEligible; + + /** + * Line items to include on the invoice. Currency is specified at the root level and must not be + * included in individual line items. + */ + @SerializedName("line_items") + @Expose + private List lineItems; + + /** This identifies the PO number associated with the subscription. */ + @SerializedName("po_number") + @Expose + private String poNumber; + + public RecoveryAccountCreate getAccount() { + return this.account; + } + + /** @param account */ + public void setAccount(final RecoveryAccountCreate account) { + this.account = account; + } + + /** 3-letter ISO 4217 currency code. */ + public String getCurrency() { + return this.currency; + } + + /** @param currency 3-letter ISO 4217 currency code. */ + public void setCurrency(final String currency) { + this.currency = currency; + } + + /** Date invoice was originally due. Must be in the past. */ + public DateTime getDueAt() { + return this.dueAt; + } + + /** @param dueAt Date invoice was originally due. Must be in the past. */ + public void setDueAt(final DateTime dueAt) { + this.dueAt = dueAt; + } + + /** + * Must be set to `true` to acknowledge that the invoice is eligible for external recovery. + * Requests with `false`, omitted, or non-boolean values will be rejected. + */ + public Boolean getExternalRecoveryEligible() { + return this.externalRecoveryEligible; + } + + /** + * @param externalRecoveryEligible Must be set to `true` to acknowledge that the invoice is + * eligible for external recovery. Requests with `false`, omitted, or non-boolean values will + * be rejected. + */ + public void setExternalRecoveryEligible(final Boolean externalRecoveryEligible) { + this.externalRecoveryEligible = externalRecoveryEligible; + } + + /** + * Line items to include on the invoice. Currency is specified at the root level and must not be + * included in individual line items. + */ + public List getLineItems() { + return this.lineItems; + } + + /** + * @param lineItems Line items to include on the invoice. Currency is specified at the root level + * and must not be included in individual line items. + */ + public void setLineItems(final List lineItems) { + this.lineItems = lineItems; + } + + /** This identifies the PO number associated with the subscription. */ + public String getPoNumber() { + return this.poNumber; + } + + /** @param poNumber This identifies the PO number associated with the subscription. */ + public void setPoNumber(final String poNumber) { + this.poNumber = poNumber; + } +} diff --git a/src/main/java/com/recurly/v3/requests/RecoveryLineItemCreate.java b/src/main/java/com/recurly/v3/requests/RecoveryLineItemCreate.java new file mode 100644 index 00000000..0101dbf6 --- /dev/null +++ b/src/main/java/com/recurly/v3/requests/RecoveryLineItemCreate.java @@ -0,0 +1,169 @@ +/** + * 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.math.BigDecimal; +import java.util.List; + +public class RecoveryLineItemCreate extends Request { + + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ + @SerializedName("custom_fields") + @Expose + private List customFields; + + /** Description that appears on the invoice. */ + @SerializedName("description") + @Expose + private String description; + + /** + * The Harmonized System (HS) code is an internationally standardized system of names and numbers + * to classify traded products. The HS code, sometimes called Commodity Code, is used by customs + * authorities around the world to identify products when assessing duties and taxes. The HS code + * may also be referred to as the tariff code or customs code. Values should contain only digits + * and decimals. + */ + @SerializedName("harmonized_system_code") + @Expose + private String harmonizedSystemCode; + + /** + * Optional field to track a product code or SKU for the line item. This can be used to later + * reporting on product purchases. + */ + @SerializedName("product_code") + @Expose + private String productCode; + + /** + * This number will be multiplied by the unit amount to compute the subtotal before any discounts + * or taxes. + */ + @SerializedName("quantity") + @Expose + private Integer quantity; + + /** The tax amount for the line item. */ + @SerializedName("tax") + @Expose + private BigDecimal tax; + + /** A positive or negative amount will result in a positive `unit_amount`. */ + @SerializedName("unit_amount") + @Expose + private BigDecimal unitAmount; + + /** + * The custom fields will only be altered when they are included in a request. Sending an empty + * array will not remove any existing values. To remove a field send the name with a null or empty + * value. + */ + public List getCustomFields() { + return this.customFields; + } + + /** + * @param customFields The custom fields will only be altered when they are included in a request. + * Sending an empty array will not remove any existing values. To remove a field send the name + * with a null or empty value. + */ + public void setCustomFields(final List customFields) { + this.customFields = customFields; + } + + /** Description that appears on the invoice. */ + public String getDescription() { + return this.description; + } + + /** @param description Description that appears on the invoice. */ + public void setDescription(final String description) { + this.description = description; + } + + /** + * The Harmonized System (HS) code is an internationally standardized system of names and numbers + * to classify traded products. The HS code, sometimes called Commodity Code, is used by customs + * authorities around the world to identify products when assessing duties and taxes. The HS code + * may also be referred to as the tariff code or customs code. Values should contain only digits + * and decimals. + */ + public String getHarmonizedSystemCode() { + return this.harmonizedSystemCode; + } + + /** + * @param harmonizedSystemCode The Harmonized System (HS) code is an internationally standardized + * system of names and numbers to classify traded products. The HS code, sometimes called + * Commodity Code, is used by customs authorities around the world to identify products when + * assessing duties and taxes. The HS code may also be referred to as the tariff code or + * customs code. Values should contain only digits and decimals. + */ + public void setHarmonizedSystemCode(final String harmonizedSystemCode) { + this.harmonizedSystemCode = harmonizedSystemCode; + } + + /** + * Optional field to track a product code or SKU for the line item. This can be used to later + * reporting on product purchases. + */ + public String getProductCode() { + return this.productCode; + } + + /** + * @param productCode Optional field to track a product code or SKU for the line item. This can be + * used to later reporting on product purchases. + */ + public void setProductCode(final String productCode) { + this.productCode = productCode; + } + + /** + * This number will be multiplied by the unit amount to compute the subtotal before any discounts + * or taxes. + */ + public Integer getQuantity() { + return this.quantity; + } + + /** + * @param quantity This number will be multiplied by the unit amount to compute the subtotal + * before any discounts or taxes. + */ + public void setQuantity(final Integer quantity) { + this.quantity = quantity; + } + + /** The tax amount for the line item. */ + public BigDecimal getTax() { + return this.tax; + } + + /** @param tax The tax amount for the line item. */ + public void setTax(final BigDecimal tax) { + this.tax = tax; + } + + /** A positive or negative amount will result in a positive `unit_amount`. */ + public BigDecimal getUnitAmount() { + return this.unitAmount; + } + + /** @param unitAmount A positive or negative amount will result in a positive `unit_amount`. */ + public void setUnitAmount(final BigDecimal unitAmount) { + this.unitAmount = unitAmount; + } +} diff --git a/src/main/java/com/recurly/v3/requests/RecoveryTransactionCreate.java b/src/main/java/com/recurly/v3/requests/RecoveryTransactionCreate.java new file mode 100644 index 00000000..6f78f339 --- /dev/null +++ b/src/main/java/com/recurly/v3/requests/RecoveryTransactionCreate.java @@ -0,0 +1,72 @@ +/** + * 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 org.joda.time.DateTime; + +public class RecoveryTransactionCreate extends Request { + + /** The date the original payment collection was attempted. */ + @SerializedName("attempted_collection_date") + @Expose + private DateTime attemptedCollectionDate; + + /** The error code returned by the payment gateway for the original payment collection attempt. */ + @SerializedName("gateway_error_code") + @Expose + private String gatewayErrorCode; + + /** + * The advice code returned by the payment gateway for the original payment collection attempt. + * This field is only applicable for certain gateways. + */ + @SerializedName("merchant_advice_code") + @Expose + private String merchantAdviceCode; + + /** The date the original payment collection was attempted. */ + public DateTime getAttemptedCollectionDate() { + return this.attemptedCollectionDate; + } + + /** @param attemptedCollectionDate The date the original payment collection was attempted. */ + public void setAttemptedCollectionDate(final DateTime attemptedCollectionDate) { + this.attemptedCollectionDate = attemptedCollectionDate; + } + + /** The error code returned by the payment gateway for the original payment collection attempt. */ + public String getGatewayErrorCode() { + return this.gatewayErrorCode; + } + + /** + * @param gatewayErrorCode The error code returned by the payment gateway for the original payment + * collection attempt. + */ + public void setGatewayErrorCode(final String gatewayErrorCode) { + this.gatewayErrorCode = gatewayErrorCode; + } + + /** + * The advice code returned by the payment gateway for the original payment collection attempt. + * This field is only applicable for certain gateways. + */ + public String getMerchantAdviceCode() { + return this.merchantAdviceCode; + } + + /** + * @param merchantAdviceCode The advice code returned by the payment gateway for the original + * payment collection attempt. This field is only applicable for certain gateways. + */ + public void setMerchantAdviceCode(final String merchantAdviceCode) { + this.merchantAdviceCode = merchantAdviceCode; + } +} diff --git a/src/main/java/com/recurly/v3/resources/CouponDiscountTrial.java b/src/main/java/com/recurly/v3/resources/CouponDiscountTrial.java index 90915876..33460301 100644 --- a/src/main/java/com/recurly/v3/resources/CouponDiscountTrial.java +++ b/src/main/java/com/recurly/v3/resources/CouponDiscountTrial.java @@ -17,7 +17,10 @@ public class CouponDiscountTrial extends Resource { @Expose private Integer length; - /** Temporal unit of the free trial */ + /** + * Temporal unit of the free trial. When `billing_period`, `length` represents the number of + * billing cycles. + */ @SerializedName("unit") @Expose private Constants.FreeTrialUnit unit; @@ -32,12 +35,18 @@ public void setLength(final Integer length) { this.length = length; } - /** Temporal unit of the free trial */ + /** + * Temporal unit of the free trial. When `billing_period`, `length` represents the number of + * billing cycles. + */ public Constants.FreeTrialUnit getUnit() { return this.unit; } - /** @param unit Temporal unit of the free trial */ + /** + * @param unit Temporal unit of the free trial. When `billing_period`, `length` represents the + * number of billing cycles. + */ public void setUnit(final Constants.FreeTrialUnit unit) { this.unit = unit; } diff --git a/src/main/java/com/recurly/v3/resources/CouponRedemption.java b/src/main/java/com/recurly/v3/resources/CouponRedemption.java index 5fcba8d9..176dcef3 100644 --- a/src/main/java/com/recurly/v3/resources/CouponRedemption.java +++ b/src/main/java/com/recurly/v3/resources/CouponRedemption.java @@ -50,6 +50,10 @@ public class CouponRedemption extends Resource { @Expose private String object; + @SerializedName("remaining_duration") + @Expose + private CouponRedemptionRemainingDuration remainingDuration; + /** The date and time the redemption was removed from the account (un-redeemed). */ @SerializedName("removed_at") @Expose @@ -151,6 +155,15 @@ public void setObject(final String object) { this.object = object; } + public CouponRedemptionRemainingDuration getRemainingDuration() { + return this.remainingDuration; + } + + /** @param remainingDuration */ + public void setRemainingDuration(final CouponRedemptionRemainingDuration remainingDuration) { + this.remainingDuration = remainingDuration; + } + /** The date and time the redemption was removed from the account (un-redeemed). */ public DateTime getRemovedAt() { return this.removedAt; diff --git a/src/main/java/com/recurly/v3/resources/CouponRedemptionMini.java b/src/main/java/com/recurly/v3/resources/CouponRedemptionMini.java index 7e765d98..29f1ce2c 100644 --- a/src/main/java/com/recurly/v3/resources/CouponRedemptionMini.java +++ b/src/main/java/com/recurly/v3/resources/CouponRedemptionMini.java @@ -40,7 +40,11 @@ public class CouponRedemptionMini extends Resource { @Expose private String object; - /** Invoice state */ + @SerializedName("remaining_duration") + @Expose + private CouponRedemptionRemainingDuration remainingDuration; + + /** Coupon Redemption state */ @SerializedName("state") @Expose private Constants.ActiveState state; @@ -99,12 +103,21 @@ public void setObject(final String object) { this.object = object; } - /** Invoice state */ + public CouponRedemptionRemainingDuration getRemainingDuration() { + return this.remainingDuration; + } + + /** @param remainingDuration */ + public void setRemainingDuration(final CouponRedemptionRemainingDuration remainingDuration) { + this.remainingDuration = remainingDuration; + } + + /** Coupon Redemption state */ public Constants.ActiveState getState() { return this.state; } - /** @param state Invoice state */ + /** @param state Coupon Redemption state */ public void setState(final Constants.ActiveState state) { this.state = state; } diff --git a/src/main/java/com/recurly/v3/resources/CouponRedemptionRemainingDuration.java b/src/main/java/com/recurly/v3/resources/CouponRedemptionRemainingDuration.java new file mode 100644 index 00000000..52f78dea --- /dev/null +++ b/src/main/java/com/recurly/v3/resources/CouponRedemptionRemainingDuration.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.resources; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.recurly.v3.Constants; +import com.recurly.v3.Resource; +import org.joda.time.DateTime; + +public class CouponRedemptionRemainingDuration extends Resource { + + /** + * Present when `type` is `temporal`. The datetime after which this redemption will no longer + * apply. + */ + @SerializedName("expires_at") + @Expose + private DateTime expiresAt; + + /** + * The coupon's duration type. `temporal` includes an `expires_at` timestamp. `forever` and + * `single_use` have no additional fields. + */ + @SerializedName("type") + @Expose + private Constants.CouponDuration type; + + /** + * Present when `type` is `temporal`. The datetime after which this redemption will no longer + * apply. + */ + public DateTime getExpiresAt() { + return this.expiresAt; + } + + /** + * @param expiresAt Present when `type` is `temporal`. The datetime after which this redemption + * will no longer apply. + */ + public void setExpiresAt(final DateTime expiresAt) { + this.expiresAt = expiresAt; + } + + /** + * The coupon's duration type. `temporal` includes an `expires_at` timestamp. `forever` and + * `single_use` have no additional fields. + */ + public Constants.CouponDuration getType() { + return this.type; + } + + /** + * @param type The coupon's duration type. `temporal` includes an `expires_at` timestamp. + * `forever` and `single_use` have no additional fields. + */ + public void setType(final Constants.CouponDuration type) { + this.type = type; + } +} diff --git a/src/main/java/com/recurly/v3/resources/Invoice.java b/src/main/java/com/recurly/v3/resources/Invoice.java index 9723e579..8bab4348 100644 --- a/src/main/java/com/recurly/v3/resources/Invoice.java +++ b/src/main/java/com/recurly/v3/resources/Invoice.java @@ -63,6 +63,11 @@ public class Invoice extends Resource { @Expose private Constants.CollectionMethod collectionMethod; + /** The coupon redemptions applied to this invoice. */ + @SerializedName("coupon_redemptions") + @Expose + private List couponRedemptions; + /** Created at */ @SerializedName("created_at") @Expose @@ -423,6 +428,16 @@ public void setCollectionMethod(final Constants.CollectionMethod collectionMetho this.collectionMethod = collectionMethod; } + /** The coupon redemptions applied to this invoice. */ + public List getCouponRedemptions() { + return this.couponRedemptions; + } + + /** @param couponRedemptions The coupon redemptions applied to this invoice. */ + public void setCouponRedemptions(final List couponRedemptions) { + this.couponRedemptions = couponRedemptions; + } + /** Created at */ public DateTime getCreatedAt() { return this.createdAt; diff --git a/src/main/java/com/recurly/v3/resources/LineItem.java b/src/main/java/com/recurly/v3/resources/LineItem.java index 6c71d119..f243c083 100644 --- a/src/main/java/com/recurly/v3/resources/LineItem.java +++ b/src/main/java/com/recurly/v3/resources/LineItem.java @@ -116,11 +116,16 @@ public class LineItem extends Resource { @Expose private Constants.DestinationTaxAddressSource destinationTaxAddressSource; - /** The discount applied to the line item. */ + /** The sum of all discounts applied to the line item. */ @SerializedName("discount") @Expose private BigDecimal discount; + /** The breakdown of discounts applied to the line item by coupon redemption. */ + @SerializedName("discounts") + @Expose + private List discounts; + /** If this date is provided, it indicates the end of a time range. */ @SerializedName("end_date") @Expose @@ -634,16 +639,26 @@ public void setDestinationTaxAddressSource( this.destinationTaxAddressSource = destinationTaxAddressSource; } - /** The discount applied to the line item. */ + /** The sum of all discounts applied to the line item. */ public BigDecimal getDiscount() { return this.discount; } - /** @param discount The discount applied to the line item. */ + /** @param discount The sum of all discounts applied to the line item. */ public void setDiscount(final BigDecimal discount) { this.discount = discount; } + /** The breakdown of discounts applied to the line item by coupon redemption. */ + public List getDiscounts() { + return this.discounts; + } + + /** @param discounts The breakdown of discounts applied to the line item by coupon redemption. */ + public void setDiscounts(final List discounts) { + this.discounts = discounts; + } + /** If this date is provided, it indicates the end of a time range. */ public DateTime getEndDate() { return this.endDate; diff --git a/src/main/java/com/recurly/v3/resources/LineItemDiscount.java b/src/main/java/com/recurly/v3/resources/LineItemDiscount.java new file mode 100644 index 00000000..876fb6ab --- /dev/null +++ b/src/main/java/com/recurly/v3/resources/LineItemDiscount.java @@ -0,0 +1,107 @@ +/** + * 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.math.BigDecimal; + +public class LineItemDiscount extends Resource { + + /** The ID of the coupon that generated this discount. */ + @SerializedName("coupon_id") + @Expose + private String couponId; + + /** The ID of the coupon redemption that generated this discount. */ + @SerializedName("coupon_redemption_id") + @Expose + private String couponRedemptionId; + + /** 3-letter ISO 4217 currency code. */ + @SerializedName("currency") + @Expose + private String currency; + + /** The amount discounted on this line item by this coupon redemption. */ + @SerializedName("discount_amount") + @Expose + private BigDecimal discountAmount; + + /** Will always be `line_item_discount`. */ + @SerializedName("object") + @Expose + private String object; + + /** The order in which this discount was applied when multiple coupons were redeemed. */ + @SerializedName("order_applied") + @Expose + private Integer orderApplied; + + /** The ID of the coupon that generated this discount. */ + public String getCouponId() { + return this.couponId; + } + + /** @param couponId The ID of the coupon that generated this discount. */ + public void setCouponId(final String couponId) { + this.couponId = couponId; + } + + /** The ID of the coupon redemption that generated this discount. */ + public String getCouponRedemptionId() { + return this.couponRedemptionId; + } + + /** @param couponRedemptionId The ID of the coupon redemption that generated this discount. */ + public void setCouponRedemptionId(final String couponRedemptionId) { + this.couponRedemptionId = couponRedemptionId; + } + + /** 3-letter ISO 4217 currency code. */ + public String getCurrency() { + return this.currency; + } + + /** @param currency 3-letter ISO 4217 currency code. */ + public void setCurrency(final String currency) { + this.currency = currency; + } + + /** The amount discounted on this line item by this coupon redemption. */ + public BigDecimal getDiscountAmount() { + return this.discountAmount; + } + + /** @param discountAmount The amount discounted on this line item by this coupon redemption. */ + public void setDiscountAmount(final BigDecimal discountAmount) { + this.discountAmount = discountAmount; + } + + /** Will always be `line_item_discount`. */ + public String getObject() { + return this.object; + } + + /** @param object Will always be `line_item_discount`. */ + public void setObject(final String object) { + this.object = object; + } + + /** The order in which this discount was applied when multiple coupons were redeemed. */ + public Integer getOrderApplied() { + return this.orderApplied; + } + + /** + * @param orderApplied The order in which this discount was applied when multiple coupons were + * redeemed. + */ + public void setOrderApplied(final Integer orderApplied) { + this.orderApplied = orderApplied; + } +}