diff --git a/README.md b/README.md index 601ffd97..b9ebde3e 100644 --- a/README.md +++ b/README.md @@ -32,25 +32,25 @@ Install the SDK by adding the following dependency in your project's pom.xml fil com.maxio advanced-billing-sdk - 9.1.0 + 10.0.0 ``` You can also view the package at: -https://central.sonatype.com/artifact/com.maxio/advanced-billing-sdk/9.1.0 +https://central.sonatype.com/artifact/com.maxio/advanced-billing-sdk/10.0.0 ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | site | `String` | The subdomain for your Advanced Billing site.
*Default*: `"subdomain"` | -| environment | [`Environment`](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | -| httpClientConfig | [`Consumer`](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-client-configuration-builder.md) | Set up Http Client Configuration instance. | -| basicAuthCredentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | +| environment | [`Environment`](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | +| httpClientConfig | [`Consumer`](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-client-configuration-builder.md) | Set up Http Client Configuration instance. | +| basicAuthCredentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/auth/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: @@ -93,68 +93,68 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-products.md) -* [Subscription Renewals](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-renewals.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-products.md) +* [Subscription Renewals](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-renewals.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [Configuration Interface](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/configuration-interface.md) -* [HttpClientConfiguration](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-client-configuration.md) -* [HttpClientConfiguration.Builder](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-client-configuration-builder.md) -* [HttpProxyConfiguration](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-proxy-configuration.md) -* [HttpProxyConfiguration.Builder](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-proxy-configuration-builder.md) +* [Configuration Interface](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/configuration-interface.md) +* [HttpClientConfiguration](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-client-configuration.md) +* [HttpClientConfiguration.Builder](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-client-configuration-builder.md) +* [HttpProxyConfiguration](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-proxy-configuration.md) +* [HttpProxyConfiguration.Builder](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-proxy-configuration-builder.md) ### HTTP -* [Headers](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/headers.md) -* [HttpCallback Interface](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-callback-interface.md) -* [HttpContext](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-context.md) -* [HttpBodyRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-body-request.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-request.md) -* [HttpResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-response.md) -* [HttpStringResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/http-string-response.md) +* [Headers](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/headers.md) +* [HttpCallback Interface](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-callback-interface.md) +* [HttpContext](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-context.md) +* [HttpBodyRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-body-request.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-response.md) +* [HttpStringResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/http-string-response.md) ### Utilities -* [ApiException](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/api-exception.md) -* [ApiHelper](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/api-helper.md) -* [FileWrapper](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/file-wrapper.md) -* [DateTimeHelper](https://www.github.com/maxio-com/ab-java-sdk/tree/9.1.0/doc/date-time-helper.md) +* [ApiException](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/api-exception.md) +* [ApiHelper](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/api-helper.md) +* [FileWrapper](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/file-wrapper.md) +* [DateTimeHelper](https://www.github.com/maxio-com/ab-java-sdk/tree/10.0.0/doc/date-time-helper.md) diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index d47d70ee..fa7082f5 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,10 +17,13 @@ AdvanceInvoiceController advanceInvoiceController = client.getAdvanceInvoiceCont # Issue Advance Invoice -Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility for generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. -A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error. -That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated. -We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. +Issues an invoice in advance for a subscription's next renewal date. For the most part, advance invoices function like any other invoice, except they are issued early and have special behavior upon being voided. For more information on advance invoices, including eligibility for generating one, see [Issue Invoice In Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance). + +A subscription can only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists returns an error. + +Regeneration of the invoice can be forced with the params `force: true`, which voids an advance invoice if one exists and generates a new one. If no advance invoice exists, a new one is generated. + +Consider using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. ```java Invoice issueAdvanceInvoice( @@ -118,8 +121,11 @@ try { # Void Advance Invoice -Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. -A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, [see our help docs](../../doc/models/invoice.md). +Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. + +A `reason` is required to void, and the invoice must have an open status. Voiding causes any prepayments and credits that were applied to the invoice to be returned to the subscription. + +For a full overview of the impact of voiding, see [Invoice](../../doc/models/invoice.md). ```java Invoice voidAdvanceInvoice( diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 18d6c526..2d455195 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -179,9 +179,7 @@ try { # Export Proforma Invoices -Creates a proforma invoices export and returns a batch job object. - -It is only available for Relationship Invoicing architecture. +Creates a proforma invoices export and returns a batch job object. Proforma invoices are only available on Relationship Invoicing sites. ```java BatchJobResponse exportProformaInvoices() @@ -297,7 +295,7 @@ try { # Read Proforma Invoices Export -Returns a batch job object for a proforma invoices export. +Returns a batch job object for a proforma invoices export. Proforma invoices are only available on Relationship Invoicing sites. ```java BatchJobResponse readProformaInvoicesExport( diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index af85e8f3..7e31c452 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -20,21 +20,15 @@ BillingPortalController billingPortalController = client.getBillingPortalControl Enables Billing Portal access for a customer, with an option to send an invitation email at the same time. -## Billing Portal Documentation - -Full documentation on how the Billing Portal operates within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). - -This documentation is focused on how to configure the Billing Portal Settings, as well as Subscriber Interaction and Merchant Management of the Billing Portal. - -You can use this endpoint to enable Billing Portal access for a Customer, with the option of sending the Customer an Invitation email at the same time. - ## Billing Portal Security -If your customer has been invited to the Billing Portal, then they will receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** +If your customer has been invited to the Billing Portal, they receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** + +If you need to provide your customer their Management URL through other means, you can retrieve it [via the API](../../doc/controllers/billing-portal.md#read-billing-portal-link). Because the URL is cryptographically signed with a timestamp, merchants cannot generate the URL without requesting it through the API. -If you need to provide your customer their Management URL through other means, you can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for merchants to generate the URL without requesting it from Advanced Billing. +To prevent abuse and overuse, request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request every time. -In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request to Advanced Billing every time. +For more information configuring the Billing Portal, see [Billing Portal Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). ```java CustomerResponse enableBillingPortalForCustomer( @@ -85,13 +79,13 @@ try { Returns the exact URL required for a subscriber to access the Billing Portal. -## Rules for Management Link API +## Management Link Request Rules -+ When retrieving a management URL, multiple requests for the same customer in a short period will return the **same** URL -+ We will not generate a new URL for 15 days ++ When retrieving a management URL, multiple requests for the same customer in a short period return the **same** URL ++ A new URL is not generated for 15 days + You must cache and remember this URL if you are going to need it again within 15 days + Only request a new URL after the `new_link_available_at` date -+ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you will be blocked from further Management URL requests (with a response code `429`) ++ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you are blocked from further Management URL requests (with a response code `429`). ```java PortalManagementLink readBillingPortalLink( diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index d28d6129..ef700c54 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -196,8 +196,6 @@ Lists the price points associated with a component. You may specify the component by using either the numeric id or the `handle:gold` syntax. -When fetching a component's price points, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. - If the price point is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. ```java @@ -705,7 +703,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `componentId` | [`ReadComponentPricePointComponentId`](../../doc/models/containers/read-component-price-point-component-id.md) | Template, Required | This is a container for one-of cases. | | `pricePointId` | [`ReadComponentPricePointPricePointId`](../../doc/models/containers/read-component-price-point-price-point-id.md) | Template, Required | This is a container for one-of cases. | -| `currencyPrices` | `Boolean` | Query, Optional | Include an array of currency price data | +| `currencyPrices` | `Boolean` | Query, Optional | Include an array of currency price data. | ## Response Type diff --git a/doc/controllers/components.md b/doc/controllers/components.md index b84eb58c..5638533a 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -32,8 +32,14 @@ Metered components are used to bill for any type of unit that resets to 0 at the Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead. +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` metered component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. This does not apply to metered components configured for event-based billing (metric, meter, or formula). See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```java ComponentResponse createMeteredComponent( final String productFamilyId, @@ -155,7 +161,7 @@ try { Creates a Quantity Based component definition under the specified product family. A Quantity Based component can then be added and “allocated” for a subscription. -When defining a Quantity Based component, you can choose one of 2 types: +When defining a Quantity Based component, you can choose one of two types: #### Recurring @@ -167,8 +173,16 @@ One-time quantity-based components are used to create ad hoc usage charges that The allocated quantity for one-time quantity-based components immediately gets reset back to zero after the allocation is made. +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```java ComponentResponse createQuantityBasedComponent( final String productFamilyId, @@ -292,6 +306,8 @@ On/off components are used for any flat fee, recurring add on (think $99/month f For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```java ComponentResponse createOnOffComponent( final String productFamilyId, @@ -396,9 +412,11 @@ try { Creates a prepaid usage component definition under the specified product family. A prepaid component can then be added and “allocated” for a subscription. -Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased. +Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and usage is subsequently tracked against the amount purchased. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```java ComponentResponse createPrepaidUsageComponent( @@ -559,7 +577,9 @@ Event-based components are similar to other component types, in that you define So, instead of reporting usage directly for each component (as you would with metered components), the usage is derived from analysis of your events. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```java ComponentResponse createEventBasedComponent( @@ -820,6 +840,8 @@ Updates a component from a specific product family. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```java ComponentResponse updateProductFamilyComponent( final int productFamilyId, @@ -1135,6 +1157,8 @@ Updates a component. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```java ComponentResponse updateComponent( final String componentId, diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 282fd5c0..269e5bad 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -30,11 +30,7 @@ CouponsController couponsController = client.getCouponsController(); Creates a coupon under the specified product family. -You can create either a flat amount coupon by specifying amount_in_cents, or a percentage coupon by specifying percentage -You can restrict a coupon to only apply to specific products / components by optionally passing in `restricted_products` and/or `restricted_components` objects in the format: -`{ "": boolean_value }` - -Coupons can be administered in the Advanced Billing application or created via API. See [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. +You can create either a flat amount coupon, by specifying `amount_in_cents`, or percentage coupon by specifying `percentage`. See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI. @@ -261,9 +257,9 @@ try { # Find Coupon -Searches for a coupon by code, returning a 404 if no coupon is found. By passing a code parameter, the find will attempt to locate a coupon that matches that code. +Searches for a coupon by code. -If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, then you will need to specify (either in the url or as a query string param) the product family id. +If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, you need to specify (either in the URL or as a query string param) the `product_family_id`. ```java CouponResponse findCoupon( @@ -282,7 +278,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `productFamilyId` | `Integer` | Query, Optional | The Advanced Billing id of the product family to which the coupon belongs | | `code` | `String` | Query, Optional | The code of the coupon | -| `currencyPrices` | `Boolean` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. | +| `currencyPrices` | `Boolean` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | ## Response Type @@ -306,12 +302,11 @@ try { # Read Coupon -Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this call by the ID parameter that Advanced Billing assigns. -If instead you would like to find a Coupon using a Coupon code, see the Coupon Find method. +Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the ID parameter assigned to it. -When fetching a coupon, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. +If instead you would like to find a Coupon using a Coupon code, use the [Find Coupon](../../doc/controllers/coupons.md#find-coupon) endpoint. -If the coupon is set to `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. +If the coupon is set to `use_site_exchange_rate: true`, it returns pricing based on the current exchange rate. If the flag is set to false, it returns all of the defined prices for each currency. ```java CouponResponse readCoupon( @@ -330,7 +325,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `productFamilyId` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `couponId` | `int` | Template, Required | The Advanced Billing id of the coupon | -| `currencyPrices` | `Boolean` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. | +| `currencyPrices` | `Boolean` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | ## Response Type @@ -747,23 +742,17 @@ try { # Validate Coupon -Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. If the coupon is found and is valid, the coupon will be returned with a 200 status code. - -If the coupon is invalid, the status code will be 404 and the response will say why it is invalid. If the coupon is valid, the status code will be 200 and the coupon will be returned. The following reasons for invalidity are supported: - -+ Coupon not found -+ Coupon is invalid -+ Coupon expired +Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. -If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, then you will need to specify the product family, either in the url or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. +If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, you need to specify the product family, either in the URL or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. -Eg. +Supplying the `product_family_handle` in the URL: ``` https://.chargify.com/product_families/handle:/coupons/validate.?code= ``` -Or: +Supplying the `product_family_id` as a query parameter: ``` https://.chargify.com/coupons/validate.?code=&product_family_id= @@ -913,8 +902,6 @@ try { Creates subcodes for an existing coupon. -## Coupon Subcodes Intro - Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one coupon. For example: @@ -929,21 +916,9 @@ Coupon Subcodes: + DP80302 + SPRINGBALTIMORE -Coupon subcodes can be administered in the Admin Interface or via the API. - -When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters will be capitalized before the subcode is created. - -## Coupon Subcodes Documentation +When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters are capitalized before the subcode is created. -Full documentation on how to create coupon subcodes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). - -Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). - -## Create Coupon Subcode - -This request allows you to create specific subcodes underneath an existing coupon code. - -*Note*: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. +Note: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. % to %25 @ to %40 @@ -952,7 +927,9 @@ This request allows you to create specific subcodes underneath an existing coupo _ to %5F . to %2E -So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.` +So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.`. + +For more information on coupon codes and applying coupons to subscriptions, see [Coupon Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes) and [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). ```java CouponSubcodesResponse createCouponSubcodes( @@ -1166,7 +1143,7 @@ Note: If you are using any of the allowed special characters (“%”, “@”, ## Percent Encoding Example -Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: @https://.chargify.com/coupons/567/codes/20%25OFF. +Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: @https://.chargify.com/coupons/567/codes/20%25OFF.. ```java Void deleteCouponSubcode( diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index 550f1771..6f7d7585 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -21,30 +21,29 @@ CustomersController customersController = client.getCustomersController(); # Create Customer -Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you may only create one customer for a given reference value. +Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you can only create one customer for a given reference value. -If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you may choose to leave `reference` blank, and store Advanced Billing’s unique ID for the customer, which is in the `id` attribute. +If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you can choose to leave `reference` blank, and store the system-assigned unique ID for the customer, which is in the `id` attribute. -Full documentation on how to locate, create and edit Customers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). +For more information, see [Customer Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). ## Required Country Format -Advanced Billing requires that you use the ISO Standard Country codes when formatting country attribute of the customer. +Format the country attribute of the customer using the ISO Standard Country codes. -Countries should be formatted as 2 characters. For more information, see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) +Countries should be formatted as two characters. For more information, see [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). ## Required State Format -Advanced Billing requires that you use the ISO Standard State codes when formatting state attribute of the customer. +Format the state attribute of the customer using the ISO Standard State codes. -+ US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) ++ US States (two characters): see [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). -+ States Outside the US (2-3 characters): To find the correct state codes outside of the US, go to [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to country you wish to populate. ++ States Outside the US (two to three characters): To find the correct state codes outside the US, go to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to the country you wish to populate. ## Locale -Advanced Billing allows you to attribute a language/region to your customer to deliver invoices in any required language. -For more: [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale) +You can attribute a language/region to the customer to deliver invoices in any required language. For more information, see [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale). ```java CustomerResponse createCustomer( @@ -129,6 +128,7 @@ try { "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "en-US" @@ -225,7 +225,8 @@ try { "portal_customer_created_at": "2016-10-04T15:22:29-04:00", "portal_invite_last_sent_at": "2016-10-04T15:22:30-04:00", "portal_invite_last_accepted_at": null, - "tax_exempt": false + "tax_exempt": false, + "surcharging": false } }, { @@ -251,6 +252,7 @@ try { "portal_invite_last_sent_at": "2016-10-13T16:52:54-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": true, "parent_id": 123 } }, @@ -277,6 +279,7 @@ try { "portal_invite_last_sent_at": "2016-10-19T10:49:19-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "parent_id": null } } @@ -350,6 +353,7 @@ try { "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "es-MX", @@ -436,6 +440,7 @@ try { "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": "012345678" } } @@ -530,6 +535,8 @@ try { Lists all subscriptions that belong to a customer. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, subscriptions no longer require an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ```java List listCustomerSubscriptions( final int customerId) diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index d9c37b4e..ae450af3 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -166,9 +166,9 @@ try { # Update Segment -Updates a single segment for a component with a segmented metric. It allows you to update the pricing for the segment. +Updates a single segment for a component with a segmented metric. You can also update the pricing for the segment. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. +You can specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```java SegmentResponse updateSegment( diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 7a238ea4..45176da8 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -19,15 +19,11 @@ EventsController eventsController = client.getEventsController(); Lists events for a site. -## Events Intro +Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. -Advanced Billing Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. +Within the UI, Events are referred to as Site Activity. For more information, see [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). -Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on how to view Events / Site Activity in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). - -## List Events for a Site - -This method will retrieve a list of events for a site. Use query string filters to narrow down results. You may use the `key` filter as part of your query string to narrow down results. +Use query string filters to narrow down results. You can use the `filter` parameter to filter by event key. ### Legacy Filters @@ -42,7 +38,7 @@ The following keys are no longer supported. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. ## Event Specific Data @@ -59,7 +55,7 @@ Here’s an example event for the `subscription_product_change` event: "event": { "id": 351, "key": "subscription_product_change", - "message": "Product changed on Marky Mark's subscription from 'Basic' to 'Pro'", + "message": "Product changed on Mark Alan's subscription from 'Basic' to 'Pro'", "subscription_id": 205, "event_specific_data": { "new_product_id": 3, @@ -77,7 +73,7 @@ Here’s an example event for the `subscription_state_change` event: "event": { "id": 353, "key": "subscription_state_change", - "message": "State changed on Marky Mark's subscription to Pro from trialing to active", + "message": "State changed on Mark Alan's subscription to Pro from trialing to active", "subscription_id": 205, "event_specific_data": { "new_subscription_state": "active", @@ -88,6 +84,22 @@ Here’s an example event for the `subscription_state_change` event: } ``` +## Enhanced Catalog Experience + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Plan changed on Subscription from previous plan to new plan” +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” + ```java List listEvents( final ListEventsInput input) @@ -200,7 +212,7 @@ Lists events for a subscription. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. ## Event Specific Data @@ -208,6 +220,22 @@ Different event types may include additional data in `event_specific_data` prope While some events share the same schema for `event_specific_data`, others may not include it at all. For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). +## Enhanced Catalog Experience + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ```java List listSubscriptionEvents( final ListSubscriptionEventsInput input) @@ -300,6 +328,20 @@ try { Returns the total count of events for a given site. +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ```java CountResponse readEventsCount( final ReadEventsCountInput input) diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index 8c9868fe..e929f173 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -93,8 +93,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `atTime` | `ZonedDateTime` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time | -| `subscriptionId` | `Integer` | Query, Optional | submit the id of a subscription in order to limit results | +| `atTime` | `ZonedDateTime` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time. | +| `subscriptionId` | `Integer` | Query, Optional | submit the id of a subscription in order to limit results. | ## Response Type @@ -257,7 +257,7 @@ try { **This endpoint is deprecated.** -This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. +Lists your site's current MRR, including plan and usage breakouts split per subscription. ```java SubscriptionMRRResponse listMrrPerSubscription( diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index cd45fb44..92868023 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -23,6 +23,8 @@ InvoicesController invoicesController = client.getInvoicesController(); * [Void Invoice](../../doc/controllers/invoices.md#void-invoice) * [List Consolidated Invoice Segments](../../doc/controllers/invoices.md#list-consolidated-invoice-segments) * [Create Invoice](../../doc/controllers/invoices.md#create-invoice) +* [Update Invoice](../../doc/controllers/invoices.md#update-invoice) +* [Delete Invoice](../../doc/controllers/invoices.md#delete-invoice) * [Send Invoice](../../doc/controllers/invoices.md#send-invoice) * [Preview Customer Information Changes](../../doc/controllers/invoices.md#preview-customer-information-changes) * [Update Customer Information](../../doc/controllers/invoices.md#update-customer-information) @@ -31,7 +33,7 @@ InvoicesController invoicesController = client.getInvoicesController(); # Refund Invoice -Refund an invoice, segment, or consolidated invoice. +Refunds an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated Invoice @@ -100,7 +102,7 @@ try { # List Invoices -By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. +Lists invoices for a site. By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. ```java ListInvoicesResponse listInvoices( @@ -438,7 +440,7 @@ try { # Read Invoice -Use this endpoint to retrieve the details for an invoice. +Returns the details for an invoice. ## PDF Invoice retrieval @@ -600,7 +602,7 @@ try { # List Invoice Events -This endpoint returns a list of invoice events. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. +Lists invoice events for a site. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. Exposed event types are: @@ -1052,7 +1054,7 @@ try { # Record Payment for Invoice -Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. +Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the [Record Payment for Multiple Invoices](../../doc/controllers/invoices.md#record-payment-for-multiple-invoices) endpoint. ```java Invoice recordPaymentForInvoice( @@ -1112,31 +1114,10 @@ try { # Record Payment for Multiple Invoices -This API call should be used when you want to record an external payment against multiple invoices. +Records an external payment against multiple invoices. To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. -``` -{ - "payment": { - "memo": "to pay the bills", - "details": "check number 8675309", - "method": "check", - "amount": "250.00", - "applications": [ - { - "invoice_uid": "inv_8gk5bwkct3gqt", - "amount": "100.00" - }, - { - "invoice_uid": "inv_7bc6bwkct3lyt", - "amount": "150.00" - } - ] - } -} -``` - Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. ```java @@ -1231,7 +1212,7 @@ try { # List Credit Notes -Credit Notes are like inverse invoices. They reduce the amount a customer owes. +Lists credit notes for a site. Credit Notes are like inverse invoices. They reduce the amount a customer owes. By default, the credit notes returned by this endpoint will exclude the arrays of `line_items`, `discounts`, `taxes`, `applications`, or `refunds`. To include these arrays, pass the specific field as a key in the query with a value set to `true`. @@ -1587,7 +1568,7 @@ try { # Read Credit Note -Use this endpoint to retrieve the details for a credit note. +Returns the details for a credit note. ```java CreditNote readCreditNote( @@ -1941,7 +1922,7 @@ try { # Record Payment for Subscription -Record an external payment made against a subscription that will pay partially or in full one or more invoices. +Records an external payment made against a subscription that will pay partially or in full one or more invoices. Payment will be applied starting with the oldest open invoice and then next oldest, and so on until the amount of the payment is fully consumed. @@ -2028,7 +2009,7 @@ try { # Reopen Invoice -This endpoint allows you to reopen any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). +Reopens any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). Invoices with "canceled" status are no longer considered to be due. Once reopened, they are considered due for payment. Payment may then be captured in one of the following ways: @@ -2087,7 +2068,7 @@ try { # Void Invoice -This endpoint allows you to void any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice. +Voids any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice. ```java Invoice voidInvoice( @@ -2144,7 +2125,7 @@ try { # List Consolidated Invoice Segments -Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. +Lists segments for a consolidated invoice. Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. ```java ConsolidatedInvoice listConsolidatedInvoiceSegments( @@ -2462,7 +2443,7 @@ try { # Create Invoice -This endpoint will allow you to create an ad hoc invoice. +Creates an ad hoc invoice. ### Basic Behavior @@ -2829,9 +2810,165 @@ try { | 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | +# Update Invoice + +Updates an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be updated.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be updated through this endpoint and the request returns a `422` error. If the invoice does not belong to the provided subscription, a `404` error is returned. + +Only the attributes submitted in the request are changed — omitted attributes keep their current values. + +### Line Items + +The `line_items` array describes changes to the invoice's line items. Line items not referenced in the array remain unchanged. + +#### Adding a line item + +A line item without a `uid` is added to the invoice. The same line item types and options as on invoice creation are supported (custom items, `product_id`, `component_id`, price points, period date ranges, taxes). + +#### Updating a line item + +A line item with the `uid` of an existing line item updates that line item with the submitted attributes. Amounts and taxes are recalculated. + +#### Removing a line item + +A line item with a `uid` and `"_destroy": true` is removed from the invoice. Other line items remain unchanged. + +Referencing a `uid` which does not exist on the invoice returns a `422` error. + +### Coupons + +When the `coupons` key is present, the submitted coupons replace all discounts currently applied to the invoice. Send an empty array to remove all discounts. Coupon options are the same as on invoice creation. + +### Invoice Options + +#### Issue Date and Net Terms + +The `issue_date` parameter can be sent to change the invoice's issue date. Only today or dates in the past are accepted. The date is interpreted and validated in your site's time zone, using the `YYYY-MM-DD` format. The `net_terms` parameter indicates the number of days after the issue date on which the invoice is due. The due date is recalculated whenever the issue date or net terms change. + +#### Addresses + +The seller, shipping and billing addresses can be sent to replace the addresses on the invoice. Each address requires to send a `first_name` at a minimum in order to work. Taxes are recalculated after an address change. + +#### Memo and Payment Instructions + +A custom memo can be sent with the `memo` parameter. Likewise, custom payment instructions can be sent with the `payment_instructions` parameter. + +```java +InvoiceResponse updateInvoice( + final int subscriptionId, + final String uid, + final UpdateInvoiceRequest body) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription. | +| `uid` | `String` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`UpdateInvoiceRequest`](../../doc/models/update-invoice-request.md) | Body, Optional | Request payload for updating a draft ad hoc invoice. | + +## Response Type + +**200**: OK + +[`InvoiceResponse`](../../doc/models/invoice-response.md) + +## Example Usage + +```java +int subscriptionId = 222; +String uid = "uid0"; +UpdateInvoiceRequest body = new UpdateInvoiceRequest.Builder( + new UpdateInvoice.Builder() + .netTerms(30) + .memo("Updated memo") + .build() +) +.build(); + +try { + InvoiceResponse result = invoicesController.updateInvoice(subscriptionId, uid, body); + System.out.println(result); +} catch (ErrorListResponseException e) { + e.printStackTrace(); +} catch (ErrorArrayMapResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# Delete Invoice + +Deletes an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be deleted.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be deleted through this endpoint and the request returns a `422` error. Issued invoices should be voided instead. If the invoice does not belong to the provided subscription, a `404` error is returned. + +A successful deletion returns a `204 No Content` response and the invoice is permanently removed. + +```java +Void deleteInvoice( + final int subscriptionId, + final String uid) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription. | +| `uid` | `String` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | + +## Response Type + +**204**: No Content + +`void` + +## Example Usage + +```java +int subscriptionId = 222; +String uid = "uid0"; + +try { + invoicesController.deleteInvoice(subscriptionId, uid); +} catch (ErrorListResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + # Send Invoice -This endpoint allows for invoices to be programmatically delivered via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. +Sends an invoice to the customer via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. **File Attachments**: You can attach files to invoice emails using `attachment_urls[]` parameter by providing URLs to the files you want to attach. When using attachments, the request must use `multipart/form-data` content type. Max 10 files, 10MB per file. @@ -2896,7 +3033,7 @@ try { # Preview Customer Information Changes -Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. +Previews the effect of customer information changes on an open invoice. Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -2999,7 +3136,7 @@ try { # Update Customer Information -This endpoint updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. +Updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -3237,7 +3374,7 @@ try { # Issue Invoice -This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. +Issues an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. You cannot issue a pending child invoice that was created for a member subscription in a group. diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 9a97e2c3..14d963b3 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -19,15 +19,13 @@ OffersController offersController = client.getOffersController(); # Create Offer -Creates an offer within your Advanced Billing site. - -## Documentation +Creates an offer within your site. Offers allow you to package complicated combinations of products, components and coupons into a convenient package which can then be subscribed to just like products. Once an offer is defined it can be used as an alternative to the product when creating subscriptions. -Full documentation on how to use offers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview). +For more information, see [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview) in the product documentation. ## Using a Product Price Point diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 59d3f33a..1ff7123d 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -141,7 +141,7 @@ try { # List Payment Profiles -Returns all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. +Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint returns an empty array. ```java List listPaymentProfiles( @@ -477,7 +477,7 @@ try { Deletes an unused payment profile. -If the payment profile is in use by one or more subscriptions or groups, a 422 and error message will be returned. +If the payment profile is in use by one or more subscriptions or groups, an error message is returned. ```java Void deleteUnusedPaymentProfile( @@ -526,9 +526,9 @@ try { Deletes a payment profile belonging to the customer on the subscription. -+ If the customer has multiple subscriptions, the payment profile will be removed from all of them. +If the customer has multiple subscriptions, the payment profile is removed from all of them. -+ If you delete the default payment profile for a subscription, you will need to specify another payment profile to be the default through the api, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present). +If you delete the default payment profile for a subscription, you need to specify another payment profile to be the default through the API, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present). ```java Void deleteSubscriptionsPaymentProfile( @@ -779,7 +779,7 @@ try { # Change Subscription Group Default Payment Profile -This will change the default payment profile on the subscription group to the existing payment profile with the id specified. +Changes the default payment profile on the subscription group to the existing payment profile with the specified ID. You must elect to change the existing payment profile to a new payment profile ID in order to receive a satisfactory response from this endpoint. @@ -862,7 +862,7 @@ try { # Read One Time Token -One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. +Returns the one-time token data, including credit card or ACH details, associated with the provided token ID. One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. You can use One Time Tokens while creating a subscription or payment profile instead of passing all bank account or credit card data directly to a given API endpoint. @@ -913,7 +913,7 @@ try { # Send Request Update Payment Email -You can send a "request payment update" email to the customer associated with the subscription. +Sends a "request payment update" email to the customer associated with the subscription. If you attempt to send a "request payment update" email more than five times within a 30-minute period, you will receive a `422` response with an error message in the body. This error message will indicate that the request has been rejected due to excessive attempts, and will provide instructions on how to resubmit the request. diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 3654599b..ca901efa 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -176,7 +176,7 @@ try { # Create Product Family -Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components, and coupons. +Creates a Product Family within your site. Create a Product Family to act as a container for your products, components, and coupons. Full documentation on how Product Families operate within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). @@ -209,6 +209,7 @@ CreateProductFamilyRequest body = new CreateProductFamilyRequest.Builder( "Acme Projects" ) .description("Amazing project management tool") + .surcharging(false) .build() ) .build(); @@ -232,7 +233,8 @@ try { "name": "Acme Projects", "description": "Amazing project management tool", "handle": "acme-projects", - "accounting_code": null + "accounting_code": null, + "surcharging": false } } ``` @@ -246,7 +248,7 @@ try { # List Product Families -Returns a list of Product Families for a site. +Lists Product Families for a site. ```java List listProductFamilies( @@ -295,6 +297,7 @@ try { "description": null, "handle": "acme-projects", "accounting_code": null, + "surcharging": false, "created_at": "2013-02-20T15:05:51-07:00", "updated_at": "2013-02-20T15:05:51-07:00", "archived_at": null @@ -307,6 +310,7 @@ try { "description": "Another family.", "handle": "bat-family", "accounting_code": null, + "surcharging": true, "created_at": "2014-04-16T12:41:13-06:00", "updated_at": "2014-04-16T12:41:13-06:00", "archived_at": "2024-11-05T09:30:00-07:00" @@ -366,6 +370,7 @@ try { "description": "", "handle": "billing-plans", "accounting_code": null, + "surcharging": false, "archived_at": null } } diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index be0503e3..f3f124c0 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -301,7 +301,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `productId` | [`ReadProductPricePointProductId`](../../doc/models/containers/read-product-price-point-product-id.md) | Template, Required | This is a container for one-of cases. | | `pricePointId` | [`ReadProductPricePointPricePointId`](../../doc/models/containers/read-product-price-point-price-point-id.md) | Template, Required | This is a container for one-of cases. | -| `currencyPrices` | `Boolean` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | +| `currencyPrices` | `Boolean` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | ## Response Type diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 6ef2d76e..9cff91a0 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -20,11 +20,13 @@ ProductsController productsController = client.getProductsController(); # Create Product -Creates a product in your Advanced Billing site. +Creates a product in your site. -See the following product documentation for more information: +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, the `auto_create_signup_page` parameter is not supported. If `auto_create_signup_page` is included (with any value) an error is returned. -+ [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) +For more information, see: + ++ [Products Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations) ```java diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 92e9a016..7b416af0 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -24,7 +24,7 @@ ProformaInvoicesController proformaInvoicesController = client.getProformaInvoic # Create Consolidated Proforma Invoice -Creates a consolidated proforma invoice asynchronously. It will return a 201 with no message, or a 422 with any errors. To find and view the new consolidated proforma invoice, you may poll the subscription group listing for proforma invoices; only one consolidated proforma invoice may be created per group at a time. +Creates a consolidated proforma invoice asynchronously. To find and view the new consolidated proforma invoice, you can poll the subscription group listing for proforma invoices; only one consolidated proforma invoice can be created per group at a time. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. @@ -408,7 +408,7 @@ try { # Preview Proforma Invoice -Returns a preview of the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. +Previews the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. The preview endpoint is subject to all the same conditions as the proforma invoice endpoint. For example, previews are only available on the Relationship Invoicing architecture, and previews cannot be made for end-of-life subscriptions. diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 453e589e..37633322 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -21,21 +21,11 @@ ReasonCodesController reasonCodesController = client.getReasonCodesController(); Creates a reason code for a given site. -# Reason Codes Intro - Reason Codes are a way to gain a high-level view of why your customers are cancelling the subscription to your product or service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your subscribers decide to cancel their subscription, learn why they decided to cancel. -## Reason Code Documentation - -Full documentation on how Reason Codes operate within Advanced Billing can be located under the following links. - -[Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes) - -## Create Reason Code - -This method gives a merchant the option to create reason codes for a given site. +For more information, see [Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes). ```java ReasonCodeResponse createReasonCode( diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index b6118587..9c03dc9b 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -13,13 +13,7 @@ ReferralCodesController referralCodesController = client.getReferralCodesControl Validates whether a referral code is valid and applicable within your site. This method is useful for validating referral codes that are entered by a customer. -## Referrals Documentation - -Full documentation on how to use the referrals feature in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referrals). - -## Server Response - -If the referral code is valid the status code will be `200` and the referral code will be returned. If the referral code is invalid, a `404` response will be returned. +For more information, see [Understanding Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Understanding-Referrals) in the product documentation. ```java ReferralValidationResponse validateReferralCode( diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index d1c78cd8..58919c27 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -25,7 +25,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```java List listSalesCommissionSettings( @@ -104,7 +104,7 @@ try { # List Sales Reps -Returns a sales rep list with details. +Lists sales reps with details. ## Modified Authentication Process @@ -112,7 +112,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```java List listSalesReps( @@ -248,7 +248,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```java SaleRep readSalesRep( diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 7f76bff0..d69b7adc 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -19,20 +19,19 @@ SitesController sitesController = client.getSitesController(); Retrieves site data. -Full documentation on Sites in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). - -Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint documentation. +For more information, see [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) in the product documentation. Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint. #### Relationship invoicing enabled -If the site has RI enabled then you will see more settings like: +If the site has Relationship invoicing enabled, additional properties are returned in the response: - "customer_hierarchy_enabled": true, - "whopays_enabled": true, - "whopays_default_payer": "self" +``` +"customer_hierarchy_enabled": true, +"whopays_enabled": true, +"whopays_default_payer": "self" +``` -You can read more about these settings here: -[Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays) +For more information, see [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). ```java SiteResponse readSite() @@ -153,7 +152,7 @@ try { # List Chargify Js Public Keys -Returns public keys used for Maxio.js (formerly Chargify.js). +Lists public keys used for Maxio.js (formerly Chargify.js). ```java ListPublicKeysResponse listChargifyJsPublicKeys( diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 3dcaeea7..8d21e6f6 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -588,7 +588,7 @@ try { # List Allocations -Returns the 50 most recent Allocations, ordered by most recent first. +Lists the 50 most recent Allocations, ordered by most recent first. ## On/Off Components @@ -1265,7 +1265,7 @@ try { # List Usages -Returns a list of usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. +Lists usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. This endpoint is not compatible with quantity-based components. @@ -1361,13 +1361,13 @@ try { Activates an event-based component for a single subscription. -In order to bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. +To bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. -Learn more about the role of activation in the [Events-Based Billing docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes Advanced Billing to bill for events when the subscription is renewed. +Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes billing for events when the subscription is renewed. -*Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal.* +Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal. ```java Void activateEventBasedComponent( @@ -1478,21 +1478,15 @@ try { Records a single event for Events-Based Billing. -## Documentation - Events-Based Billing is an evolved form of metered billing that is based on data-rich events streamed in real-time from your system to Advanced Billing. These events can then be transformed, enriched, or analyzed to form the computed totals of usage charges billed to your customers. This API allows you to stream events into the Advanced Billing data ingestion engine. -Learn more about the feature in general in the [Events-Based Billing help docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). - -## Record Event - -Use this endpoint to record a single event. +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -*Note: this endpoint differs from the standard Chargify API endpoints in that the URL subdomain will be `events` and your site subdomain will be included in the URL path. For example:* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. For example: ``` https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle @@ -1514,7 +1508,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `apiHandle` | `String` | Template, Required | Identifies the Stream for which the event should be published. | -| `storeUid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | +| `storeUid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`EBBEvent`](../../doc/models/ebb-event.md) | Body, Optional | - | ## Server @@ -1550,7 +1544,7 @@ try { Records a collection of events. -*Note: this endpoint differs from the standard Chargify API endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. @@ -1570,7 +1564,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `apiHandle` | `String` | Template, Required | Identifies the Stream for which the events should be published. | -| `storeUid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | +| `storeUid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`List`](../../doc/models/ebb-event.md) | Body, Optional | - | ## Server diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index a8ae77e4..b930ef42 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -180,7 +180,7 @@ try { # List Subscription Groups -Returns an array of subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. +Lists subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. #### Account Balance Information @@ -332,9 +332,9 @@ try { "current_billing_amount_in_cents": 11500, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { @@ -495,7 +495,7 @@ try { Finds the subscription group associated with a subscription. -If the subscription is not in a group, the endpoint will return a 404 code. +If the subscription is not in a group, this endpoint returns an error. ```java FullSubscriptionGroupResponse findSubscriptionGroup( @@ -550,9 +550,9 @@ try { "cancel_at_end_of_period": false, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { @@ -581,7 +581,7 @@ try { # Add Subscription to Group -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add existing subscriptions to subscription groups. +Adds an existing subscription to a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add existing subscriptions to subscription groups. Passing `group` parameters with a `target` containing a `type` and optional `id` is all that's needed. When the `target` parameter specifies a `"customer"` or `"subscription"` that is already part of a hierarchy, the subscription will become a member of the customer's subscription group. If the target customer or subscription is not part of a subscription group, a new group will be created and the subscription will become part of the group with the specified target customer set as the responsible payer for the group's subscriptions. @@ -672,7 +672,7 @@ try { # Remove Subscription from Group -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group. +Removes an existing subscription from a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group. ```java Void removeSubscriptionFromGroup( diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index 49d1fdf7..db202492 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -21,13 +21,11 @@ SubscriptionNotesController subscriptionNotesController = client.getSubscription Creates a note for a subscription. -## How to Use Subscription Notes - Notes allow you to record information about a particular Subscription in a free text format. -If you have structured data such as birth date, color, etc., consider using Metadata instead. +If you have structured data such as birth date, color, etc., consider using [Metadata](../../doc/controllers/custom-fields.md#create-metadata) instead. -Full documentation on how to use Notes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscription-Summary-Overview). +For more information, see [Adding Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understanding-the-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) in the product documentation. ```java SubscriptionNoteResponse createSubscriptionNote( diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index d3d1d536..8199166f 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -18,17 +18,15 @@ SubscriptionProductsController subscriptionProductsController = client.getSubscr Migrates a subscription to a different product. -In order to create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You may also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed the subscription will be moved to the products default price point. The response will be the updated subscription. +To create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You can also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed, the subscription is moved to the product's default price point. The response is the updated subscription. ## Valid Subscriptions -Subscriptions should be in the `active` or `trialing` state in order to be migrated. +Subscriptions should be in the `active` or `trialing` state to be migrated. (For backwards compatibility reasons, it is possible to migrate a subscription that is in the `trial_ended` state via the API, however this is not recommended. Since `trial_ended` is an end-of-life state, the subscription should be canceled, the product changed, and then the subscription can be reactivated.) -## Migrations Documentation - -Full documentation on how to record Migrations in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Migration-to-Advanced-Billing). +For more information, see [Product Changes and Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). ## Failed Migrations diff --git a/doc/controllers/subscription-renewals.md b/doc/controllers/subscription-renewals.md index 9e1888ec..55093424 100644 --- a/doc/controllers/subscription-renewals.md +++ b/doc/controllers/subscription-renewals.md @@ -591,7 +591,7 @@ try { # Unpublish Scheduled Renewal Configuration -Returns a scheduled renewal configuration to an editable state. +Restores a scheduled renewal configuration to an editable state. ```java ScheduledRenewalConfigurationResponse unpublishScheduledRenewalConfiguration( @@ -761,6 +761,8 @@ try { Adds product and component line items to the scheduled renewal. +If your site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```java ScheduledRenewalConfigurationItemResponse createScheduledRenewalConfigurationItem( final int subscriptionId, @@ -860,6 +862,8 @@ try { Updates an existing configuration item’s pricing and quantity. +If you site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```java ScheduledRenewalConfigurationItemResponse updateScheduledRenewalConfigurationItem( final int subscriptionId, diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 3fb2446d..e64d5647 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -576,7 +576,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | ## Response Type @@ -745,7 +745,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | ## Response Type @@ -1391,26 +1391,26 @@ try { Previews a subscription’s next renewal assessment. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. -The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Optional Component Fields -This endpoint is particularly useful due to the fact that it will return the computed billing amount for the base product and the components which are in use by a subscriber. +This endpoint is particularly useful because it returns the computed billing amount for the base product and the components which are in use by a subscriber. -By default, the preview will include billing details for all components _at their **current** quantities_. This means: +By default, the preview includes billing details for all components _at their **current** quantities_. This means: * Current `allocated_quantity` for quantity-based components * Current enabled/disabled status for on/off components * Current metered usage `unit_balance` for metered components * Current metric quantity value for events recorded thus far for events-based components -In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. We do not predict end-of-period values for components, so metered or events-based usage may be less than it will eventually be at the end of the period. +In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. End-of-period values for components are not predicted, so metered or events-based usage may be less than it will eventually be at the end of the period. -Optionally, **you may provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. +Optionally, **you can provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. -## Subscription Side Effects +## Preview Behavior -You can request a `POST` to obtain this data from the endpoint without any side effects. This method allows you to preview data, but does not log any changes against a subscription. +Sending a `POST` request to this endpoint returns preview data without modifying the subscription. This method previews data, but does not log any changes against a subscription. ```java RenewalPreviewResponse previewRenewal( diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 0422b94f..37e59088 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -34,6 +34,48 @@ Identify an existing customer with `customer_id` or `customer_reference`. Option Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating subscriptions. +## List vs Sales Pricing + +When a subscription uses custom pricing as the sales price, you can optionally provide a list price for any item. If omitted, the list price defaults to the sales price. The difference between the list price and sales price is used to calculate implicit discounts, which appear on Invoices and in reporting. List price can also support revenue allocations in [Advanced Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-and-Configure-RevenueBooks). + +If your site has list pricing enabled, the API accepts `custom_price.list_price_point_id` for custom pricing, validates and persists it, and returns list price metadata in subscription responses. If list pricing is disabled, this input is ignored and related response fields are omitted. + +When list pricing is enabled: + +- Subscription → Product `product_price_point_list_price_point_id` (integer) +- `product_price_point_list_price_point_handle` (string) +- Subscription Components (when components are included in the response, such as with subscriptions built from components or component serialization paths) `component_id` (integer) +- `price_point_id` (integer) +- `list_price_point_id` (integer) + +When list pricing is disabled: + +- Subscription → Product `product_price_point_list_price_point_id`: omitted +- `product_price_point_list_price_point_handle`: omitted +- Subscription Components `list_price_point_id`: omitted + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. + +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) +- a configured metered component + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Payment information + +Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile](../../doc/controllers/payment-profiles.md#create-payment-profile) endpoint for details on payment parameters. See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. ## Payment information @@ -254,7 +296,9 @@ try { # List Subscriptions -Returns an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. +Lists subscriptions for a site. Use the query string filters and pagination to control responses from the server. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. ## Search for a subscription @@ -291,10 +335,6 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) ListSubscriptionsInput listSubscriptionsInput = new ListSubscriptionsInput.Builder() .page(1) .perPage(50) - .startDate(DateTimeHelper.fromSimpleDate("2022-07-01")) - .endDate(DateTimeHelper.fromSimpleDate("2022-08-01")) - .startDatetime(DateTimeHelper.fromRfc8601DateTime("2022-07-01 09:00:05")) - .endDatetime(DateTimeHelper.fromRfc8601DateTime("2022-08-01 10:00:05")) .sort(SubscriptionSort.SIGNUP_DATE) .include(Arrays.asList( SubscriptionListInclude.SELF_SERVICE_PAGE_TOKEN @@ -360,7 +400,9 @@ The server response will not return data under the key/value pair of `next_billi For a subscription using Calendar Billing, setting the next billing date is a bit different. Send the `snap_day` attribute to change the calendar billing date for **a subscription using a product eligible for calendar billing**. -> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The `snap_day` will reset to null on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. +> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately READ/GET the subscription data, it will still contain the original `snap_day`. The `snap_day` will be reset to `null` on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, `product`, `product_price_point_id`, and `product_price_point_type` are returned as `null`. ```java SubscriptionResponse updateSubscription( @@ -528,6 +570,8 @@ try { Retrieves subscription details. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ## Self-Service Page token Self-Service Page token for the subscription is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. @@ -834,7 +878,7 @@ try { Purges an individual subscription for sites in test mode. -Provide the subscription ID in the url. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` +Provide the subscription ID in the URL. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` If you need to remove subscriptions from a live site, contact support to discuss your use case. @@ -970,27 +1014,43 @@ Previews a subscription by POSTing the same JSON or XML as for a subscription cr The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. -A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. +This endpoint does not create a subscription; it is meant to serve as a prediction. + +For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). -For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. + +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. ## Taxable Subscriptions -This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the following conditions must be met: +This endpoint previews taxes applicable to a purchase. For taxes to be previewed, the following conditions must be met: + Taxes must be configured on the subscription + The preview must be for the purchase of a taxable product or component, or combination of the two. -+ The subscription payload must contain a full billing or shipping address in order to calculate tax ++ The subscription payload must contain a full billing or shipping address to calculate tax -For more information about creating taxable previews, see our documentation guide on how to create [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) +For more information about creating taxable previews, see [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). -You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored in Advanced Billing. The billing address and the credit card information are stored together within the payment profile object. Also, you may not send a billing address to Advanced Billing without payment profile information, as the address is stored on the card. +You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored. The billing address and the credit card information are stored together within the payment profile object. Also, you cannot send a billing address without payment profile information, as the address is stored on the card. You can pass shipping and billing addresses and still decide not to calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions -If you'd like to calculate subscriptions that do not include tax you may leave off the billing information. +If you'd like to calculate subscriptions that do not include tax, you can leave off the billing information. ```java SubscriptionPreviewResponse previewSubscription( @@ -1371,7 +1431,7 @@ try { Removes a coupon from an existing subscription. -For more information on the expected behavior of removing a coupon from a subscription, see our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) +For more information on the expected behavior of removing a coupon from a subscription, see [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon). ```java String removeCouponFromSubscription( @@ -1426,16 +1486,14 @@ try { # Activate Subscription -Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group may not be activated immediately. - -For details on how the activation works, and how to activate subscriptions through the application, see [activation](#). +Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group cannot be activated immediately. The `revert_on_failure` parameter controls the behavior upon activation failure. -- If set to `true` and something goes wrong i.e. payment fails, then Advanced Billing will not change the subscription's state. The subscription’s billing period will also remain the same. -- If set to `false` and something goes wrong i.e. payment fails, then Advanced Billing will continue through with the activation and enter an end of life state. For trialing subscriptions, that will either be trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that will always be canceled. +- If set to `true` and something goes wrong i.e. payment fails, the subscription's state does not change. The subscription’s billing period also remains the same. +- If set to `false` and something goes wrong i.e. payment fails, the activation continues and enters an end of life state. For trialing subscriptions, that is either trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that is always canceled. -The default activation failure behavior can be configured per activation attempt, or you may set a default value under Config > Settings > Subscription Activation Settings. +The default activation failure behavior can be configured per activation attempt, or you can set a default value under Config > Settings > Subscription Activation Settings. ## Activation Scenarios @@ -1467,8 +1525,8 @@ The default activation failure behavior can be configured per activation attempt ### Activate Trialing subscription -You can read more about the behavior of trialing subscriptions [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). -When the `revert_on_failure` parameter is set to `true`, the subscription's state will remain as Trialing, we will void the invoice from activation and return any prepayments and credits applied to the invoice back to the subscription. +For more information about the behavior of trialing subscriptions, see [Trialing Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). +When the `revert_on_failure` parameter is set to `true`, the subscription's state remains Trialing; the invoice from activation is voided, and any prepayments and credits applied to the invoice are returned to the subscription. ```java SubscriptionResponse activateSubscription( diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index e1f909b2..01252e30 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -74,7 +74,7 @@ try { "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Pookie&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=pookie999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Pookie&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", + "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Alan&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=alan999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Alan&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", "signature": "7c606ec4628ce75ec46e284097ce163a", "signature_hmac_sha_256": "40f25e83dd324508bb2149e3e525821922fb210535ebfbfa81e7ab951996b41d" } @@ -90,7 +90,7 @@ try { "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=pookie999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Pookie&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", + "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=alan999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Alan&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", "signature": "fbcf2f6be579f9658cff90c4373e0ca2", "signature_hmac_sha_256": "db96654f5456c5460062feb944ac8bb1418f9d181ae04a8ed982fe9ffdca8de1" } @@ -220,7 +220,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | ## Response Type @@ -281,7 +281,7 @@ try { # List Endpoints -Returns created endpoints for a site. +Lists endpoints configured for a site. ```java List listEndpoints() @@ -361,7 +361,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `endpointId` | `int` | Template, Required | The Advanced Billing id for the endpoint that should be updated | -| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | ## Response Type diff --git a/doc/models/account-balance.md b/doc/models/account-balance.md index 073a056c..ccf9dd23 100644 --- a/doc/models/account-balance.md +++ b/doc/models/account-balance.md @@ -13,13 +13,15 @@ | `AutomaticBalanceInCents` | `Long` | Optional | The automatic balance in cents. | Long getAutomaticBalanceInCents() | setAutomaticBalanceInCents(Long automaticBalanceInCents) | | `RemittanceBalanceInCents` | `Long` | Optional | The remittance balance in cents. | Long getRemittanceBalanceInCents() | setRemittanceBalanceInCents(Long remittanceBalanceInCents) | -## Example (as JSON) - -```json -{ - "balance_in_cents": 16, - "automatic_balance_in_cents": 226, - "remittance_balance_in_cents": 62 -} +## Example + +```java +import com.maxio.advancedbilling.models.AccountBalance; + +AccountBalance accountBalance = new AccountBalance.Builder() + .balanceInCents(242L) + .automaticBalanceInCents(0L) + .remittanceBalanceInCents(32L) + .build(); ``` diff --git a/doc/models/account-balances.md b/doc/models/account-balances.md index 912d7cb3..95db2793 100644 --- a/doc/models/account-balances.md +++ b/doc/models/account-balances.md @@ -9,41 +9,44 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `OpenInvoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | AccountBalance getOpenInvoices() | setOpenInvoices(AccountBalance openInvoices) | -| `PendingInvoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | AccountBalance getPendingInvoices() | setPendingInvoices(AccountBalance pendingInvoices) | +| `OpenInvoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | AccountBalance getOpenInvoices() | setOpenInvoices(AccountBalance openInvoices) | +| `PendingInvoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | AccountBalance getPendingInvoices() | setPendingInvoices(AccountBalance pendingInvoices) | | `PendingDiscounts` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Pending Discount account. | AccountBalance getPendingDiscounts() | setPendingDiscounts(AccountBalance pendingDiscounts) | | `ServiceCredits` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Service Credit account. | AccountBalance getServiceCredits() | setServiceCredits(AccountBalance serviceCredits) | | `Prepayments` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Prepayment account. | AccountBalance getPrepayments() | setPrepayments(AccountBalance prepayments) | -## Example (as JSON) - -```json -{ - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 - }, - "pending_invoices": { - "balance_in_cents": 0, - "automatic_balance_in_cents": 242, - "remittance_balance_in_cents": 46 - }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 - }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 - }, - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.AccountBalance; +import com.maxio.advancedbilling.models.AccountBalances; + +AccountBalances accountBalances = new AccountBalances.Builder() + .openInvoices(new AccountBalance.Builder() + .balanceInCents(40L) + .automaticBalanceInCents(202L) + .remittanceBalanceInCents(170L) + .build()) + .pendingInvoices(new AccountBalance.Builder() + .balanceInCents(0L) + .automaticBalanceInCents(242L) + .remittanceBalanceInCents(46L) + .build()) + .pendingDiscounts(new AccountBalance.Builder() + .balanceInCents(88L) + .automaticBalanceInCents(154L) + .remittanceBalanceInCents(134L) + .build()) + .serviceCredits(new AccountBalance.Builder() + .balanceInCents(84L) + .automaticBalanceInCents(70L) + .remittanceBalanceInCents(38L) + .build()) + .prepayments(new AccountBalance.Builder() + .balanceInCents(192L) + .automaticBalanceInCents(178L) + .remittanceBalanceInCents(146L) + .build()) + .build(); ``` diff --git a/doc/models/ach-agreement.md b/doc/models/ach-agreement.md index b1a607ef..cb8f7ea0 100644 --- a/doc/models/ach-agreement.md +++ b/doc/models/ach-agreement.md @@ -16,14 +16,16 @@ | `AuthorizerLastName` | `String` | Optional | (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement. | String getAuthorizerLastName() | setAuthorizerLastName(String authorizerLastName) | | `IpAddress` | `String` | Optional | (Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement. | String getIpAddress() | setIpAddress(String ipAddress) | -## Example (as JSON) - -```json -{ - "agreement_terms": "agreement_terms4", - "authorizer_first_name": "authorizer_first_name2", - "authorizer_last_name": "authorizer_last_name2", - "ip_address": "ip_address2" -} +## Example + +```java +import com.maxio.advancedbilling.models.ACHAgreement; + +ACHAgreement aCHAgreement = new ACHAgreement.Builder() + .agreementTerms("agreement_terms4") + .authorizerFirstName("authorizer_first_name2") + .authorizerLastName("authorizer_last_name2") + .ipAddress("ip_address2") + .build(); ``` diff --git a/doc/models/activate-event-based-component.md b/doc/models/activate-event-based-component.md index 70c1d433..16bf9455 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -13,33 +13,60 @@ | `BillingSchedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | BillingSchedule getBillingSchedule() | setBillingSchedule(BillingSchedule billingSchedule) | | `CustomPrice` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ComponentCustomPrice getCustomPrice() | setCustomPrice(ComponentCustomPrice customPrice) | -## Example (as JSON) - -```json -{ - "price_point_id": 44, - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ActivateEventBasedComponent; +import com.maxio.advancedbilling.models.BillingSchedule; +import com.maxio.advancedbilling.models.ComponentCustomPrice; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +ActivateEventBasedComponent activateEventBasedComponent = new ActivateEventBasedComponent.Builder() + .pricePointId(68) + .billingSchedule(new BillingSchedule.Builder() + .initialBillingAt(DateTimeHelper.fromSimpleDate("2016-03-13")) + .build()) + .customPrice(new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(66) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(174) + .build()) + .build(); ``` diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md index 06222000..ee416ac1 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -9,13 +9,15 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `RevertOnFailure` | `Boolean` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end of life state. If this parameter is omitted or `null` is passed it will default to value set in the site settings (default: `true`) | Boolean getRevertOnFailure() | setRevertOnFailure(Boolean revertOnFailure) | +| `RevertOnFailure` | `Boolean` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end-of-life state. If this parameter is omitted or `null` is passed it will default to the value set in the site settings (default: `true`). | Boolean getRevertOnFailure() | setRevertOnFailure(Boolean revertOnFailure) | -## Example (as JSON) +## Example -```json -{ - "revert_on_failure": false -} +```java +import com.maxio.advancedbilling.models.ActivateSubscriptionRequest; + +ActivateSubscriptionRequest activateSubscriptionRequest = new ActivateSubscriptionRequest.Builder() + .revertOnFailure(false) + .build(); ``` diff --git a/doc/models/add-coupons-request.md b/doc/models/add-coupons-request.md index 3279a37c..d4b12f1f 100644 --- a/doc/models/add-coupons-request.md +++ b/doc/models/add-coupons-request.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | --- | --- | | `Codes` | `List` | Optional | - | List getCodes() | setCodes(List codes) | -## Example (as JSON) - -```json -{ - "codes": [ - "codes0", - "codes1" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.AddCouponsRequest; +import java.util.Arrays; + +AddCouponsRequest addCouponsRequest = new AddCouponsRequest.Builder() + .codes(Arrays.asList( + "codes6", + "codes7" + )) + .build(); ``` diff --git a/doc/models/add-subscription-to-a-group.md b/doc/models/add-subscription-to-a-group.md index 1dea9fa4..19427a74 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -11,21 +11,29 @@ | --- | --- | --- | --- | --- | --- | | `Group` | [`GroupSettings`](../../doc/models/group-settings.md) | Optional | - | GroupSettings getGroup() | setGroup(GroupSettings group) | -## Example (as JSON) - -```json -{ - "group": { - "target": { - "type": "parent", - "id": 236 - }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.AddSubscriptionToAGroup; +import com.maxio.advancedbilling.models.GroupBilling; +import com.maxio.advancedbilling.models.GroupSettings; +import com.maxio.advancedbilling.models.GroupTarget; +import com.maxio.advancedbilling.models.GroupTargetType; + +AddSubscriptionToAGroup addSubscriptionToAGroup = new AddSubscriptionToAGroup.Builder() + .group(new GroupSettings.Builder( + new GroupTarget.Builder( + GroupTargetType.PARENT + ) + .id(236) + .build() + ) + .billing(new GroupBilling.Builder() + .accrue(false) + .alignDate(false) + .prorate(false) + .build()) + .build()) + .build(); ``` diff --git a/doc/models/address-change.md b/doc/models/address-change.md index 947fc099..bd01b0f4 100644 --- a/doc/models/address-change.md +++ b/doc/models/address-change.md @@ -12,24 +12,28 @@ | `Before` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | InvoiceAddress getBefore() | setBefore(InvoiceAddress before) | | `After` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | InvoiceAddress getAfter() | setAfter(InvoiceAddress after) | -## Example (as JSON) - -```json -{ - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.AddressChange; +import com.maxio.advancedbilling.models.InvoiceAddress; + +AddressChange addressChange = new AddressChange.Builder( + new InvoiceAddress.Builder() + .street("street0") + .line2("line24") + .city("city0") + .state("state6") + .zip("zip4") + .build(), + new InvoiceAddress.Builder() + .street("street2") + .line2("line26") + .city("city8") + .state("state2") + .zip("zip4") + .build() +) +.build(); ``` diff --git a/doc/models/agreement-acceptance.md b/doc/models/agreement-acceptance.md index ca685a41..2c814f77 100644 --- a/doc/models/agreement-acceptance.md +++ b/doc/models/agreement-acceptance.md @@ -12,21 +12,23 @@ Required when creating a subscription with Maxio Payments. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `IpAddress` | `String` | Optional | Required when providing agreement acceptance params. | String getIpAddress() | setIpAddress(String ipAddress) | -| `TermsUrl` | `String` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. | String getTermsUrl() | setTermsUrl(String termsUrl) | +| `TermsUrl` | `String` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or privacy_policy_url is required when providing agreement_acceptance params. | String getTermsUrl() | setTermsUrl(String termsUrl) | | `PrivacyPolicyUrl` | `String` | Optional | - | String getPrivacyPolicyUrl() | setPrivacyPolicyUrl(String privacyPolicyUrl) | | `ReturnRefundPolicyUrl` | `String` | Optional | - | String getReturnRefundPolicyUrl() | setReturnRefundPolicyUrl(String returnRefundPolicyUrl) | | `DeliveryPolicyUrl` | `String` | Optional | - | String getDeliveryPolicyUrl() | setDeliveryPolicyUrl(String deliveryPolicyUrl) | | `SecureCheckoutPolicyUrl` | `String` | Optional | - | String getSecureCheckoutPolicyUrl() | setSecureCheckoutPolicyUrl(String secureCheckoutPolicyUrl) | -## Example (as JSON) +## Example -```json -{ - "ip_address": "ip_address2", - "terms_url": "terms_url0", - "privacy_policy_url": "privacy_policy_url0", - "return_refund_policy_url": "return_refund_policy_url4", - "delivery_policy_url": "delivery_policy_url8" -} +```java +import com.maxio.advancedbilling.models.AgreementAcceptance; + +AgreementAcceptance agreementAcceptance = new AgreementAcceptance.Builder() + .ipAddress("ip_address8") + .termsUrl("terms_url6") + .privacyPolicyUrl("privacy_policy_url4") + .returnRefundPolicyUrl("return_refund_policy_url0") + .deliveryPolicyUrl("delivery_policy_url4") + .build(); ``` diff --git a/doc/models/all-vaults.md b/doc/models/all-vaults.md index 5e5e19d0..eceba6af 100644 --- a/doc/models/all-vaults.md +++ b/doc/models/all-vaults.md @@ -46,3 +46,11 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```java +import com.maxio.advancedbilling.models.AllVaults; + +AllVaults allVaults = AllVaults.EWAY_RAPID_STD; +``` + diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index 2a95318a..9f2d7390 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -15,35 +15,51 @@ | `AccrueCharge` | `Boolean` | Optional | - | Boolean getAccrueCharge() | setAccrueCharge(Boolean accrueCharge) | | `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | | `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | -| `PaymentCollectionMethod` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription | CollectionMethod getPaymentCollectionMethod() | setPaymentCollectionMethod(CollectionMethod paymentCollectionMethod) | +| `PaymentCollectionMethod` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription. | CollectionMethod getPaymentCollectionMethod() | setPaymentCollectionMethod(CollectionMethod paymentCollectionMethod) | | `InitiateDunning` | `Boolean` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | Boolean getInitiateDunning() | setInitiateDunning(Boolean initiateDunning) | -## Example (as JSON) - -```json -{ - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "allocations": [ - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - }, - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - } - ], - "accrue_charge": false, - "upgrade_charge": "full" -} +## Example + +```java +import com.maxio.advancedbilling.models.AllocateComponents; +import com.maxio.advancedbilling.models.CreateAllocation; +import com.maxio.advancedbilling.models.CreditType; +import java.util.Arrays; + +AllocateComponents allocateComponents = new AllocateComponents.Builder() + .prorationUpgradeScheme("proration_upgrade_scheme8") + .prorationDowngradeScheme("proration_downgrade_scheme6") + .allocations(Arrays.asList( + new CreateAllocation.Builder( + 26.48D + ) + .decimalQuantity("decimal_quantity8") + .previousQuantity(55.5D) + .decimalPreviousQuantity("decimal_previous_quantity2") + .componentId(242) + .memo("memo6") + .build(), + new CreateAllocation.Builder( + 26.48D + ) + .decimalQuantity("decimal_quantity8") + .previousQuantity(55.5D) + .decimalPreviousQuantity("decimal_previous_quantity2") + .componentId(242) + .memo("memo6") + .build(), + new CreateAllocation.Builder( + 26.48D + ) + .decimalQuantity("decimal_quantity8") + .previousQuantity(55.5D) + .decimalPreviousQuantity("decimal_previous_quantity2") + .componentId(242) + .memo("memo6") + .build() + )) + .accrueCharge(false) + .upgradeCharge(CreditType.PRORATED) + .build(); ``` diff --git a/doc/models/allocation-expiration-date.md b/doc/models/allocation-expiration-date.md index 60d8cd94..c0a65f34 100644 --- a/doc/models/allocation-expiration-date.md +++ b/doc/models/allocation-expiration-date.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | --- | --- | | `ExpiresAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getExpiresAt() | setExpiresAt(ZonedDateTime expiresAt) | -## Example (as JSON) +## Example -```json -{ - "expires_at": "2016-03-13T12:52:32.123Z" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AllocationExpirationDate; + +AllocationExpirationDate allocationExpirationDate = new AllocationExpirationDate.Builder() + .expiresAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/allocation-preview-direction.md b/doc/models/allocation-preview-direction.md index 2e124430..96b4e85b 100644 --- a/doc/models/allocation-preview-direction.md +++ b/doc/models/allocation-preview-direction.md @@ -12,3 +12,11 @@ | `UPGRADE` | | `DOWNGRADE` | +## Example + +```java +import com.maxio.advancedbilling.models.AllocationPreviewDirection; + +AllocationPreviewDirection allocationPreviewDirection = AllocationPreviewDirection.UPGRADE; +``` + diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 5db12c03..2a550121 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -21,22 +21,30 @@ | `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | | `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PricePointId` | `Integer` | Optional | - | Integer getPricePointId() | setPricePointId(Integer pricePointId) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `PreviousPricePointId` | `Integer` | Optional | - | Integer getPreviousPricePointId() | setPreviousPricePointId(Integer previousPricePointId) | | `PricePointHandle` | `String` | Optional | - | String getPricePointHandle() | setPricePointHandle(String pricePointHandle) | | `PricePointName` | `String` | Optional | - | String getPricePointName() | setPricePointName(String pricePointName) | | `ComponentHandle` | `String` | Optional | - | String getComponentHandle() | setComponentHandle(String componentHandle) | -## Example (as JSON) - -```json -{ - "component_id": 54, - "subscription_id": 54, - "quantity": 78, - "previous_quantity": 192, - "memo": "memo6" -} +## Example + +```java +import com.maxio.advancedbilling.models.AllocationPreviewItem; +import com.maxio.advancedbilling.models.containers.AllocationPreviewItemPreviousQuantity; +import com.maxio.advancedbilling.models.containers.AllocationPreviewItemQuantity; + +AllocationPreviewItem allocationPreviewItem = new AllocationPreviewItem.Builder() + .componentId(176) + .subscriptionId(176) + .quantity(AllocationPreviewItemQuantity.fromNumber( + 200 + )) + .previousQuantity(AllocationPreviewItemPreviousQuantity.fromNumber( + 30 + )) + .memo("memo8") + .build(); ``` diff --git a/doc/models/allocation-preview-line-item-kind.md b/doc/models/allocation-preview-line-item-kind.md index cc67eef1..1c7d59c5 100644 --- a/doc/models/allocation-preview-line-item-kind.md +++ b/doc/models/allocation-preview-line-item-kind.md @@ -16,3 +16,11 @@ A handle for the line item kind for allocation preview | `COUPON` | | `TAX` | +## Example + +```java +import com.maxio.advancedbilling.models.AllocationPreviewLineItemKind; + +AllocationPreviewLineItemKind allocationPreviewLineItemKind = AllocationPreviewLineItemKind.COUPON; +``` + diff --git a/doc/models/allocation-preview-line-item.md b/doc/models/allocation-preview-line-item.md index 1f41de62..463b45f3 100644 --- a/doc/models/allocation-preview-line-item.md +++ b/doc/models/allocation-preview-line-item.md @@ -17,17 +17,21 @@ | `TaxableAmountInCents` | `Long` | Optional | - | Long getTaxableAmountInCents() | setTaxableAmountInCents(Long taxableAmountInCents) | | `ComponentId` | `Integer` | Optional | - | Integer getComponentId() | setComponentId(Integer componentId) | | `ComponentHandle` | `String` | Optional | - | String getComponentHandle() | setComponentHandle(String componentHandle) | -| `Direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control | AllocationPreviewDirection getDirection() | setDirection(AllocationPreviewDirection direction) | - -## Example (as JSON) - -```json -{ - "transaction_type": "credit", - "kind": "quantity_based_component", - "amount_in_cents": 24, - "memo": "memo6", - "discount_amount_in_cents": 172 -} +| `Direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control. | AllocationPreviewDirection getDirection() | setDirection(AllocationPreviewDirection direction) | + +## Example + +```java +import com.maxio.advancedbilling.models.AllocationPreviewLineItem; +import com.maxio.advancedbilling.models.AllocationPreviewLineItemKind; +import com.maxio.advancedbilling.models.LineItemTransactionType; + +AllocationPreviewLineItem allocationPreviewLineItem = new AllocationPreviewLineItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(AllocationPreviewLineItemKind.QUANTITY_BASED_COMPONENT) + .amountInCents(236L) + .memo("memo6") + .discountAmountInCents(40L) + .build(); ``` diff --git a/doc/models/allocation-preview-response.md b/doc/models/allocation-preview-response.md index 4882962f..fd98e443 100644 --- a/doc/models/allocation-preview-response.md +++ b/doc/models/allocation-preview-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `AllocationPreview` | [`AllocationPreview`](../../doc/models/allocation-preview.md) | Required | - | AllocationPreview getAllocationPreview() | setAllocationPreview(AllocationPreview allocationPreview) | -## Example (as JSON) - -```json -{ - "allocation_preview": { - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 240, - "total_tax_in_cents": 108, - "total_discount_in_cents": 142 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AllocationPreview; +import com.maxio.advancedbilling.models.AllocationPreviewResponse; + +AllocationPreviewResponse allocationPreviewResponse = new AllocationPreviewResponse.Builder( + new AllocationPreview.Builder() + .startDate(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endDate(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .subtotalInCents(240L) + .totalTaxInCents(108L) + .totalDiscountInCents(142L) + .build() +) +.build(); ``` diff --git a/doc/models/allocation-preview.md b/doc/models/allocation-preview.md index 4592c48a..1080ffa8 100644 --- a/doc/models/allocation-preview.md +++ b/doc/models/allocation-preview.md @@ -23,15 +23,18 @@ | `PeriodType` | `String` | Optional | - | String getPeriodType() | setPeriodType(String periodType) | | `ExistingBalanceInCents` | `Long` | Optional | An integer representing the amount of the subscription's current balance | Long getExistingBalanceInCents() | setExistingBalanceInCents(Long existingBalanceInCents) | -## Example (as JSON) - -```json -{ - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 4, - "total_tax_in_cents": 128, - "total_discount_in_cents": 122 -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AllocationPreview; + +AllocationPreview allocationPreview = new AllocationPreview.Builder() + .startDate(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endDate(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .subtotalInCents(140L) + .totalTaxInCents(8L) + .totalDiscountInCents(242L) + .build(); ``` diff --git a/doc/models/allocation-response.md b/doc/models/allocation-response.md index 07caa8b1..cd6b0630 100644 --- a/doc/models/allocation-response.md +++ b/doc/models/allocation-response.md @@ -11,17 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `Allocation` | [`Allocation`](../../doc/models/allocation.md) | Optional | - | Allocation getAllocation() | setAllocation(Allocation allocation) | -## Example (as JSON) - -```json -{ - "allocation": { - "allocation_id": 238, - "component_id": 8, - "component_handle": "component_handle8", - "subscription_id": 8, - "quantity": 32 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Allocation; +import com.maxio.advancedbilling.models.AllocationResponse; +import com.maxio.advancedbilling.models.containers.AllocationQuantity; + +AllocationResponse allocationResponse = new AllocationResponse.Builder() + .allocation(new Allocation.Builder() + .allocationId(238) + .componentId(8) + .componentHandle("component_handle8") + .subscriptionId(8) + .quantity(AllocationQuantity.fromNumber( + 32 + )) + .build()) + .build(); ``` diff --git a/doc/models/allocation-settings.md b/doc/models/allocation-settings.md index acadaa87..86871287 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -13,13 +13,16 @@ | `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `AccrueCharge` | `String` | Optional | Either "true" or "false". | String getAccrueCharge() | setAccrueCharge(String accrueCharge) | -## Example (as JSON) - -```json -{ - "upgrade_charge": "none", - "downgrade_credit": "prorated", - "accrue_charge": "accrue_charge0" -} +## Example + +```java +import com.maxio.advancedbilling.models.AllocationSettings; +import com.maxio.advancedbilling.models.CreditType; + +AllocationSettings allocationSettings = new AllocationSettings.Builder() + .upgradeCharge(CreditType.PRORATED) + .downgradeCredit(CreditType.PRORATED) + .accrueCharge("accrue_charge2") + .build(); ``` diff --git a/doc/models/allocation.md b/doc/models/allocation.md index 6ad0e2ca..d3e784a4 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -9,21 +9,21 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `AllocationId` | `Integer` | Optional | The allocation unique id | Integer getAllocationId() | setAllocationId(Integer allocationId) | -| `ComponentId` | `Integer` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | Integer getComponentId() | setComponentId(Integer componentId) | -| `ComponentHandle` | `String` | Optional | The handle of the component. This references a component that you have created in your Product setup | String getComponentHandle() | setComponentHandle(String componentHandle) | -| `SubscriptionId` | `Integer` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | +| `AllocationId` | `Integer` | Optional | The allocation unique ID | Integer getAllocationId() | setAllocationId(Integer allocationId) | +| `ComponentId` | `Integer` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup. | Integer getComponentId() | setComponentId(Integer componentId) | +| `ComponentHandle` | `String` | Optional | The handle of the component. This references a component that you have created in your Product setup. | String getComponentHandle() | setComponentHandle(String componentHandle) | +| `SubscriptionId` | `Integer` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site. | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `Quantity` | [`AllocationQuantity`](../../doc/models/containers/allocation-quantity.md) | Optional | This is a container for one-of cases. | AllocationQuantity getQuantity() | setQuantity(AllocationQuantity quantity) | | `PreviousQuantity` | [`AllocationPreviousQuantity`](../../doc/models/containers/allocation-previous-quantity.md) | Optional | This is a container for one-of cases. | AllocationPreviousQuantity getPreviousQuantity() | setPreviousQuantity(AllocationPreviousQuantity previousQuantity) | | `Memo` | `String` | Optional | The memo passed when the allocation was created | String getMemo() | setMemo(String memo) | -| `Timestamp` | `ZonedDateTime` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | ZonedDateTime getTimestamp() | setTimestamp(ZonedDateTime timestamp) | +| `Timestamp` | `ZonedDateTime` | Optional | The time that the allocation was recorded, in ISO 8601 format and UTC timezone, e.g., 2012-11-20T22:00:37Z | ZonedDateTime getTimestamp() | setTimestamp(ZonedDateTime timestamp) | | `CreatedAt` | `ZonedDateTime` | Optional | Timestamp indicating when this allocation was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `ProrationUpgradeScheme` | `String` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | String getProrationUpgradeScheme() | setProrationUpgradeScheme(String prorationUpgradeScheme) | | `ProrationDowngradeScheme` | `String` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | String getProrationDowngradeScheme() | setProrationDowngradeScheme(String prorationDowngradeScheme) | | `PricePointId` | `Integer` | Optional | - | Integer getPricePointId() | setPricePointId(Integer pricePointId) | | `PricePointName` | `String` | Optional | - | String getPricePointName() | setPricePointName(String pricePointName) | | `PricePointHandle` | `String` | Optional | - | String getPricePointHandle() | setPricePointHandle(String pricePointHandle) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `PreviousPricePointId` | `Integer` | Optional | - | Integer getPreviousPricePointId() | setPreviousPricePointId(Integer previousPricePointId) | | `AccrueCharge` | `Boolean` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. | Boolean getAccrueCharge() | setAccrueCharge(Boolean accrueCharge) | @@ -35,15 +35,20 @@ | `UsedQuantity` | `Long` | Optional | - | Long getUsedQuantity() | setUsedQuantity(Long usedQuantity) | | `ChargeId` | `Long` | Optional | - | Long getChargeId() | setChargeId(Long chargeId) | -## Example (as JSON) - -```json -{ - "allocation_id": 102, - "component_id": 144, - "component_handle": "component_handle0", - "subscription_id": 144, - "quantity": 168 -} +## Example + +```java +import com.maxio.advancedbilling.models.Allocation; +import com.maxio.advancedbilling.models.containers.AllocationQuantity; + +Allocation allocation = new Allocation.Builder() + .allocationId(238) + .componentId(8) + .componentHandle("component_handle8") + .subscriptionId(8) + .quantity(AllocationQuantity.fromNumber( + 32 + )) + .build(); ``` diff --git a/doc/models/apple-pay-payment-profile.md b/doc/models/apple-pay-payment-profile.md index 29bb4079..3b01cf94 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -12,7 +12,7 @@ | `Id` | `Integer` | Optional | The Chargify-assigned ID of the Apple Pay payment profile. | Integer getId() | setId(Integer id) | | `FirstName` | `String` | Optional | The first name of the Apple Pay account holder | String getFirstName() | setFirstName(String firstName) | | `LastName` | `String` | Optional | The last name of the Apple Pay account holder | String getLastName() | setLastName(String lastName) | -| `CustomerId` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the Apple Pay account belongs | Integer getCustomerId() | setCustomerId(Integer customerId) | +| `CustomerId` | `Integer` | Optional | The Chargify-assigned ID for the customer record to which the Apple Pay account belongs | Integer getCustomerId() | setCustomerId(Integer customerId) | | `CurrentVault` | [`ApplePayVault`](../../doc/models/apple-pay-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | ApplePayVault getCurrentVault() | setCurrentVault(ApplePayVault currentVault) | | `VaultToken` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | String getVaultToken() | setVaultToken(String vaultToken) | | `BillingAddress` | `String` | Optional | The current billing street address for the Apple Pay account | String getBillingAddress() | setBillingAddress(String billingAddress) | @@ -28,16 +28,21 @@ | `CreatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was last updated | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -## Example (as JSON) - -```json -{ - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" -} +## Example + +```java +import com.maxio.advancedbilling.models.ApplePayPaymentProfile; +import com.maxio.advancedbilling.models.ApplePayVault; +import com.maxio.advancedbilling.models.PaymentType; + +ApplePayPaymentProfile applePayPaymentProfile = new ApplePayPaymentProfile.Builder( + PaymentType.APPLE_PAY +) +.id(252) +.firstName("first_name0") +.lastName("last_name8") +.customerId(34) +.currentVault(ApplePayVault.BRAINTREE_BLUE) +.build(); ``` diff --git a/doc/models/apple-pay-vault.md b/doc/models/apple-pay-vault.md index 9e66d7b5..cf371ef4 100644 --- a/doc/models/apple-pay-vault.md +++ b/doc/models/apple-pay-vault.md @@ -13,3 +13,11 @@ The vault that stores the payment profile with the provided vault_token. | --- | | `BRAINTREE_BLUE` | +## Example + +```java +import com.maxio.advancedbilling.models.ApplePayVault; + +ApplePayVault applePayVault = ApplePayVault.BRAINTREE_BLUE; +``` + diff --git a/doc/models/applied-credit-note-data.md b/doc/models/applied-credit-note-data.md index 35c798bc..a904d1e0 100644 --- a/doc/models/applied-credit-note-data.md +++ b/doc/models/applied-credit-note-data.md @@ -12,12 +12,14 @@ | `Uid` | `String` | Optional | The UID of the credit note | String getUid() | setUid(String uid) | | `Number` | `String` | Optional | The number of the credit note | String getNumber() | setNumber(String number) | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "number": "number0" -} +```java +import com.maxio.advancedbilling.models.AppliedCreditNoteData; + +AppliedCreditNoteData appliedCreditNoteData = new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number2") + .build(); ``` diff --git a/doc/models/apply-credit-note-event-data.md b/doc/models/apply-credit-note-event-data.md index a5062151..1a2e13fa 100644 --- a/doc/models/apply-credit-note-event-data.md +++ b/doc/models/apply-credit-note-event-data.md @@ -19,32 +19,42 @@ Example schema for an `apply_credit_note` event | `TransactionTime` | `ZonedDateTime` | Optional | The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | ZonedDateTime getTransactionTime() | setTransactionTime(ZonedDateTime transactionTime) | | `Memo` | `String` | Optional | The credit note memo. | String getMemo() | setMemo(String memo) | | `Role` | `String` | Optional | The role of the credit note (e.g. 'general') | String getRole() | setRole(String role) | -| `ConsolidatedInvoice` | `Boolean` | Optional | Shows whether it was applied to consolidated invoice or not | Boolean getConsolidatedInvoice() | setConsolidatedInvoice(Boolean consolidatedInvoice) | +| `ConsolidatedInvoice` | `Boolean` | Optional | Shows whether it was applied to consolidated invoice or not. | Boolean getConsolidatedInvoice() | setConsolidatedInvoice(Boolean consolidatedInvoice) | | `AppliedCreditNotes` | [`List`](../../doc/models/applied-credit-note-data.md) | Optional | List of credit notes applied to children invoices (if consolidated invoice) | List getAppliedCreditNotes() | setAppliedCreditNotes(List appliedCreditNotes) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "credit_note_number": "credit_note_number4", - "credit_note_uid": "credit_note_uid4", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "role": "role4", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AppliedCreditNoteData; +import com.maxio.advancedbilling.models.ApplyCreditNoteEventData; +import java.util.Arrays; + +ApplyCreditNoteEventData applyCreditNoteEventData = new ApplyCreditNoteEventData.Builder( + "uid0", + "credit_note_number6", + "credit_note_uid4", + "original_amount4", + "applied_amount8" +) +.transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) +.memo("memo4") +.role("role4") +.consolidatedInvoice(false) +.appliedCreditNotes(Arrays.asList( + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build() + )) +.build(); ``` diff --git a/doc/models/apply-credit-note-event.md b/doc/models/apply-credit-note-event.md index 5c91f492..ab11d80d 100644 --- a/doc/models/apply-credit-note-event.md +++ b/doc/models/apply-credit-note-event.md @@ -15,49 +15,59 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.APPLY_CREDIT_NOTE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`ApplyCreditNoteEventData`](../../doc/models/apply-credit-note-event-data.md) | Required | Example schema for an `apply_credit_note` event | ApplyCreditNoteEventData getEventData() | setEventData(ApplyCreditNoteEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_credit_note", - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AppliedCreditNoteData; +import com.maxio.advancedbilling.models.ApplyCreditNoteEvent; +import com.maxio.advancedbilling.models.ApplyCreditNoteEventData; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; +import java.util.Arrays; + +ApplyCreditNoteEvent applyCreditNoteEvent = new ApplyCreditNoteEvent.Builder( + 86L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.APPLY_CREDIT_NOTE, + new ApplyCreditNoteEventData.Builder( + "uid6", + "credit_note_number0", + "credit_note_uid0", + "original_amount0", + "applied_amount2" + ) + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .memo("memo0") + .role("role0") + .consolidatedInvoice(false) + .appliedCreditNotes(Arrays.asList( + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build() + )) + .build() +) +.build(); ``` diff --git a/doc/models/apply-debit-note-event-data.md b/doc/models/apply-debit-note-event-data.md index 77424344..97c68dcd 100644 --- a/doc/models/apply-debit-note-event-data.md +++ b/doc/models/apply-debit-note-event-data.md @@ -18,16 +18,20 @@ Example schema for an `apply_debit_note` event | `Memo` | `String` | Optional | The debit note memo. | String getMemo() | setMemo(String memo) | | `TransactionTime` | `ZonedDateTime` | Optional | The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | ZonedDateTime getTransactionTime() | setTransactionTime(ZonedDateTime transactionTime) | -## Example (as JSON) - -```json -{ - "debit_note_number": "debit_note_number0", - "debit_note_uid": "debit_note_uid6", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "memo": "memo4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ApplyDebitNoteEventData; + +ApplyDebitNoteEventData applyDebitNoteEventData = new ApplyDebitNoteEventData.Builder( + "debit_note_number8", + "debit_note_uid4", + "original_amount2", + "applied_amount0" +) +.memo("memo2") +.transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) +.build(); ``` diff --git a/doc/models/apply-debit-note-event.md b/doc/models/apply-debit-note-event.md index 98b4fac6..9e6e6896 100644 --- a/doc/models/apply-debit-note-event.md +++ b/doc/models/apply-debit-note-event.md @@ -15,32 +15,40 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.APPLY_DEBIT_NOTE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`ApplyDebitNoteEventData`](../../doc/models/apply-debit-note-event-data.md) | Required | Example schema for an `apply_debit_note` event | ApplyDebitNoteEventData getEventData() | setEventData(ApplyDebitNoteEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 164, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_debit_note", - "event_data": { - "debit_note_number": "debit_note_number6", - "debit_note_uid": "debit_note_uid2", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "memo": "memo0", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ApplyDebitNoteEvent; +import com.maxio.advancedbilling.models.ApplyDebitNoteEventData; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; + +ApplyDebitNoteEvent applyDebitNoteEvent = new ApplyDebitNoteEvent.Builder( + 180L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.APPLY_DEBIT_NOTE, + new ApplyDebitNoteEventData.Builder( + "debit_note_number6", + "debit_note_uid2", + "original_amount0", + "applied_amount2" + ) + .memo("memo0") + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() +) +.build(); ``` diff --git a/doc/models/apply-payment-event-data.md b/doc/models/apply-payment-event-data.md index 19f51f37..63cc17e3 100644 --- a/doc/models/apply-payment-event-data.md +++ b/doc/models/apply-payment-event-data.md @@ -23,23 +23,34 @@ Example schema for an `apply_payment` event | `Prepayment` | `Boolean` | Optional | - | Boolean getPrepayment() | setPrepayment(Boolean prepayment) | | `External` | `Boolean` | Optional | - | Boolean getExternal() | setExternal(Boolean external) | -## Example (as JSON) - -```json -{ - "consolidation_level": "child", - "memo": "memo8", - "original_amount": "original_amount8", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "transaction_id": 196, - "parent_invoice_number": 174, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ApplyPaymentEventData; +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.PaymentMethodApplePay; +import com.maxio.advancedbilling.models.containers.InvoiceEventPayment; + +ApplyPaymentEventData applyPaymentEventData = new ApplyPaymentEventData.Builder( + InvoiceConsolidationLevel.CHILD, + "memo0", + "original_amount0", + "applied_amount2", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + InvoiceEventPayment.fromPaymentMethodApplePay( + new PaymentMethodApplePay.Builder( + InvoiceEventPaymentMethod.APPLE_PAY + ) + .build() + ) +) +.transactionId(142) +.parentInvoiceNumber(228) +.remainingPrepaymentAmount("remaining_prepayment_amount4") +.prepayment(false) +.external(false) +.build(); ``` diff --git a/doc/models/apply-payment-event.md b/doc/models/apply-payment-event.md index 6adb25f5..4205d449 100644 --- a/doc/models/apply-payment-event.md +++ b/doc/models/apply-payment-event.md @@ -15,39 +15,54 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.APPLY_PAYMENT` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`ApplyPaymentEventData`](../../doc/models/apply-payment-event-data.md) | Required | Example schema for an `apply_payment` event | ApplyPaymentEventData getEventData() | setEventData(ApplyPaymentEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 234, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_payment", - "event_data": { - "consolidation_level": "child", - "memo": "memo0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "transaction_id": 78, - "parent_invoice_number": 36, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ApplyPaymentEvent; +import com.maxio.advancedbilling.models.ApplyPaymentEventData; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.PaymentMethodApplePay; +import com.maxio.advancedbilling.models.containers.InvoiceEventPayment; + +ApplyPaymentEvent applyPaymentEvent = new ApplyPaymentEvent.Builder( + 112L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.APPLY_PAYMENT, + new ApplyPaymentEventData.Builder( + InvoiceConsolidationLevel.CHILD, + "memo0", + "original_amount0", + "applied_amount2", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + InvoiceEventPayment.fromPaymentMethodApplePay( + new PaymentMethodApplePay.Builder( + InvoiceEventPaymentMethod.APPLE_PAY + ) + .build() + ) + ) + .transactionId(78) + .parentInvoiceNumber(36) + .remainingPrepaymentAmount("remaining_prepayment_amount6") + .prepayment(false) + .external(false) + .build() +) +.build(); ``` diff --git a/doc/models/attribute-error.md b/doc/models/attribute-error.md index 87455701..5e7f411a 100644 --- a/doc/models/attribute-error.md +++ b/doc/models/attribute-error.md @@ -11,14 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `Attribute` | `List` | Required | - | List getAttribute() | setAttribute(List attribute) | -## Example (as JSON) - -```json -{ - "attribute": [ - "attribute6", - "attribute7" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.AttributeError; +import java.util.Arrays; + +AttributeError attributeError = new AttributeError.Builder( + Arrays.asList( + "attribute8", + "attribute7" + ) +) +.build(); ``` diff --git a/doc/models/auto-invite.md b/doc/models/auto-invite.md index c467ad11..eb9a7c7c 100644 --- a/doc/models/auto-invite.md +++ b/doc/models/auto-invite.md @@ -12,3 +12,11 @@ | `NO` | Do not send the invitation email. | | `YES` | Automatically send the invitation email. | +## Example + +```java +import com.maxio.advancedbilling.models.AutoInvite; + +AutoInvite autoInvite = AutoInvite.NO; +``` + diff --git a/doc/models/auto-resume.md b/doc/models/auto-resume.md index ea2f2b91..fcb57e33 100644 --- a/doc/models/auto-resume.md +++ b/doc/models/auto-resume.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | --- | --- | | `AutomaticallyResumeAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getAutomaticallyResumeAt() | setAutomaticallyResumeAt(ZonedDateTime automaticallyResumeAt) | -## Example (as JSON) +## Example -```json -{ - "automatically_resume_at": "2016-03-13T12:52:32.123Z" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AutoResume; + +AutoResume autoResume = new AutoResume.Builder() + .automaticallyResumeAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/available-actions.md b/doc/models/available-actions.md index 01a4a8ec..1ed66c07 100644 --- a/doc/models/available-actions.md +++ b/doc/models/available-actions.md @@ -11,14 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `SendEmail` | [`SendEmail`](../../doc/models/send-email.md) | Optional | - | SendEmail getSendEmail() | setSendEmail(SendEmail sendEmail) | -## Example (as JSON) - -```json -{ - "send_email": { - "can_execute": false, - "url": "url0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.AvailableActions; +import com.maxio.advancedbilling.models.SendEmail; + +AvailableActions availableActions = new AvailableActions.Builder() + .sendEmail(new SendEmail.Builder( + false, + "url0" + ) + .build()) + .build(); ``` diff --git a/doc/models/backport-invoice-event.md b/doc/models/backport-invoice-event.md index b9494849..645c857d 100644 --- a/doc/models/backport-invoice-event.md +++ b/doc/models/backport-invoice-event.md @@ -15,35 +15,41 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.BACKPORT_INVOICE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`Invoice`](../../doc/models/invoice.md) | Required | Example schema for an `backport_invoice` event | Invoice getEventData() | setEventData(Invoice eventData) | -## Example (as JSON) - -```json -{ - "id": 78, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "backport_invoice", - "event_data": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 206, - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BackportInvoiceEvent; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; + +BackportInvoiceEvent backportInvoiceEvent = new BackportInvoiceEvent.Builder( + 210L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.BACKPORT_INVOICE, + new Invoice.Builder() + .id(206L) + .uid("uid6") + .siteId(132) + .customerId(244) + .subscriptionId(60) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build() +) +.build(); ``` diff --git a/doc/models/bank-account-attributes.md b/doc/models/bank-account-attributes.md index 6fc398e1..4dc11149 100644 --- a/doc/models/bank-account-attributes.md +++ b/doc/models/bank-account-attributes.md @@ -11,26 +11,29 @@ | --- | --- | --- | --- | --- | --- | | `ChargifyToken` | `String` | Optional | - | String getChargifyToken() | setChargifyToken(String chargifyToken) | | `BankName` | `String` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | String getBankName() | setBankName(String bankName) | -| `BankRoutingNumber` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | String getBankRoutingNumber() | setBankRoutingNumber(String bankRoutingNumber) | +| `BankRoutingNumber` | `String` | Optional | (Required when creating a subscription with ACH; optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | String getBankRoutingNumber() | setBankRoutingNumber(String bankRoutingNumber) | | `BankAccountNumber` | `String` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | String getBankAccountNumber() | setBankAccountNumber(String bankAccountNumber) | | `BankAccountType` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | BankAccountType getBankAccountType() | setBankAccountType(BankAccountType bankAccountType) | -| `BankBranchCode` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | String getBankBranchCode() | setBankBranchCode(String bankBranchCode) | -| `BankIban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | String getBankIban() | setBankIban(String bankIban) | +| `BankBranchCode` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | String getBankBranchCode() | setBankBranchCode(String bankBranchCode) | +| `BankIban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | String getBankIban() | setBankIban(String bankIban) | | `BankAccountHolderType` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | BankAccountHolderType getBankAccountHolderType() | setBankAccountHolderType(BankAccountHolderType bankAccountHolderType) | | `PaymentType` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | PaymentType getPaymentType() | setPaymentType(PaymentType paymentType) | | `CurrentVault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | BankAccountVault getCurrentVault() | setCurrentVault(BankAccountVault currentVault) | | `VaultToken` | `String` | Optional | - | String getVaultToken() | setVaultToken(String vaultToken) | | `CustomerVaultToken` | `String` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | String getCustomerVaultToken() | setCustomerVaultToken(String customerVaultToken) | -## Example (as JSON) +## Example -```json -{ - "chargify_token": "chargify_token0", - "bank_name": "bank_name2", - "bank_routing_number": "bank_routing_number8", - "bank_account_number": "bank_account_number4", - "bank_account_type": "checking" -} +```java +import com.maxio.advancedbilling.models.BankAccountAttributes; +import com.maxio.advancedbilling.models.BankAccountType; + +BankAccountAttributes bankAccountAttributes = new BankAccountAttributes.Builder() + .chargifyToken("chargify_token0") + .bankName("bank_name2") + .bankRoutingNumber("bank_routing_number8") + .bankAccountNumber("bank_account_number4") + .bankAccountType(BankAccountType.CHECKING) + .build(); ``` diff --git a/doc/models/bank-account-holder-type.md b/doc/models/bank-account-holder-type.md index 129dc3bc..ed650b30 100644 --- a/doc/models/bank-account-holder-type.md +++ b/doc/models/bank-account-holder-type.md @@ -14,3 +14,11 @@ Defaults to personal | `PERSONAL` | | `BUSINESS` | +## Example + +```java +import com.maxio.advancedbilling.models.BankAccountHolderType; + +BankAccountHolderType bankAccountHolderType = BankAccountHolderType.PERSONAL; +``` + diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 8829fecd..30e15b2b 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Id` | `Integer` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer | Integer getId() | setId(Integer id) | +| `Id` | `Integer` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | Integer getId() | setId(Integer id) | | `FirstName` | `String` | Optional | The first name of the bank account holder | String getFirstName() | setFirstName(String firstName) | | `LastName` | `String` | Optional | The last name of the bank account holder | String getLastName() | setLastName(String lastName) | -| `CustomerId` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | Integer getCustomerId() | setCustomerId(Integer customerId) | +| `CustomerId` | `Integer` | Optional | The Chargify-assigned ID for the customer record to which the bank account belongs | Integer getCustomerId() | setCustomerId(Integer customerId) | | `CurrentVault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | BankAccountVault getCurrentVault() | setCurrentVault(BankAccountVault currentVault) | | `VaultToken` | `String` | Optional | The "token" provided by your vault storage for an already stored payment profile | String getVaultToken() | setVaultToken(String vaultToken) | | `BillingAddress` | `String` | Optional | The current billing street address for the bank account | String getBillingAddress() | setBillingAddress(String billingAddress) | @@ -23,28 +23,33 @@ | `CustomerVaultToken` | `String` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | String getCustomerVaultToken() | setCustomerVaultToken(String customerVaultToken) | | `BillingAddress2` | `String` | Optional | The current billing street address, second line, for the bank account | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | | `BankName` | `String` | Optional | The bank where the account resides | String getBankName() | setBankName(String bankName) | -| `MaskedBankRoutingNumber` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account | String getMaskedBankRoutingNumber() | setMaskedBankRoutingNumber(String maskedBankRoutingNumber) | -| `MaskedBankAccountNumber` | `String` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111') | String getMaskedBankAccountNumber() | setMaskedBankAccountNumber(String maskedBankAccountNumber) | +| `MaskedBankRoutingNumber` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. | String getMaskedBankRoutingNumber() | setMaskedBankRoutingNumber(String maskedBankRoutingNumber) | +| `MaskedBankAccountNumber` | `String` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). | String getMaskedBankAccountNumber() | setMaskedBankAccountNumber(String maskedBankAccountNumber) | | `BankAccountType` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | BankAccountType getBankAccountType() | setBankAccountType(BankAccountType bankAccountType) | | `BankAccountHolderType` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | BankAccountHolderType getBankAccountHolderType() | setBankAccountHolderType(BankAccountHolderType bankAccountHolderType) | | `PaymentType` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType.BANK_ACCOUNT` | PaymentType getPaymentType() | setPaymentType(PaymentType paymentType) | -| `Verified` | `Boolean` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account

**Default**: `false` | Boolean getVerified() | setVerified(Boolean verified) | +| `Verified` | `Boolean` | Optional | Denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account.

**Default**: `false` | Boolean getVerified() | setVerified(Boolean verified) | | `SiteGatewaySettingId` | `Integer` | Optional | - | Integer getSiteGatewaySettingId() | setSiteGatewaySettingId(Integer siteGatewaySettingId) | | `GatewayHandle` | `String` | Optional | - | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | | `CreatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was last updated | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -## Example (as JSON) - -```json -{ - "payment_type": "bank_account", - "verified": false, - "id": 188, - "first_name": "first_name6", - "last_name": "last_name4", - "customer_id": 226, - "current_vault": "authorizenet" -} +## Example + +```java +import com.maxio.advancedbilling.models.BankAccountPaymentProfile; +import com.maxio.advancedbilling.models.BankAccountVault; +import com.maxio.advancedbilling.models.PaymentType; + +BankAccountPaymentProfile bankAccountPaymentProfile = new BankAccountPaymentProfile.Builder( + PaymentType.BANK_ACCOUNT +) +.id(16) +.firstName("first_name0") +.lastName("last_name8") +.customerId(54) +.currentVault(BankAccountVault.GOCARDLESS) +.verified(false) +.build(); ``` diff --git a/doc/models/bank-account-response.md b/doc/models/bank-account-response.md index 55607d64..63c4bb53 100644 --- a/doc/models/bank-account-response.md +++ b/doc/models/bank-account-response.md @@ -11,19 +11,26 @@ | --- | --- | --- | --- | --- | --- | | `PaymentProfile` | [`BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Required | - | BankAccountPaymentProfile getPaymentProfile() | setPaymentProfile(BankAccountPaymentProfile paymentProfile) | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "bank_account", - "verified": false, - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "customer_id": 82, - "current_vault": "authorizenet" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.BankAccountPaymentProfile; +import com.maxio.advancedbilling.models.BankAccountResponse; +import com.maxio.advancedbilling.models.BankAccountVault; +import com.maxio.advancedbilling.models.PaymentType; + +BankAccountResponse bankAccountResponse = new BankAccountResponse.Builder( + new BankAccountPaymentProfile.Builder( + PaymentType.BANK_ACCOUNT + ) + .id(44) + .firstName("first_name4") + .lastName("last_name2") + .customerId(82) + .currentVault(BankAccountVault.AUTHORIZENET) + .verified(false) + .build() +) +.build(); ``` diff --git a/doc/models/bank-account-type.md b/doc/models/bank-account-type.md index 86a4b637..dbb37648 100644 --- a/doc/models/bank-account-type.md +++ b/doc/models/bank-account-type.md @@ -14,3 +14,11 @@ Defaults to checking | `CHECKING` | | `SAVINGS` | +## Example + +```java +import com.maxio.advancedbilling.models.BankAccountType; + +BankAccountType bankAccountType = BankAccountType.CHECKING; +``` + diff --git a/doc/models/bank-account-vault.md b/doc/models/bank-account-vault.md index 9ff1b83a..7dd4d127 100644 --- a/doc/models/bank-account-vault.md +++ b/doc/models/bank-account-vault.md @@ -20,3 +20,11 @@ The vault that stores the payment profile with the provided vault_token. Use `bo | `MAXP` | | `STRIPE_CONNECT` | +## Example + +```java +import com.maxio.advancedbilling.models.BankAccountVault; + +BankAccountVault bankAccountVault = BankAccountVault.MAXP; +``` + diff --git a/doc/models/bank-account-verification-request.md b/doc/models/bank-account-verification-request.md index 71a3e493..c5d830c9 100644 --- a/doc/models/bank-account-verification-request.md +++ b/doc/models/bank-account-verification-request.md @@ -11,14 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `BankAccountVerification` | [`BankAccountVerification`](../../doc/models/bank-account-verification.md) | Required | - | BankAccountVerification getBankAccountVerification() | setBankAccountVerification(BankAccountVerification bankAccountVerification) | -## Example (as JSON) - -```json -{ - "bank_account_verification": { - "deposit_1_in_cents": 244, - "deposit_2_in_cents": 6 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.BankAccountVerification; +import com.maxio.advancedbilling.models.BankAccountVerificationRequest; + +BankAccountVerificationRequest bankAccountVerificationRequest = new BankAccountVerificationRequest.Builder( + new BankAccountVerification.Builder() + .deposit1InCents(244L) + .deposit2InCents(6L) + .build() +) +.build(); ``` diff --git a/doc/models/bank-account-verification.md b/doc/models/bank-account-verification.md index 88d625d8..1852eefb 100644 --- a/doc/models/bank-account-verification.md +++ b/doc/models/bank-account-verification.md @@ -12,12 +12,14 @@ | `Deposit1InCents` | `Long` | Optional | - | Long getDeposit1InCents() | setDeposit1InCents(Long deposit1InCents) | | `Deposit2InCents` | `Long` | Optional | - | Long getDeposit2InCents() | setDeposit2InCents(Long deposit2InCents) | -## Example (as JSON) +## Example -```json -{ - "deposit_1_in_cents": 142, - "deposit_2_in_cents": 132 -} +```java +import com.maxio.advancedbilling.models.BankAccountVerification; + +BankAccountVerification bankAccountVerification = new BankAccountVerification.Builder() + .deposit1InCents(248L) + .deposit2InCents(10L) + .build(); ``` diff --git a/doc/models/base-refund-error.md b/doc/models/base-refund-error.md index cd85f80e..2233ed57 100644 --- a/doc/models/base-refund-error.md +++ b/doc/models/base-refund-error.md @@ -11,24 +11,19 @@ | --- | --- | --- | --- | --- | --- | | `Base` | `List` | Optional | - | List getBase() | setBase(List base) | -## Example (as JSON) - -```json -{ - "base": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.ApiHelper; +import com.maxio.advancedbilling.models.BaseRefundError; +import java.io.IOException; +import java.util.Arrays; + +BaseRefundError baseRefundError = new BaseRefundError.Builder() + .base(Arrays.asList( + ApiHelper.deserialize("{\"key1\":\"val1\",\"key2\":\"val2\"}"), + ApiHelper.deserialize("{\"key1\":\"val1\",\"key2\":\"val2\"}") + )) + .build(); ``` diff --git a/doc/models/base-string-error.md b/doc/models/base-string-error.md index 384c3761..93e316ea 100644 --- a/doc/models/base-string-error.md +++ b/doc/models/base-string-error.md @@ -13,13 +13,17 @@ The error is base if it is not directly associated with a single attribute. | --- | --- | --- | --- | --- | --- | | `Base` | `List` | Optional | - | List getBase() | setBase(List base) | -## Example (as JSON) - -```json -{ - "base": [ - "base3" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.BaseStringError; +import java.util.Arrays; + +BaseStringError baseStringError = new BaseStringError.Builder() + .base(Arrays.asList( + "base5", + "base6" + )) + .build(); ``` diff --git a/doc/models/basic-date-field.md b/doc/models/basic-date-field.md index 8bb95917..fbc870de 100644 --- a/doc/models/basic-date-field.md +++ b/doc/models/basic-date-field.md @@ -16,7 +16,9 @@ Allows to filter by `created_at` or `updated_at`. ## Example -``` -updated_at +```java +import com.maxio.advancedbilling.models.BasicDateField; + +BasicDateField basicDateField = BasicDateField.UPDATED_AT; ``` diff --git a/doc/models/batch-job-response.md b/doc/models/batch-job-response.md index 7d47d927..be5f9f2c 100644 --- a/doc/models/batch-job-response.md +++ b/doc/models/batch-job-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Batchjob` | [`BatchJob`](../../doc/models/batch-job.md) | Required | - | BatchJob getBatchjob() | setBatchjob(BatchJob batchjob) | -## Example (as JSON) - -```json -{ - "batchjob": { - "id": 54, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 62, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed4" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BatchJob; +import com.maxio.advancedbilling.models.BatchJobResponse; + +BatchJobResponse batchJobResponse = new BatchJobResponse.Builder( + new BatchJob.Builder() + .id(54) + .finishedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .rowCount(62) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .completed("completed4") + .build() +) +.build(); ``` diff --git a/doc/models/batch-job.md b/doc/models/batch-job.md index 3c9cd840..86f2f274 100644 --- a/doc/models/batch-job.md +++ b/doc/models/batch-job.md @@ -15,15 +15,18 @@ | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `Completed` | `String` | Optional | - | String getCompleted() | setCompleted(String completed) | -## Example (as JSON) - -```json -{ - "id": 246, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 254, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed0" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BatchJob; + +BatchJob batchJob = new BatchJob.Builder() + .id(60) + .finishedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .rowCount(68) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .completed("completed6") + .build(); ``` diff --git a/doc/models/billing-manifest-item.md b/doc/models/billing-manifest-item.md index 29dde84e..5e263b17 100644 --- a/doc/models/billing-manifest-item.md +++ b/doc/models/billing-manifest-item.md @@ -24,15 +24,19 @@ | `PeriodRangeStart` | `String` | Optional | - | String getPeriodRangeStart() | setPeriodRangeStart(String periodRangeStart) | | `PeriodRangeEnd` | `String` | Optional | - | String getPeriodRangeEnd() | setPeriodRangeEnd(String periodRangeEnd) | -## Example (as JSON) - -```json -{ - "transaction_type": "info_transaction", - "kind": "baseline", - "amount_in_cents": 216, - "memo": "memo4", - "discount_amount_in_cents": 236 -} +## Example + +```java +import com.maxio.advancedbilling.models.BillingManifestItem; +import com.maxio.advancedbilling.models.BillingManifestLineItemKind; +import com.maxio.advancedbilling.models.LineItemTransactionType; + +BillingManifestItem billingManifestItem = new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.PAYMENT) + .kind(BillingManifestLineItemKind.TRIAL) + .amountInCents(148L) + .memo("memo0") + .discountAmountInCents(88L) + .build(); ``` diff --git a/doc/models/billing-manifest-line-item-kind.md b/doc/models/billing-manifest-line-item-kind.md index 1f99b4e3..f6149bc3 100644 --- a/doc/models/billing-manifest-line-item-kind.md +++ b/doc/models/billing-manifest-line-item-kind.md @@ -18,3 +18,11 @@ A handle for the billing manifest line item kind | `COMPONENT` | | `TAX` | +## Example + +```java +import com.maxio.advancedbilling.models.BillingManifestLineItemKind; + +BillingManifestLineItemKind billingManifestLineItemKind = BillingManifestLineItemKind.COMPONENT; +``` + diff --git a/doc/models/billing-manifest.md b/doc/models/billing-manifest.md index 389fa58e..f1338801 100644 --- a/doc/models/billing-manifest.md +++ b/doc/models/billing-manifest.md @@ -19,37 +19,29 @@ | `PeriodType` | `String` | Optional | - | String getPeriodType() | setPeriodType(String periodType) | | `ExistingBalanceInCents` | `Long` | Optional | - | Long getExistingBalanceInCents() | setExistingBalanceInCents(Long existingBalanceInCents) | -## Example (as JSON) - -```json -{ - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } - ], - "total_in_cents": 192, - "total_discount_in_cents": 178, - "total_tax_in_cents": 172, - "subtotal_in_cents": 48 -} +## Example + +```java +import com.maxio.advancedbilling.models.BillingManifest; +import com.maxio.advancedbilling.models.BillingManifestItem; +import com.maxio.advancedbilling.models.BillingManifestLineItemKind; +import com.maxio.advancedbilling.models.LineItemTransactionType; +import java.util.Arrays; + +BillingManifest billingManifest = new BillingManifest.Builder() + .lineItems(Arrays.asList( + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build() + )) + .totalInCents(96L) + .totalDiscountInCents(174L) + .totalTaxInCents(76L) + .subtotalInCents(208L) + .build(); ``` diff --git a/doc/models/billing-schedule.md b/doc/models/billing-schedule.md index cbb601d6..84f0cf58 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -13,11 +13,14 @@ Billing schedule settings for component allocations or usages on multi-frequency | --- | --- | --- | --- | --- | --- | | `InitialBillingAt` | `LocalDate` | Optional | Custom start date (ISO 8601 date, YYYY-MM-DD) for the component's first billing period. If omitted or null, billing aligns with the product schedule. If provided, date must be on or after the minimum allowed date for the subscription or component. | LocalDate getInitialBillingAt() | setInitialBillingAt(LocalDate initialBillingAt) | -## Example (as JSON) +## Example -```json -{ - "initial_billing_at": "2026-01-01" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BillingSchedule; + +BillingSchedule billingSchedule = new BillingSchedule.Builder() + .initialBillingAt(DateTimeHelper.fromSimpleDate("2026-01-01")) + .build(); ``` diff --git a/doc/models/breakouts.md b/doc/models/breakouts.md index e2d75e62..20c76274 100644 --- a/doc/models/breakouts.md +++ b/doc/models/breakouts.md @@ -14,14 +14,16 @@ | `UsageAmountInCents` | `Long` | Optional | - | Long getUsageAmountInCents() | setUsageAmountInCents(Long usageAmountInCents) | | `UsageAmountFormatted` | `String` | Optional | - | String getUsageAmountFormatted() | setUsageAmountFormatted(String usageAmountFormatted) | -## Example (as JSON) - -```json -{ - "plan_amount_in_cents": 68, - "plan_amount_formatted": "plan_amount_formatted2", - "usage_amount_in_cents": 176, - "usage_amount_formatted": "usage_amount_formatted0" -} +## Example + +```java +import com.maxio.advancedbilling.models.Breakouts; + +Breakouts breakouts = new Breakouts.Builder() + .planAmountInCents(254L) + .planAmountFormatted("plan_amount_formatted0") + .usageAmountInCents(106L) + .usageAmountFormatted("usage_amount_formatted8") + .build(); ``` diff --git a/doc/models/bulk-components-price-point-assignment.md b/doc/models/bulk-components-price-point-assignment.md index eb231e09..15d79569 100644 --- a/doc/models/bulk-components-price-point-assignment.md +++ b/doc/models/bulk-components-price-point-assignment.md @@ -11,16 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `Components` | [`List`](../../doc/models/component-price-point-assignment.md) | Optional | - | List getComponents() | setComponents(List components) | -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": 108, - "price_point": "String5" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.BulkComponentsPricePointAssignment; +import com.maxio.advancedbilling.models.ComponentPricePointAssignment; +import com.maxio.advancedbilling.models.containers.ComponentPricePointAssignmentPricePoint; +import java.util.Arrays; + +BulkComponentsPricePointAssignment bulkComponentsPricePointAssignment = new BulkComponentsPricePointAssignment.Builder() + .components(Arrays.asList( + new ComponentPricePointAssignment.Builder() + .componentId(108) + .pricePoint(ComponentPricePointAssignmentPricePoint.fromString( + "String5" + )) + .build() + )) + .build(); ``` diff --git a/doc/models/bulk-create-product-price-points-request.md b/doc/models/bulk-create-product-price-points-request.md index e47daa99..bf19c552 100644 --- a/doc/models/bulk-create-product-price-points-request.md +++ b/doc/models/bulk-create-product-price-points-request.md @@ -11,24 +11,32 @@ | --- | --- | --- | --- | --- | --- | | `PricePoints` | [`List`](../../doc/models/create-product-price-point.md) | Required | - | List getPricePoints() | setPricePoints(List pricePoints) | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "name": "name2", - "price_in_cents": 108, - "interval": 92, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle8", - "trial_price_in_cents": 196, - "trial_interval": 250, - "trial_interval_unit": "day", - "trial_type": "no_obligation" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.BulkCreateProductPricePointsRequest; +import com.maxio.advancedbilling.models.CreateProductPricePoint; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.TrialType; +import java.util.Arrays; + +BulkCreateProductPricePointsRequest bulkCreateProductPricePointsRequest = new BulkCreateProductPricePointsRequest.Builder( + Arrays.asList( + new CreateProductPricePoint.Builder( + "name2", + 108L, + 92, + IntervalUnit.DAY + ) + .handle("handle8") + .trialPriceInCents(196L) + .trialInterval(250) + .trialIntervalUnit(IntervalUnit.DAY) + .trialType(TrialType.NO_OBLIGATION) + .useSiteExchangeRate(true) + .build() + ) +) +.build(); ``` diff --git a/doc/models/bulk-create-product-price-points-response.md b/doc/models/bulk-create-product-price-points-response.md index 40721a5e..6be732ed 100644 --- a/doc/models/bulk-create-product-price-points-response.md +++ b/doc/models/bulk-create-product-price-points-response.md @@ -11,19 +11,37 @@ | --- | --- | --- | --- | --- | --- | | `PricePoints` | [`List`](../../doc/models/product-price-point.md) | Optional | - | List getPricePoints() | setPricePoints(List pricePoints) | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.BulkCreateProductPricePointsResponse; +import com.maxio.advancedbilling.models.ProductPricePoint; +import java.util.Arrays; + +BulkCreateProductPricePointsResponse bulkCreateProductPricePointsResponse = new BulkCreateProductPricePointsResponse.Builder() + .pricePoints(Arrays.asList( + new ProductPricePoint.Builder() + .id(40) + .name("name2") + .handle("handle8") + .priceInCents(108L) + .interval(92) + .build(), + new ProductPricePoint.Builder() + .id(40) + .name("name2") + .handle("handle8") + .priceInCents(108L) + .interval(92) + .build(), + new ProductPricePoint.Builder() + .id(40) + .name("name2") + .handle("handle8") + .priceInCents(108L) + .interval(92) + .build() + )) + .build(); ``` diff --git a/doc/models/bulk-create-segments.md b/doc/models/bulk-create-segments.md index 820d0d36..de718c2a 100644 --- a/doc/models/bulk-create-segments.md +++ b/doc/models/bulk-create-segments.md @@ -11,36 +11,65 @@ | --- | --- | --- | --- | --- | --- | | `Segments` | [`List`](../../doc/models/create-segment.md) | Optional | **Constraints**: *Maximum Items*: `2000` | List getSegments() | setSegments(List segments) | -## Example (as JSON) - -```json -{ - "segments": [ - { - "segment_property_1_value": "String3", - "segment_property_2_value": "String5", - "segment_property_3_value": "String3", - "segment_property_4_value": "String7", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.BulkCreateSegments; +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.CreateSegment; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty1Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty2Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty3Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty4Value; +import java.util.Arrays; + +BulkCreateSegments bulkCreateSegments = new BulkCreateSegments.Builder() + .segments(Arrays.asList( + new CreateSegment.Builder( + PricingScheme.STAIRSTEP + ) + .segmentProperty1Value(CreateSegmentSegmentProperty1Value.fromString( + "String3" + )) + .segmentProperty2Value(CreateSegmentSegmentProperty2Value.fromString( + "String5" + )) + .segmentProperty3Value(CreateSegmentSegmentProperty3Value.fromString( + "String3" + )) + .segmentProperty4Value(CreateSegmentSegmentProperty4Value.fromString( + "String7" + )) + .prices(Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + )) + .build() + )) + .build(); ``` diff --git a/doc/models/bulk-update-segments-item.md b/doc/models/bulk-update-segments-item.md index d23dd317..7608397b 100644 --- a/doc/models/bulk-update-segments-item.md +++ b/doc/models/bulk-update-segments-item.md @@ -13,19 +13,29 @@ | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/create-or-update-segment-price.md) | Required | - | List getPrices() | setPrices(List prices) | -## Example (as JSON) - -```json -{ - "id": 180, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.BulkUpdateSegmentsItem; +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; +import java.util.Arrays; + +BulkUpdateSegmentsItem bulkUpdateSegmentsItem = new BulkUpdateSegmentsItem.Builder( + 220, + PricingScheme.PER_UNIT, + Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + ) +) +.build(); ``` diff --git a/doc/models/bulk-update-segments.md b/doc/models/bulk-update-segments.md index 1d0cbaa2..44bd8269 100644 --- a/doc/models/bulk-update-segments.md +++ b/doc/models/bulk-update-segments.md @@ -11,54 +11,81 @@ | --- | --- | --- | --- | --- | --- | | `Segments` | [`List`](../../doc/models/bulk-update-segments-item.md) | Optional | **Constraints**: *Maximum Items*: `1000` | List getSegments() | setSegments(List segments) | -## Example (as JSON) +## Example -```json -{ - "segments": [ - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] - }, - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] - } - ] -} +```java +import com.maxio.advancedbilling.models.BulkUpdateSegments; +import com.maxio.advancedbilling.models.BulkUpdateSegmentsItem; +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; +import java.util.Arrays; + +BulkUpdateSegments bulkUpdateSegments = new BulkUpdateSegments.Builder() + .segments(Arrays.asList( + new BulkUpdateSegmentsItem.Builder( + 50, + PricingScheme.STAIRSTEP, + Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + ) + ) + .build(), + new BulkUpdateSegmentsItem.Builder( + 50, + PricingScheme.STAIRSTEP, + Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + ) + ) + .build() + )) + .build(); ``` diff --git a/doc/models/calendar-billing.md b/doc/models/calendar-billing.md index d810e9bc..aadf26b7 100644 --- a/doc/models/calendar-billing.md +++ b/doc/models/calendar-billing.md @@ -1,7 +1,7 @@ # Calendar Billing -(Optional). Cannot be used when also specifying next_billing_at +(Optional). Cannot be used when also specifying next_billing_at. ## Structure @@ -14,12 +14,18 @@ | `SnapDay` | [`CalendarBillingSnapDay`](../../doc/models/containers/calendar-billing-snap-day.md) | Optional | This is a container for one-of cases. | CalendarBillingSnapDay getSnapDay() | setSnapDay(CalendarBillingSnapDay snapDay) | | `CalendarBillingFirstCharge` | [`FirstChargeType`](../../doc/models/first-charge-type.md) | Optional | - | FirstChargeType getCalendarBillingFirstCharge() | setCalendarBillingFirstCharge(FirstChargeType calendarBillingFirstCharge) | -## Example (as JSON) +## Example -```json -{ - "snap_day": 210, - "calendar_billing_first_charge": "prorated" -} +```java +import com.maxio.advancedbilling.models.CalendarBilling; +import com.maxio.advancedbilling.models.FirstChargeType; +import com.maxio.advancedbilling.models.containers.CalendarBillingSnapDay; + +CalendarBilling calendarBilling = new CalendarBilling.Builder() + .snapDay(CalendarBillingSnapDay.fromNumber( + 200 + )) + .calendarBillingFirstCharge(FirstChargeType.DELAYED) + .build(); ``` diff --git a/doc/models/cancel-grouped-subscriptions-request.md b/doc/models/cancel-grouped-subscriptions-request.md index cf7ed148..795a1134 100644 --- a/doc/models/cancel-grouped-subscriptions-request.md +++ b/doc/models/cancel-grouped-subscriptions-request.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `ChargeUnbilledUsage` | `Boolean` | Optional | - | Boolean getChargeUnbilledUsage() | setChargeUnbilledUsage(Boolean chargeUnbilledUsage) | -## Example (as JSON) +## Example -```json -{ - "charge_unbilled_usage": false -} +```java +import com.maxio.advancedbilling.models.CancelGroupedSubscriptionsRequest; + +CancelGroupedSubscriptionsRequest cancelGroupedSubscriptionsRequest = new CancelGroupedSubscriptionsRequest.Builder() + .chargeUnbilledUsage(false) + .build(); ``` diff --git a/doc/models/cancellation-method.md b/doc/models/cancellation-method.md index b0b7765a..226b18b3 100644 --- a/doc/models/cancellation-method.md +++ b/doc/models/cancellation-method.md @@ -18,3 +18,11 @@ The process used to cancel the subscription, if the subscription has been cancel | `UNKNOWN` | | `IMPORTED` | +## Example + +```java +import com.maxio.advancedbilling.models.CancellationMethod; + +CancellationMethod cancellationMethod = CancellationMethod.MERCHANT_UI; +``` + diff --git a/doc/models/cancellation-options.md b/doc/models/cancellation-options.md index 1505e304..00c95a40 100644 --- a/doc/models/cancellation-options.md +++ b/doc/models/cancellation-options.md @@ -12,18 +12,21 @@ | `CancellationMessage` | `String` | Optional | An indication as to why the subscription is being canceled. For your internal use. | String getCancellationMessage() | setCancellationMessage(String cancellationMessage) | | `ReasonCode` | `String` | Optional | The reason code associated with the cancellation. Use the [List Reason Codes](../../doc/controllers/reason-codes.md#list-reason-codes) endpoint to retrieve the reason codes associated with your site. | String getReasonCode() | setReasonCode(String reasonCode) | | `CancelAtEndOfPeriod` | `Boolean` | Optional | When true, the subscription is cancelled at the current period end instead of immediately. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | Boolean getCancelAtEndOfPeriod() | setCancelAtEndOfPeriod(Boolean cancelAtEndOfPeriod) | -| `ScheduledCancellationAt` | `ZonedDateTime` | Optional | Schedules the cancellation on the provided date. This is option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | ZonedDateTime getScheduledCancellationAt() | setScheduledCancellationAt(ZonedDateTime scheduledCancellationAt) | +| `ScheduledCancellationAt` | `ZonedDateTime` | Optional | Schedules the cancellation on the provided date. This option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | ZonedDateTime getScheduledCancellationAt() | setScheduledCancellationAt(ZonedDateTime scheduledCancellationAt) | | `RefundPrepaymentAccountBalance` | `Boolean` | Optional | Applies to prepaid subscriptions. When true, which is the default, the remaining prepaid balance is refunded as part of cancellation processing. When false, prepaid balance is not refunded as part of cancellation processing. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | Boolean getRefundPrepaymentAccountBalance() | setRefundPrepaymentAccountBalance(Boolean refundPrepaymentAccountBalance) | -## Example (as JSON) +## Example -```json -{ - "cancellation_message": "cancellation_message0", - "reason_code": "reason_code6", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CancellationOptions; + +CancellationOptions cancellationOptions = new CancellationOptions.Builder() + .cancellationMessage("cancellation_message0") + .reasonCode("reason_code6") + .cancelAtEndOfPeriod(false) + .scheduledCancellationAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .refundPrepaymentAccountBalance(false) + .build(); ``` diff --git a/doc/models/cancellation-request.md b/doc/models/cancellation-request.md index 9b5be126..1ac9cec4 100644 --- a/doc/models/cancellation-request.md +++ b/doc/models/cancellation-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | [`CancellationOptions`](../../doc/models/cancellation-options.md) | Required | - | CancellationOptions getSubscription() | setSubscription(CancellationOptions subscription) | -## Example (as JSON) - -```json -{ - "subscription": { - "cancellation_message": "cancellation_message2", - "reason_code": "reason_code8", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CancellationOptions; +import com.maxio.advancedbilling.models.CancellationRequest; + +CancellationRequest cancellationRequest = new CancellationRequest.Builder( + new CancellationOptions.Builder() + .cancellationMessage("cancellation_message2") + .reasonCode("reason_code8") + .cancelAtEndOfPeriod(false) + .scheduledCancellationAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .refundPrepaymentAccountBalance(false) + .build() +) +.build(); ``` diff --git a/doc/models/card-type.md b/doc/models/card-type.md index 8ed1d690..2869e099 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -48,3 +48,11 @@ The type of card used. | `SOLO` | | `LASER` | +## Example + +```java +import com.maxio.advancedbilling.models.CardType; + +CardType cardType = CardType.SOLO; +``` + diff --git a/doc/models/change-chargeback-status-event-data.md b/doc/models/change-chargeback-status-event-data.md index 42a10b6b..cd25d789 100644 --- a/doc/models/change-chargeback-status-event-data.md +++ b/doc/models/change-chargeback-status-event-data.md @@ -13,11 +13,15 @@ Example schema for an `change_chargeback_status` event | --- | --- | --- | --- | --- | --- | | `ChargebackStatus` | [`ChargebackStatus`](../../doc/models/chargeback-status.md) | Required | - | ChargebackStatus getChargebackStatus() | setChargebackStatus(ChargebackStatus chargebackStatus) | -## Example (as JSON) +## Example -```json -{ - "chargeback_status": "open" -} +```java +import com.maxio.advancedbilling.models.ChangeChargebackStatusEventData; +import com.maxio.advancedbilling.models.ChargebackStatus; + +ChangeChargebackStatusEventData changeChargebackStatusEventData = new ChangeChargebackStatusEventData.Builder( + ChargebackStatus.WON +) +.build(); ``` diff --git a/doc/models/change-chargeback-status-event.md b/doc/models/change-chargeback-status-event.md index d6b89c1b..2e1205e2 100644 --- a/doc/models/change-chargeback-status-event.md +++ b/doc/models/change-chargeback-status-event.md @@ -15,27 +15,36 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.CHANGE_CHARGEBACK_STATUS` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`ChangeChargebackStatusEventData`](../../doc/models/change-chargeback-status-event-data.md) | Required | Example schema for an `change_chargeback_status` event | ChangeChargebackStatusEventData getEventData() | setEventData(ChangeChargebackStatusEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_chargeback_status", - "event_data": { - "chargeback_status": "won" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ChangeChargebackStatusEvent; +import com.maxio.advancedbilling.models.ChangeChargebackStatusEventData; +import com.maxio.advancedbilling.models.ChargebackStatus; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; + +ChangeChargebackStatusEvent changeChargebackStatusEvent = new ChangeChargebackStatusEvent.Builder( + 136L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.CHANGE_CHARGEBACK_STATUS, + new ChangeChargebackStatusEventData.Builder( + ChargebackStatus.WON + ) + .build() +) +.build(); ``` diff --git a/doc/models/change-invoice-collection-method-event-data.md b/doc/models/change-invoice-collection-method-event-data.md index 9ef1e890..4367b77a 100644 --- a/doc/models/change-invoice-collection-method-event-data.md +++ b/doc/models/change-invoice-collection-method-event-data.md @@ -14,12 +14,15 @@ Example schema for an `change_invoice_collection_method` event | `FromCollectionMethod` | `String` | Required | The previous collection method of the invoice. | String getFromCollectionMethod() | setFromCollectionMethod(String fromCollectionMethod) | | `ToCollectionMethod` | `String` | Required | The new collection method of the invoice. | String getToCollectionMethod() | setToCollectionMethod(String toCollectionMethod) | -## Example (as JSON) +## Example -```json -{ - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method2" -} +```java +import com.maxio.advancedbilling.models.ChangeInvoiceCollectionMethodEventData; + +ChangeInvoiceCollectionMethodEventData changeInvoiceCollectionMethodEventData = new ChangeInvoiceCollectionMethodEventData.Builder( + "from_collection_method8", + "to_collection_method4" +) +.build(); ``` diff --git a/doc/models/change-invoice-collection-method-event.md b/doc/models/change-invoice-collection-method-event.md index d86d8ab3..b3c7ca95 100644 --- a/doc/models/change-invoice-collection-method-event.md +++ b/doc/models/change-invoice-collection-method-event.md @@ -15,28 +15,36 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.CHANGE_INVOICE_COLLECTION_METHOD` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`ChangeInvoiceCollectionMethodEventData`](../../doc/models/change-invoice-collection-method-event-data.md) | Required | Example schema for an `change_invoice_collection_method` event | ChangeInvoiceCollectionMethodEventData getEventData() | setEventData(ChangeInvoiceCollectionMethodEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 246, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_invoice_collection_method", - "event_data": { - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method8" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ChangeInvoiceCollectionMethodEvent; +import com.maxio.advancedbilling.models.ChangeInvoiceCollectionMethodEventData; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; + +ChangeInvoiceCollectionMethodEvent changeInvoiceCollectionMethodEvent = new ChangeInvoiceCollectionMethodEvent.Builder( + 110L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.CHANGE_INVOICE_COLLECTION_METHOD, + new ChangeInvoiceCollectionMethodEventData.Builder( + "from_collection_method4", + "to_collection_method8" + ) + .build() +) +.build(); ``` diff --git a/doc/models/change-invoice-status-event-data.md b/doc/models/change-invoice-status-event-data.md index e1eed0d3..1da2fecb 100644 --- a/doc/models/change-invoice-status-event-data.md +++ b/doc/models/change-invoice-status-event-data.md @@ -17,15 +17,20 @@ Example schema for an `change_invoice_status` event | `ToStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The updated status of the invoice after changes have been made. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | InvoiceStatus getToStatus() | setToStatus(InvoiceStatus toStatus) | | `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | - | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | -## Example (as JSON) - -```json -{ - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount2", - "from_status": "draft", - "to_status": "pending", - "consolidation_level": "none" -} +## Example + +```java +import com.maxio.advancedbilling.models.ChangeInvoiceStatusEventData; +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.InvoiceStatus; + +ChangeInvoiceStatusEventData changeInvoiceStatusEventData = new ChangeInvoiceStatusEventData.Builder( + InvoiceStatus.CANCELED, + InvoiceStatus.PROCESSING +) +.gatewayTransId("gateway_trans_id4") +.amount("amount6") +.consolidationLevel(InvoiceConsolidationLevel.PARENT) +.build(); ``` diff --git a/doc/models/change-invoice-status-event.md b/doc/models/change-invoice-status-event.md index 8a62313a..be622786 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -15,31 +15,41 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.CHANGE_INVOICE_STATUS` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`ChangeInvoiceStatusEventData`](../../doc/models/change-invoice-status-event-data.md) | Required | Example schema for an `change_invoice_status` event | ChangeInvoiceStatusEventData getEventData() | setEventData(ChangeInvoiceStatusEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 92, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_invoice_status", - "event_data": { - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount8", - "from_status": "open", - "to_status": "pending", - "consolidation_level": "child" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ChangeInvoiceStatusEvent; +import com.maxio.advancedbilling.models.ChangeInvoiceStatusEventData; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.InvoiceStatus; + +ChangeInvoiceStatusEvent changeInvoiceStatusEvent = new ChangeInvoiceStatusEvent.Builder( + 148L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.CHANGE_INVOICE_STATUS, + new ChangeInvoiceStatusEventData.Builder( + InvoiceStatus.OPEN, + InvoiceStatus.PENDING + ) + .gatewayTransId("gateway_trans_id2") + .amount("amount8") + .consolidationLevel(InvoiceConsolidationLevel.CHILD) + .build() +) +.build(); ``` diff --git a/doc/models/chargeback-status.md b/doc/models/chargeback-status.md index 5541f264..3da3f7a8 100644 --- a/doc/models/chargeback-status.md +++ b/doc/models/chargeback-status.md @@ -16,3 +16,11 @@ The current chargeback status. | `WON` | | `CLOSED` | +## Example + +```java +import com.maxio.advancedbilling.models.ChargebackStatus; + +ChargebackStatus chargebackStatus = ChargebackStatus.OPEN; +``` + diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 0d42ad95..ad0b7423 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -16,15 +16,18 @@ | `SubscriptionId` | `Integer` | Optional | Id of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream. | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `SubscriptionReference` | `String` | Optional | Reference of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. | String getSubscriptionReference() | setSubscriptionReference(String subscriptionReference) | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "id": "id4", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token0", - "subscription_id": 200 -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ChargifyEBB; + +ChargifyEBB chargifyEBB = new ChargifyEBB.Builder() + .timestamp(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .id("id2") + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .uniquenessToken("uniqueness_token8") + .subscriptionId(224) + .build(); ``` diff --git a/doc/models/chjs-tokenization-failure.md b/doc/models/chjs-tokenization-failure.md index 697d3e9e..0f8f6265 100644 --- a/doc/models/chjs-tokenization-failure.md +++ b/doc/models/chjs-tokenization-failure.md @@ -12,16 +12,20 @@ | `Errors` | `String` | Required | - | String getErrors() | setErrors(String errors) | | `PaymentProfileParams` | [`PaymentProfileParams`](../../doc/models/payment-profile-params.md) | Optional | PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are never included. | PaymentProfileParams getPaymentProfileParams() | setPaymentProfileParams(PaymentProfileParams paymentProfileParams) | -## Example (as JSON) - -```json -{ - "errors": "errors2", - "payment_profile_params": { - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type2" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ChjsTokenizationFailure; +import com.maxio.advancedbilling.models.PaymentProfileParams; + +ChjsTokenizationFailure chjsTokenizationFailure = new ChjsTokenizationFailure.Builder( + "errors2" +) +.paymentProfileParams(new PaymentProfileParams.Builder() + .firstName("first_name2") + .lastName("last_name0") + .cardType("card_type2") + .build()) +.build(); ``` diff --git a/doc/models/chjs-tokenization-success.md b/doc/models/chjs-tokenization-success.md index 622835e7..f9974c58 100644 --- a/doc/models/chjs-tokenization-success.md +++ b/doc/models/chjs-tokenization-success.md @@ -12,17 +12,22 @@ | `PaymentProfile` | [`TokenizedPaymentProfile`](../../doc/models/tokenized-payment-profile.md) | Required | - | TokenizedPaymentProfile getPaymentProfile() | setPaymentProfile(TokenizedPaymentProfile paymentProfile) | | `GatewayCustomerId` | `Integer` | Optional | - | Integer getGatewayCustomerId() | setGatewayCustomerId(Integer gatewayCustomerId) | -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": 44, - "vault_token": "vault_token6", - "gateway_handle": "gateway_handle4", - "customer_vault_token": "customer_vault_token2" - }, - "gateway_customer_id": 44 -} +## Example + +```java +import com.maxio.advancedbilling.models.ChjsTokenizationSuccess; +import com.maxio.advancedbilling.models.TokenizedPaymentProfile; + +ChjsTokenizationSuccess chjsTokenizationSuccess = new ChjsTokenizationSuccess.Builder( + new TokenizedPaymentProfile.Builder( + 44 + ) + .vaultToken("vault_token6") + .gatewayHandle("gateway_handle4") + .customerVaultToken("customer_vault_token2") + .build() +) +.gatewayCustomerId(228) +.build(); ``` diff --git a/doc/models/cleanup-scope.md b/doc/models/cleanup-scope.md index 234cc07c..922ca799 100644 --- a/doc/models/cleanup-scope.md +++ b/doc/models/cleanup-scope.md @@ -14,3 +14,11 @@ all: Will clear all products, customers, and related subscriptions from the site | `ALL` | | `CUSTOMERS` | +## Example + +```java +import com.maxio.advancedbilling.models.CleanupScope; + +CleanupScope cleanupScope = CleanupScope.ALL; +``` + diff --git a/doc/models/clone-component-price-point-request.md b/doc/models/clone-component-price-point-request.md index 9a2d1b38..2a140a84 100644 --- a/doc/models/clone-component-price-point-request.md +++ b/doc/models/clone-component-price-point-request.md @@ -11,14 +11,19 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`CloneComponentPricePoint`](../../doc/models/clone-component-price-point.md) | Required | - | CloneComponentPricePoint getPricePoint() | setPricePoint(CloneComponentPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CloneComponentPricePoint; +import com.maxio.advancedbilling.models.CloneComponentPricePointRequest; + +CloneComponentPricePointRequest cloneComponentPricePointRequest = new CloneComponentPricePointRequest.Builder( + new CloneComponentPricePoint.Builder( + "name0" + ) + .handle("handle6") + .build() +) +.build(); ``` diff --git a/doc/models/clone-component-price-point.md b/doc/models/clone-component-price-point.md index 8cfab261..5b278305 100644 --- a/doc/models/clone-component-price-point.md +++ b/doc/models/clone-component-price-point.md @@ -12,12 +12,15 @@ | `Name` | `String` | Required | - | String getName() | setName(String name) | | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8" -} +```java +import com.maxio.advancedbilling.models.CloneComponentPricePoint; + +CloneComponentPricePoint cloneComponentPricePoint = new CloneComponentPricePoint.Builder( + "name4" +) +.handle("handle0") +.build(); ``` diff --git a/doc/models/collection-method-1.md b/doc/models/collection-method-1.md new file mode 100644 index 00000000..af594758 --- /dev/null +++ b/doc/models/collection-method-1.md @@ -0,0 +1,23 @@ + +# Collection Method 1 + +## Enumeration + +`CollectionMethod1` + +## Fields + +| Name | +| --- | +| `AUTOMATIC` | +| `REMITTANCE` | +| `PREPAID` | + +## Example + +```java +import com.maxio.advancedbilling.models.CollectionMethod1; + +CollectionMethod1 collectionMethod1 = CollectionMethod1.AUTOMATIC; +``` + diff --git a/doc/models/collection-method.md b/doc/models/collection-method.md index 50b7215d..f45f6153 100644 --- a/doc/models/collection-method.md +++ b/doc/models/collection-method.md @@ -16,3 +16,11 @@ The type of payment collection to be used in the subscription. For legacy Statem | `PREPAID` | | `INVOICE` | +## Example + +```java +import com.maxio.advancedbilling.models.CollectionMethod; + +CollectionMethod collectionMethod = CollectionMethod.AUTOMATIC; +``` + diff --git a/doc/models/component-allocation-change.md b/doc/models/component-allocation-change.md index fe206b84..cb734e72 100644 --- a/doc/models/component-allocation-change.md +++ b/doc/models/component-allocation-change.md @@ -17,17 +17,23 @@ | `AllocationId` | `int` | Required | - | int getAllocationId() | setAllocationId(int allocationId) | | `AllocatedQuantity` | [`ComponentAllocationChangeAllocatedQuantity`](../../doc/models/containers/component-allocation-change-allocated-quantity.md) | Optional | This is a container for one-of cases. | ComponentAllocationChangeAllocatedQuantity getAllocatedQuantity() | setAllocatedQuantity(ComponentAllocationChangeAllocatedQuantity allocatedQuantity) | -## Example (as JSON) - -```json -{ - "previous_allocation": 94, - "new_allocation": 102, - "component_id": 88, - "component_handle": "component_handle8", - "memo": "memo2", - "allocation_id": 158, - "allocated_quantity": 104 -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentAllocationChange; +import com.maxio.advancedbilling.models.containers.ComponentAllocationChangeAllocatedQuantity; + +ComponentAllocationChange componentAllocationChange = new ComponentAllocationChange.Builder( + 78, + 118, + 72, + "component_handle8", + "memo2", + 174 +) +.allocatedQuantity(ComponentAllocationChangeAllocatedQuantity.fromNumber( + 88 + )) +.build(); ``` diff --git a/doc/models/component-allocation-error-exception.md b/doc/models/component-allocation-error-exception.md index 326cc898..f9a556c2 100644 --- a/doc/models/component-allocation-error-exception.md +++ b/doc/models/component-allocation-error-exception.md @@ -11,30 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`List`](../../doc/models/component-allocation-error-item.md) | Optional | - | List getErrors() | setErrors(List errors) | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - } - ] +## Example + +```java +try { + // make the API call +} catch (ComponentAllocationErrorException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/component-allocation-error-item.md b/doc/models/component-allocation-error-item.md index 63d48f2b..354bcfc7 100644 --- a/doc/models/component-allocation-error-item.md +++ b/doc/models/component-allocation-error-item.md @@ -14,14 +14,16 @@ | `Kind` | `String` | Optional | - | String getKind() | setKind(String kind) | | `On` | `String` | Optional | - | String getOn() | setOn(String on) | -## Example (as JSON) - -```json -{ - "component_id": 188, - "message": "message0", - "kind": "kind8", - "on": "on0" -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentAllocationErrorItem; + +ComponentAllocationErrorItem componentAllocationErrorItem = new ComponentAllocationErrorItem.Builder() + .componentId(122) + .message("message8") + .kind("kind6") + .on("on8") + .build(); ``` diff --git a/doc/models/component-cost-data-rate-tier.md b/doc/models/component-cost-data-rate-tier.md index a9e85b49..afcd78b4 100644 --- a/doc/models/component-cost-data-rate-tier.md +++ b/doc/models/component-cost-data-rate-tier.md @@ -15,15 +15,17 @@ | `UnitPrice` | `String` | Optional | - | String getUnitPrice() | setUnitPrice(String unitPrice) | | `Amount` | `String` | Optional | - | String getAmount() | setAmount(String amount) | -## Example (as JSON) - -```json -{ - "starting_quantity": 132, - "ending_quantity": 106, - "quantity": "quantity0", - "unit_price": "unit_price2", - "amount": "amount6" -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCostDataRateTier; + +ComponentCostDataRateTier componentCostDataRateTier = new ComponentCostDataRateTier.Builder() + .startingQuantity(204) + .endingQuantity(178) + .quantity("quantity4") + .unitPrice("unit_price6") + .amount("amount0") + .build(); ``` diff --git a/doc/models/component-cost-data.md b/doc/models/component-cost-data.md index ecc2ed5f..f0b50215 100644 --- a/doc/models/component-cost-data.md +++ b/doc/models/component-cost-data.md @@ -17,15 +17,17 @@ | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Tiers` | [`List`](../../doc/models/component-cost-data-rate-tier.md) | Optional | - | List getTiers() | setTiers(List tiers) | -## Example (as JSON) - -```json -{ - "component_code_id": 16, - "price_point_id": 186, - "product_id": 250, - "quantity": "quantity8", - "amount": "amount4" -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCostData; + +ComponentCostData componentCostData = new ComponentCostData.Builder() + .componentCodeId(40) + .pricePointId(210) + .productId(18) + .quantity("quantity4") + .amount("amount0") + .build(); ``` diff --git a/doc/models/component-currency-price.md b/doc/models/component-currency-price.md index 8ad8e944..48e2f2a4 100644 --- a/doc/models/component-currency-price.md +++ b/doc/models/component-currency-price.md @@ -16,15 +16,17 @@ | `PriceId` | `Integer` | Optional | - | Integer getPriceId() | setPriceId(Integer priceId) | | `PricePointId` | `Integer` | Optional | - | Integer getPricePointId() | setPricePointId(Integer pricePointId) | -## Example (as JSON) - -```json -{ - "id": 4, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 162 -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCurrencyPrice; + +ComponentCurrencyPrice componentCurrencyPrice = new ComponentCurrencyPrice.Builder() + .id(128) + .currency("currency2") + .price("price4") + .formattedPrice("formatted_price6") + .priceId(38) + .build(); ``` diff --git a/doc/models/component-currency-prices-response.md b/doc/models/component-currency-prices-response.md index d33f7a12..dea345a5 100644 --- a/doc/models/component-currency-prices-response.md +++ b/doc/models/component-currency-prices-response.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `CurrencyPrices` | [`List`](../../doc/models/component-currency-price.md) | Required | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 116 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCurrencyPrice; +import com.maxio.advancedbilling.models.ComponentCurrencyPricesResponse; +import java.util.Arrays; + +ComponentCurrencyPricesResponse componentCurrencyPricesResponse = new ComponentCurrencyPricesResponse.Builder( + Arrays.asList( + new ComponentCurrencyPrice.Builder() + .id(50) + .currency("currency8") + .price("price4") + .formattedPrice("formatted_price6") + .priceId(116) + .build() + ) +) +.build(); ``` diff --git a/doc/models/component-custom-price.md b/doc/models/component-custom-price.md index 1c0d19af..910696d9 100644 --- a/doc/models/component-custom-price.md +++ b/doc/models/component-custom-price.md @@ -12,10 +12,10 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `TaxIncluded` | `Boolean` | Optional | Whether or not the price point includes tax | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -| `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | -| `ListPricePointId` | `Integer` | Optional | Optional id of the price point to use for list price calculations when
overriding the customer price. | Integer getListPricePointId() | setListPricePointId(Integer listPricePointId) | +| `ListPricePointId` | `Integer` | Optional | (Optional) Id of the price point to use for list price calculations when
overriding the customer price. | Integer getListPricePointId() | setListPricePointId(Integer listPricePointId) | | `UseDefaultListPrice` | `Boolean` | Optional | When true, list price calculations will continue to use the default price point even when a `custom_price` is supplied. | Boolean getUseDefaultListPrice() | setUseDefaultListPrice(Boolean useDefaultListPrice) | | `Prices` | [`List`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | List getPrices() | setPrices(List prices) | | `RenewPrepaidAllocation` | `Boolean` | Optional | Applicable only to prepaid usage components. Controls whether the allocated quantity renews each period. | Boolean getRenewPrepaidAllocation() | setRenewPrepaidAllocation(Boolean renewPrepaidAllocation) | @@ -23,22 +23,39 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | `ExpirationInterval` | `Integer` | Optional | Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover amounts expire. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | -## Example (as JSON) - -```json -{ - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 162, - "interval_unit": "day", - "list_price_point_id": 146 -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCustomPrice; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +ComponentCustomPrice componentCustomPrice = new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) +) +.taxIncluded(false) +.pricingScheme(PricingScheme.STAIRSTEP) +.interval(58) +.intervalUnit(IntervalUnit.DAY) +.listPricePointId(182) +.build(); ``` diff --git a/doc/models/component-kind.md b/doc/models/component-kind.md index f8b65b77..c135fda2 100644 --- a/doc/models/component-kind.md +++ b/doc/models/component-kind.md @@ -17,3 +17,11 @@ A handle for the component type | `PREPAID_USAGE_COMPONENT` | | `EVENT_BASED_COMPONENT` | +## Example + +```java +import com.maxio.advancedbilling.models.ComponentKind; + +ComponentKind componentKind = ComponentKind.PREPAID_USAGE_COMPONENT; +``` + diff --git a/doc/models/component-price-point-assignment.md b/doc/models/component-price-point-assignment.md index 75d9c787..460060de 100644 --- a/doc/models/component-price-point-assignment.md +++ b/doc/models/component-price-point-assignment.md @@ -12,12 +12,17 @@ | `ComponentId` | `Integer` | Optional | - | Integer getComponentId() | setComponentId(Integer componentId) | | `PricePoint` | [`ComponentPricePointAssignmentPricePoint`](../../doc/models/containers/component-price-point-assignment-price-point.md) | Optional | This is a container for one-of cases. | ComponentPricePointAssignmentPricePoint getPricePoint() | setPricePoint(ComponentPricePointAssignmentPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "component_id": 114, - "price_point": "String9" -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePointAssignment; +import com.maxio.advancedbilling.models.containers.ComponentPricePointAssignmentPricePoint; + +ComponentPricePointAssignment componentPricePointAssignment = new ComponentPricePointAssignment.Builder() + .componentId(190) + .pricePoint(ComponentPricePointAssignmentPricePoint.fromString( + "String7" + )) + .build(); ``` diff --git a/doc/models/component-price-point-currency-overage-response.md b/doc/models/component-price-point-currency-overage-response.md index 2a1ec820..dafebaea 100644 --- a/doc/models/component-price-point-currency-overage-response.md +++ b/doc/models/component-price-point-currency-overage-response.md @@ -11,17 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`CurrencyOveragePrices`](../../doc/models/currency-overage-prices.md) | Required | Extends a component price point with currency overage prices. | CurrencyOveragePrices getPricePoint() | setPricePoint(CurrencyOveragePrices pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePointCurrencyOverageResponse; +import com.maxio.advancedbilling.models.CurrencyOveragePrices; +import com.maxio.advancedbilling.models.PricePointType; +import com.maxio.advancedbilling.models.PricingScheme; + +ComponentPricePointCurrencyOverageResponse componentPricePointCurrencyOverageResponse = new ComponentPricePointCurrencyOverageResponse.Builder( + new CurrencyOveragePrices.Builder() + .id(248) + .type(PricePointType.ENUM_DEFAULT) + .mDefault(false) + .name("name0") + .pricingScheme(PricingScheme.PER_UNIT) + .build() +) +.build(); ``` diff --git a/doc/models/component-price-point-error-exception.md b/doc/models/component-price-point-error-exception.md index f59e0093..63aaa348 100644 --- a/doc/models/component-price-point-error-exception.md +++ b/doc/models/component-price-point-error-exception.md @@ -11,22 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`List`](../../doc/models/component-price-point-error-item.md) | Optional | - | List getErrors() | setErrors(List errors) | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "price_point": 122 - }, - { - "component_id": 236, - "message": "message0", - "price_point": 122 - } - ] +## Example + +```java +try { + // make the API call +} catch (ComponentPricePointErrorException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/component-price-point-error-item.md b/doc/models/component-price-point-error-item.md index e5e32df7..fb87e0d5 100644 --- a/doc/models/component-price-point-error-item.md +++ b/doc/models/component-price-point-error-item.md @@ -13,13 +13,15 @@ | `Message` | `String` | Optional | - | String getMessage() | setMessage(String message) | | `PricePoint` | `Integer` | Optional | - | Integer getPricePoint() | setPricePoint(Integer pricePoint) | -## Example (as JSON) - -```json -{ - "component_id": 206, - "message": "message4", - "price_point": 152 -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePointErrorItem; + +ComponentPricePointErrorItem componentPricePointErrorItem = new ComponentPricePointErrorItem.Builder() + .componentId(174) + .message("message2") + .pricePoint(72) + .build(); ``` diff --git a/doc/models/component-price-point-item.md b/doc/models/component-price-point-item.md index f6752b75..ce552374 100644 --- a/doc/models/component-price-point-item.md +++ b/doc/models/component-price-point-item.md @@ -12,19 +12,23 @@ | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | - | List getPrices() | setPrices(List prices) | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "pricing_scheme": "per_unit", - "interval": 196, - "interval_unit": "day" -} +```java +import com.maxio.advancedbilling.models.ComponentPricePointItem; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.PricingScheme; + +ComponentPricePointItem componentPricePointItem = new ComponentPricePointItem.Builder() + .name("name8") + .handle("handle4") + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(138) + .intervalUnit(IntervalUnit.DAY) + .build(); ``` diff --git a/doc/models/component-price-point-response.md b/doc/models/component-price-point-response.md index e337a45f..c3637fbd 100644 --- a/doc/models/component-price-point-response.md +++ b/doc/models/component-price-point-response.md @@ -11,17 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`ComponentPricePoint`](../../doc/models/component-price-point.md) | Required | - | ComponentPricePoint getPricePoint() | setPricePoint(ComponentPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePoint; +import com.maxio.advancedbilling.models.ComponentPricePointResponse; +import com.maxio.advancedbilling.models.PricePointType; +import com.maxio.advancedbilling.models.PricingScheme; + +ComponentPricePointResponse componentPricePointResponse = new ComponentPricePointResponse.Builder( + new ComponentPricePoint.Builder() + .id(248) + .type(PricePointType.ENUM_DEFAULT) + .mDefault(false) + .name("name0") + .pricingScheme(PricingScheme.PER_UNIT) + .build() +) +.build(); ``` diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index 9dee128e..7e69d45f 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | --- | --- | | `Id` | `Integer` | Optional | - | Integer getId() | setId(Integer id) | | `Type` | [`PricePointType`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | PricePointType getType() | setType(PricePointType type) | -| `Default` | `Boolean` | Optional | Note: Refer to type attribute instead | Boolean getDefault() | setDefault(Boolean mDefault) | +| `Default` | `Boolean` | Optional | Note: Refer to type attribute instead. | Boolean getDefault() | setDefault(Boolean mDefault) | | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `ComponentId` | `Integer` | Optional | - | Integer getComponentId() | setComponentId(Integer componentId) | @@ -23,7 +23,7 @@ | `UseSiteExchangeRate` | `Boolean` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Defaults to true during creation. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `SubscriptionId` | `Integer` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `TaxIncluded` | `Boolean` | Optional | - | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `CurrencyPrices` | [`List`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | | `OveragePrices` | [`List`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | List getOveragePrices() | setOveragePrices(List overagePrices) | @@ -33,15 +33,19 @@ | `ExpirationInterval` | `Integer` | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. The number of `expiration_interval_unit`s after which rollover amounts should expire. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | -## Example (as JSON) +## Example -```json -{ - "id": 190, - "type": "custom", - "default": false, - "name": "name2", - "pricing_scheme": "stairstep" -} +```java +import com.maxio.advancedbilling.models.ComponentPricePoint; +import com.maxio.advancedbilling.models.PricePointType; +import com.maxio.advancedbilling.models.PricingScheme; + +ComponentPricePoint componentPricePoint = new ComponentPricePoint.Builder() + .id(122) + .type(PricePointType.CATALOG) + .mDefault(false) + .name("name2") + .pricingScheme(PricingScheme.STAIRSTEP) + .build(); ``` diff --git a/doc/models/component-price-points-response.md b/doc/models/component-price-points-response.md index 1e29c34d..d5c8efc9 100644 --- a/doc/models/component-price-points-response.md +++ b/doc/models/component-price-points-response.md @@ -12,32 +12,46 @@ | `PricePoints` | [`List`](../../doc/models/component-price-point.md) | Optional | - | List getPricePoints() | setPricePoints(List pricePoints) | | `Meta` | [`ListPublicKeysMeta`](../../doc/models/list-public-keys-meta.md) | Optional | - | ListPublicKeysMeta getMeta() | setMeta(ListPublicKeysMeta meta) | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - }, - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - } - ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePoint; +import com.maxio.advancedbilling.models.ComponentPricePointsResponse; +import com.maxio.advancedbilling.models.ListPublicKeysMeta; +import com.maxio.advancedbilling.models.PricePointType; +import com.maxio.advancedbilling.models.PricingScheme; +import java.util.Arrays; + +ComponentPricePointsResponse componentPricePointsResponse = new ComponentPricePointsResponse.Builder() + .pricePoints(Arrays.asList( + new ComponentPricePoint.Builder() + .id(40) + .type(PricePointType.ENUM_DEFAULT) + .mDefault(false) + .name("name2") + .pricingScheme(PricingScheme.PER_UNIT) + .build(), + new ComponentPricePoint.Builder() + .id(40) + .type(PricePointType.ENUM_DEFAULT) + .mDefault(false) + .name("name2") + .pricingScheme(PricingScheme.PER_UNIT) + .build(), + new ComponentPricePoint.Builder() + .id(40) + .type(PricePointType.ENUM_DEFAULT) + .mDefault(false) + .name("name2") + .pricingScheme(PricingScheme.PER_UNIT) + .build() + )) + .meta(new ListPublicKeysMeta.Builder() + .totalCount(150) + .currentPage(126) + .totalPages(138) + .perPage(152) + .build()) + .build(); ``` diff --git a/doc/models/component-price.md b/doc/models/component-price.md index 3a09ac3b..c01f6d58 100644 --- a/doc/models/component-price.md +++ b/doc/models/component-price.md @@ -18,15 +18,17 @@ | `FormattedUnitPrice` | `String` | Optional | - | String getFormattedUnitPrice() | setFormattedUnitPrice(String formattedUnitPrice) | | `SegmentId` | `Integer` | Optional | - | Integer getSegmentId() | setSegmentId(Integer segmentId) | -## Example (as JSON) - -```json -{ - "id": 234, - "component_id": 88, - "starting_quantity": 104, - "ending_quantity": 78, - "unit_price": "unit_price0" -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPrice; + +ComponentPrice componentPrice = new ComponentPrice.Builder() + .id(18) + .componentId(128) + .startingQuantity(64) + .endingQuantity(218) + .unitPrice("unit_price4") + .build(); ``` diff --git a/doc/models/component-response.md b/doc/models/component-response.md index 2095c6c6..ef5e7879 100644 --- a/doc/models/component-response.md +++ b/doc/models/component-response.md @@ -11,18 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `Component` | [`Component`](../../doc/models/component.md) | Required | - | Component getComponent() | setComponent(Component component) | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "id": 80, - "name": "name8", - "handle": "handle4", - "pricing_scheme": "per_unit", - "unit_name": "unit_name0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Component; +import com.maxio.advancedbilling.models.ComponentResponse; +import com.maxio.advancedbilling.models.ItemCategory; +import com.maxio.advancedbilling.models.PricingScheme; + +ComponentResponse componentResponse = new ComponentResponse.Builder( + new Component.Builder() + .id(80) + .name("name8") + .handle("handle4") + .pricingScheme(PricingScheme.PER_UNIT) + .unitName("unit_name0") + .itemCategory(ItemCategory.ENUM_BUSINESS_SOFTWARE) + .build() +) +.build(); ``` diff --git a/doc/models/component.md b/doc/models/component.md index f8d71ecf..669d1077 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -10,15 +10,15 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Id` | `Integer` | Optional | The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API. | Integer getId() | setId(Integer id) | -| `Name` | `String` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | String getName() | setName(String name) | +| `Name` | `String` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | String getName() | setName(String name) | | `Handle` | `String` | Optional | The component API handle | String getHandle() | setHandle(String handle) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | -| `UnitName` | `String` | Optional | The name of the unit that the component’s usage is measured in. i.e. message | String getUnitName() | setUnitName(String unitName) | +| `UnitName` | `String` | Optional | The name of the unit that the component’s usage is measured in. e.g., message | String getUnitName() | setUnitName(String unitName) | | `UnitPrice` | `String` | Optional | The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. | String getUnitPrice() | setUnitPrice(String unitPrice) | | `ProductFamilyId` | `Integer` | Optional | The id of the Product Family to which the Component belongs | Integer getProductFamilyId() | setProductFamilyId(Integer productFamilyId) | | `ProductFamilyName` | `String` | Optional | The name of the Product Family to which the Component belongs | String getProductFamilyName() | setProductFamilyName(String productFamilyName) | | `ProductFamilyHandle` | `String` | Optional | The handle of the Product Family to which the Component belongs | String getProductFamilyHandle() | setProductFamilyHandle(String productFamilyHandle) | -| `PricePerUnitInCents` | `Long` | Optional | deprecated - use unit_price instead | Long getPricePerUnitInCents() | setPricePerUnitInCents(Long pricePerUnitInCents) | +| `PricePerUnitInCents` | `Long` | Optional | deprecated - use unit_price instead. | Long getPricePerUnitInCents() | setPricePerUnitInCents(Long pricePerUnitInCents) | | `Kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | ComponentKind getKind() | setKind(ComponentKind kind) | | `Archived` | `Boolean` | Optional | Boolean flag describing whether a component is archived or not. | Boolean getArchived() | setArchived(Boolean archived) | | `Description` | `String` | Optional | The description of the component. | String getDescription() | setDescription(String description) | @@ -42,19 +42,24 @@ | `UseSiteExchangeRate` | `Boolean` | Optional | - | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `AccountingCode` | `String` | Optional | E.g. Internal ID or SKU Number | String getAccountingCode() | setAccountingCode(String accountingCode) | | `EventBasedBillingMetricId` | `Integer` | Optional | (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events. | Integer getEventBasedBillingMetricId() | setEventBasedBillingMetricId(Integer eventBasedBillingMetricId) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component’s default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "id": 24, - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "unit_name": "unit_name4" -} +## Example + +```java +import com.maxio.advancedbilling.models.Component; +import com.maxio.advancedbilling.models.ItemCategory; +import com.maxio.advancedbilling.models.PricingScheme; + +Component component = new Component.Builder() + .id(80) + .name("name8") + .handle("handle4") + .pricingScheme(PricingScheme.PER_UNIT) + .unitName("unit_name0") + .itemCategory(ItemCategory.ENUM_BUSINESS_SOFTWARE) + .build(); ``` diff --git a/doc/models/compounding-strategy.md b/doc/models/compounding-strategy.md index ec68b1f7..f3227e4d 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -14,3 +14,11 @@ Applicable only to stackable coupons. For `compound`, Percentage-based discounts | `COMPOUND` | | `FULLPRICE` | +## Example + +```java +import com.maxio.advancedbilling.models.CompoundingStrategy; + +CompoundingStrategy compoundingStrategy = CompoundingStrategy.COMPOUND; +``` + diff --git a/doc/models/consolidated-invoice.md b/doc/models/consolidated-invoice.md index 000832db..be01ae6d 100644 --- a/doc/models/consolidated-invoice.md +++ b/doc/models/consolidated-invoice.md @@ -11,26 +11,37 @@ | --- | --- | --- | --- | --- | --- | | `Invoices` | [`List`](../../doc/models/invoice.md) | Optional | - | List getInvoices() | setInvoices(List invoices) | -## Example (as JSON) - -```json -{ - "invoices": [ - { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - }, - { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ConsolidatedInvoice; +import com.maxio.advancedbilling.models.Invoice; +import java.util.Arrays; + +ConsolidatedInvoice consolidatedInvoice = new ConsolidatedInvoice.Builder() + .invoices(Arrays.asList( + new Invoice.Builder() + .id(196L) + .uid("uid6") + .siteId(122) + .customerId(234) + .subscriptionId(50) + .build(), + new Invoice.Builder() + .id(196L) + .uid("uid6") + .siteId(122) + .customerId(234) + .subscriptionId(50) + .build(), + new Invoice.Builder() + .id(196L) + .uid("uid6") + .siteId(122) + .customerId(234) + .subscriptionId(50) + .build() + )) + .build(); ``` diff --git a/doc/models/containers/create-subscription-component-unit-balance.md b/doc/models/containers/create-subscription-component-unit-balance.md new file mode 100644 index 00000000..7334ae07 --- /dev/null +++ b/doc/models/containers/create-subscription-component-unit-balance.md @@ -0,0 +1,38 @@ + +# Create Subscription Component Unit Balance + +## Class Name + +`CreateSubscriptionComponentUnitBalance` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | CreateSubscriptionComponentUnitBalance.fromNumber(int number) | +| `String` | CreateSubscriptionComponentUnitBalance.fromString(String string) | + +## int + +### Initialization Code + +#### Example + +```java +CreateSubscriptionComponentUnitBalance.fromNumber( + 0 + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +CreateSubscriptionComponentUnitBalance.fromString( + "String0" + ) +``` + diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 3a8ef091..7788d974 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -125,7 +125,9 @@ EventEventSpecificData.fromComponentAllocationChange( EventEventSpecificData.fromMeteredUsage( new MeteredUsage.Builder( "previous_unit_balance6", - 80, + MeteredUsageNewUnitBalance.fromNumber( + 2 + ), 42, 4, "component_handle8", @@ -146,8 +148,12 @@ EventEventSpecificData.fromPrepaidUsage( new PrepaidUsage.Builder( "previous_unit_balance0", "previous_overage_unit_balance4", - 252, - 224, + PrepaidUsageNewUnitBalance.fromNumber( + 174 + ), + PrepaidUsageNewOverageUnitBalance.fromNumber( + 146 + ), 214, 106, 176, diff --git a/doc/models/containers/get-one-time-token-request-payment-profile.md b/doc/models/containers/get-one-time-token-request-payment-profile.md new file mode 100644 index 00000000..c549e5e9 --- /dev/null +++ b/doc/models/containers/get-one-time-token-request-payment-profile.md @@ -0,0 +1,75 @@ + +# Get One Time Token Request Payment Profile + +## Class Name + +`GetOneTimeTokenRequestPaymentProfile` + +## Cases + +| Type | Factory Method | +| --- | --- | +| [`GetOneTimeTokenPaymentProfile`](../../../doc/models/get-one-time-token-payment-profile.md) | GetOneTimeTokenRequestPaymentProfile.fromGetOneTimeTokenPaymentProfile(GetOneTimeTokenPaymentProfile getOneTimeTokenPaymentProfile) | +| [`GetOneTimeTokenBankAccountPaymentProfile`](../../../doc/models/get-one-time-token-bank-account-payment-profile.md) | GetOneTimeTokenRequestPaymentProfile.fromGetOneTimeTokenBankAccountPaymentProfile(GetOneTimeTokenBankAccountPaymentProfile getOneTimeTokenBankAccountPaymentProfile) | + +## GetOneTimeTokenPaymentProfile + +### Initialization Code + +#### Example + +```java +GetOneTimeTokenRequestPaymentProfile.fromGetOneTimeTokenPaymentProfile( + new GetOneTimeTokenPaymentProfile.Builder( + "first_name2", + "last_name0", + "masked_card_number0", + CardType.ROUTEX, + 187.78D, + 164.44D, + CreditCardVault.BRAINTREE_BLUE, + "vault_token4", + "billing_address4", + "billing_city0", + "billing_country6", + "billing_state6", + "billing_zip0", + "payment_type2", + false, + 232 + ) + .build() + ) +``` + +## GetOneTimeTokenBankAccountPaymentProfile + +### Initialization Code + +#### Example + +```java +GetOneTimeTokenRequestPaymentProfile.fromGetOneTimeTokenBankAccountPaymentProfile( + new GetOneTimeTokenBankAccountPaymentProfile.Builder( + "first_name8", + "last_name6", + BankAccountVault.MAXP, + "vault_token0", + "billing_address0", + "billing_city4", + "billing_country2", + "billing_state8", + "billing_zip6", + "bank_name6", + "masked_bank_routing_number6", + "masked_bank_account_number0", + BankAccountType.CHECKING, + BankAccountHolderType.PERSONAL, + "payment_type2", + false, + 254 + ) + .build() + ) +``` + diff --git a/doc/models/containers/list-subscriptions-input-product.md b/doc/models/containers/list-subscriptions-input-product.md new file mode 100644 index 00000000..82d6ef49 --- /dev/null +++ b/doc/models/containers/list-subscriptions-input-product.md @@ -0,0 +1,38 @@ + +# List Subscriptions Input Product + +## Class Name + +`ListSubscriptionsInputProduct` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | ListSubscriptionsInputProduct.fromNumber(int number) | +| `String` | ListSubscriptionsInputProduct.fromString(String string) | + +## int + +### Initialization Code + +#### Example + +```java +ListSubscriptionsInputProduct.fromNumber( + 0 + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +ListSubscriptionsInputProduct.fromString( + "String0" + ) +``` + diff --git a/doc/models/containers/metered-usage-new-unit-balance.md b/doc/models/containers/metered-usage-new-unit-balance.md new file mode 100644 index 00000000..ac7a1915 --- /dev/null +++ b/doc/models/containers/metered-usage-new-unit-balance.md @@ -0,0 +1,38 @@ + +# Metered Usage New Unit Balance + +## Class Name + +`MeteredUsageNewUnitBalance` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | MeteredUsageNewUnitBalance.fromNumber(int number) | +| `String` | MeteredUsageNewUnitBalance.fromString(String string) | + +## int + +### Initialization Code + +#### Example + +```java +MeteredUsageNewUnitBalance.fromNumber( + 0 + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +MeteredUsageNewUnitBalance.fromString( + "String0" + ) +``` + diff --git a/doc/models/containers/prepaid-usage-new-overage-unit-balance.md b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md new file mode 100644 index 00000000..aa5263ab --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md @@ -0,0 +1,38 @@ + +# Prepaid Usage New Overage Unit Balance + +## Class Name + +`PrepaidUsageNewOverageUnitBalance` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | PrepaidUsageNewOverageUnitBalance.fromNumber(int number) | +| `String` | PrepaidUsageNewOverageUnitBalance.fromString(String string) | + +## int + +### Initialization Code + +#### Example + +```java +PrepaidUsageNewOverageUnitBalance.fromNumber( + 0 + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +PrepaidUsageNewOverageUnitBalance.fromString( + "String0" + ) +``` + diff --git a/doc/models/containers/prepaid-usage-new-unit-balance.md b/doc/models/containers/prepaid-usage-new-unit-balance.md new file mode 100644 index 00000000..86838470 --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-unit-balance.md @@ -0,0 +1,38 @@ + +# Prepaid Usage New Unit Balance + +## Class Name + +`PrepaidUsageNewUnitBalance` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | PrepaidUsageNewUnitBalance.fromNumber(int number) | +| `String` | PrepaidUsageNewUnitBalance.fromString(String string) | + +## int + +### Initialization Code + +#### Example + +```java +PrepaidUsageNewUnitBalance.fromNumber( + 0 + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +PrepaidUsageNewUnitBalance.fromString( + "String0" + ) +``` + diff --git a/doc/models/containers/subscription-component-unit-balance.md b/doc/models/containers/subscription-component-unit-balance.md new file mode 100644 index 00000000..7c3f86cb --- /dev/null +++ b/doc/models/containers/subscription-component-unit-balance.md @@ -0,0 +1,38 @@ + +# Subscription Component Unit Balance + +## Class Name + +`SubscriptionComponentUnitBalance` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | SubscriptionComponentUnitBalance.fromNumber(int number) | +| `String` | SubscriptionComponentUnitBalance.fromString(String string) | + +## int + +### Initialization Code + +#### Example + +```java +SubscriptionComponentUnitBalance.fromNumber( + 0 + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +SubscriptionComponentUnitBalance.fromString( + "String0" + ) +``` + diff --git a/doc/models/containers/update-invoice-item-component-id.md b/doc/models/containers/update-invoice-item-component-id.md new file mode 100644 index 00000000..44072e97 --- /dev/null +++ b/doc/models/containers/update-invoice-item-component-id.md @@ -0,0 +1,38 @@ + +# Update Invoice Item Component Id + +## Class Name + +`UpdateInvoiceItemComponentId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `String` | UpdateInvoiceItemComponentId.fromString(String string) | +| `int` | UpdateInvoiceItemComponentId.fromNumber(int number) | + +## String + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemComponentId.fromString( + "String0" + ) +``` + +## int + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemComponentId.fromNumber( + 0 + ) +``` + diff --git a/doc/models/containers/update-invoice-item-price-point-id.md b/doc/models/containers/update-invoice-item-price-point-id.md new file mode 100644 index 00000000..00c0dd61 --- /dev/null +++ b/doc/models/containers/update-invoice-item-price-point-id.md @@ -0,0 +1,38 @@ + +# Update Invoice Item Price Point Id + +## Class Name + +`UpdateInvoiceItemPricePointId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `String` | UpdateInvoiceItemPricePointId.fromString(String string) | +| `int` | UpdateInvoiceItemPricePointId.fromNumber(int number) | + +## String + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemPricePointId.fromString( + "String0" + ) +``` + +## int + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemPricePointId.fromNumber( + 0 + ) +``` + diff --git a/doc/models/containers/update-invoice-item-product-id.md b/doc/models/containers/update-invoice-item-product-id.md new file mode 100644 index 00000000..595925f4 --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-id.md @@ -0,0 +1,38 @@ + +# Update Invoice Item Product Id + +## Class Name + +`UpdateInvoiceItemProductId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `String` | UpdateInvoiceItemProductId.fromString(String string) | +| `int` | UpdateInvoiceItemProductId.fromNumber(int number) | + +## String + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemProductId.fromString( + "String0" + ) +``` + +## int + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemProductId.fromNumber( + 0 + ) +``` + diff --git a/doc/models/containers/update-invoice-item-product-price-point-id.md b/doc/models/containers/update-invoice-item-product-price-point-id.md new file mode 100644 index 00000000..128f6655 --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-price-point-id.md @@ -0,0 +1,38 @@ + +# Update Invoice Item Product Price Point Id + +## Class Name + +`UpdateInvoiceItemProductPricePointId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `String` | UpdateInvoiceItemProductPricePointId.fromString(String string) | +| `int` | UpdateInvoiceItemProductPricePointId.fromNumber(int number) | + +## String + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemProductPricePointId.fromString( + "String0" + ) +``` + +## int + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemProductPricePointId.fromNumber( + 0 + ) +``` + diff --git a/doc/models/containers/update-invoice-item-quantity.md b/doc/models/containers/update-invoice-item-quantity.md new file mode 100644 index 00000000..0a3e1e12 --- /dev/null +++ b/doc/models/containers/update-invoice-item-quantity.md @@ -0,0 +1,38 @@ + +# Update Invoice Item Quantity + +## Class Name + +`UpdateInvoiceItemQuantity` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `double` | UpdateInvoiceItemQuantity.fromPrecision(double precision) | +| `String` | UpdateInvoiceItemQuantity.fromString(String string) | + +## double + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemQuantity.fromPrecision( + 0D + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemQuantity.fromString( + "String0" + ) +``` + diff --git a/doc/models/containers/update-invoice-item-unit-price.md b/doc/models/containers/update-invoice-item-unit-price.md new file mode 100644 index 00000000..5878edb9 --- /dev/null +++ b/doc/models/containers/update-invoice-item-unit-price.md @@ -0,0 +1,38 @@ + +# Update Invoice Item Unit Price + +## Class Name + +`UpdateInvoiceItemUnitPrice` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `double` | UpdateInvoiceItemUnitPrice.fromPrecision(double precision) | +| `String` | UpdateInvoiceItemUnitPrice.fromString(String string) | + +## double + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemUnitPrice.fromPrecision( + 0D + ) +``` + +## String + +### Initialization Code + +#### Example + +```java +UpdateInvoiceItemUnitPrice.fromString( + "String0" + ) +``` + diff --git a/doc/models/contract.md b/doc/models/contract.md index 65fb7541..f1a877a8 100644 --- a/doc/models/contract.md +++ b/doc/models/contract.md @@ -16,19 +16,22 @@ Contract linked to the scheduled renewal configuration. | `Number` | `String` | Optional | - | String getNumber() | setNumber(String number) | | `Register` | [`Register`](../../doc/models/register.md) | Optional | - | Register getRegister() | setRegister(Register register) | -## Example (as JSON) - -```json -{ - "id": 136, - "maxio_id": "maxio_id8", - "number": "number6", - "register": { - "id": 54, - "maxio_id": "maxio_id4", - "name": "name2", - "currency_code": "currency_code2" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Contract; +import com.maxio.advancedbilling.models.Register; + +Contract contract = new Contract.Builder() + .id(112) + .maxioId("maxio_id6") + .number("number2") + .register(new Register.Builder() + .id(54) + .maxioId("maxio_id4") + .name("name2") + .currencyCode("currency_code2") + .build()) + .build(); ``` diff --git a/doc/models/count-response.md b/doc/models/count-response.md index c248c53c..075a0e24 100644 --- a/doc/models/count-response.md +++ b/doc/models/count-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `Count` | `Integer` | Optional | - | Integer getCount() | setCount(Integer count) | -## Example (as JSON) +## Example -```json -{ - "count": 60 -} +```java +import com.maxio.advancedbilling.models.CountResponse; + +CountResponse countResponse = new CountResponse.Builder() + .count(56) + .build(); ``` diff --git a/doc/models/coupon-currency-request.md b/doc/models/coupon-currency-request.md index de35d961..5f04047c 100644 --- a/doc/models/coupon-currency-request.md +++ b/doc/models/coupon-currency-request.md @@ -11,16 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `CurrencyPrices` | [`List`](../../doc/models/update-coupon-currency.md) | Required | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CouponCurrencyRequest; +import com.maxio.advancedbilling.models.UpdateCouponCurrency; +import java.util.Arrays; + +CouponCurrencyRequest couponCurrencyRequest = new CouponCurrencyRequest.Builder( + Arrays.asList( + new UpdateCouponCurrency.Builder( + "currency8", + 78 + ) + .build() + ) +) +.build(); ``` diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index 91f41548..1fa26244 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -11,30 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `CurrencyPrices` | [`List`](../../doc/models/coupon-currency.md) | Optional | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CouponCurrency; +import com.maxio.advancedbilling.models.CouponCurrencyResponse; +import java.util.Arrays; + +CouponCurrencyResponse couponCurrencyResponse = new CouponCurrencyResponse.Builder() + .currencyPrices(Arrays.asList( + new CouponCurrency.Builder() + .id(50) + .currency("currency8") + .price(233.74D) + .couponId(224) + .build() + )) + .build(); ``` diff --git a/doc/models/coupon-currency.md b/doc/models/coupon-currency.md index 3ad66f73..851ef092 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -14,14 +14,16 @@ | `Price` | `Double` | Optional | - | Double getPrice() | setPrice(Double price) | | `CouponId` | `Integer` | Optional | - | Integer getCouponId() | setCouponId(Integer couponId) | -## Example (as JSON) - -```json -{ - "id": 228, - "currency": "currency8", - "price": 169.96, - "coupon_id": 210 -} +## Example + +```java +import com.maxio.advancedbilling.models.CouponCurrency; + +CouponCurrency couponCurrency = new CouponCurrency.Builder() + .id(202) + .currency("currency0") + .price(14.62D) + .couponId(184) + .build(); ``` diff --git a/doc/models/coupon-payload.md b/doc/models/coupon-payload.md index ed5ccbcf..ab0a897c 100644 --- a/doc/models/coupon-payload.md +++ b/doc/models/coupon-payload.md @@ -10,10 +10,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Name` | `String` | Optional | Required when creating a new coupon. This name is not displayed to customers and is limited to 255 characters. | String getName() | setName(String name) | -| `Code` | `String` | Optional | Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | String getCode() | setCode(String code) | +| `Code` | `String` | Optional | Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.”. | String getCode() | setCode(String code) | | `Description` | `String` | Optional | Required when creating a new coupon. A description of the coupon that can be displayed to customers in transactions and on statements. The description is limited to 255 characters. | String getDescription() | setDescription(String description) | | `Percentage` | [`CouponPayloadPercentage`](../../doc/models/containers/coupon-payload-percentage.md) | Optional | This is a container for one-of cases. | CouponPayloadPercentage getPercentage() | setPercentage(CouponPayloadPercentage percentage) | -| `AmountInCents` | `Long` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount | Long getAmountInCents() | setAmountInCents(Long amountInCents) | +| `AmountInCents` | `Long` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount. | Long getAmountInCents() | setAmountInCents(Long amountInCents) | | `AllowNegativeBalance` | `Boolean` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. | Boolean getAllowNegativeBalance() | setAllowNegativeBalance(Boolean allowNegativeBalance) | | `Recurring` | `Boolean` | Optional | - | Boolean getRecurring() | setRecurring(Boolean recurring) | | `EndDate` | `LocalDate` | Optional | After the end of the given day, this coupon code will be invalid for new signups. Recurring discounts started before this date will continue to recur even after this date. | LocalDate getEndDate() | setEndDate(LocalDate endDate) | @@ -24,15 +24,20 @@ | `ApplyOnCancelAtEndOfPeriod` | `Boolean` | Optional | - | Boolean getApplyOnCancelAtEndOfPeriod() | setApplyOnCancelAtEndOfPeriod(Boolean applyOnCancelAtEndOfPeriod) | | `ApplyOnSubscriptionExpiration` | `Boolean` | Optional | - | Boolean getApplyOnSubscriptionExpiration() | setApplyOnSubscriptionExpiration(Boolean applyOnSubscriptionExpiration) | -## Example (as JSON) - -```json -{ - "name": "name8", - "code": "code6", - "description": "description8", - "percentage": "String7", - "amount_in_cents": 110 -} +## Example + +```java +import com.maxio.advancedbilling.models.CouponPayload; +import com.maxio.advancedbilling.models.containers.CouponPayloadPercentage; + +CouponPayload couponPayload = new CouponPayload.Builder() + .name("name8") + .code("code6") + .description("description2") + .percentage(CouponPayloadPercentage.fromString( + "String7" + )) + .amountInCents(124L) + .build(); ``` diff --git a/doc/models/coupon-request.md b/doc/models/coupon-request.md index 921e4931..88cc007a 100644 --- a/doc/models/coupon-request.md +++ b/doc/models/coupon-request.md @@ -10,26 +10,35 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Coupon` | [`CouponPayload`](../../doc/models/coupon-payload.md) | Optional | - | CouponPayload getCoupon() | setCoupon(CouponPayload coupon) | -| `RestrictedProducts` | `Map` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the product | Map getRestrictedProducts() | setRestrictedProducts(Map restrictedProducts) | -| `RestrictedComponents` | `Map` | Optional | An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component | Map getRestrictedComponents() | setRestrictedComponents(Map restrictedComponents) | - -## Example (as JSON) - -```json -{ - "coupon": { - "name": "name4", - "code": "code2", - "description": "description6", - "percentage": "String3", - "amount_in_cents": 230 - }, - "restricted_products": { - "key0": true - }, - "restricted_components": { - "key0": true - } -} +| `RestrictedProducts` | `Map` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the product. | Map getRestrictedProducts() | setRestrictedProducts(Map restrictedProducts) | +| `RestrictedComponents` | `Map` | Optional | An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component. | Map getRestrictedComponents() | setRestrictedComponents(Map restrictedComponents) | + +## Example + +```java +import com.maxio.advancedbilling.models.CouponPayload; +import com.maxio.advancedbilling.models.CouponRequest; +import com.maxio.advancedbilling.models.containers.CouponPayloadPercentage; +import java.util.LinkedHashMap; + +CouponRequest couponRequest = new CouponRequest.Builder() + .coupon(new CouponPayload.Builder() + .name("name4") + .code("code2") + .description("description6") + .percentage(CouponPayloadPercentage.fromString( + "String3" + )) + .amountInCents(230L) + .build()) + .restrictedProducts(new LinkedHashMap() {{ + put("key0", true); + put("key1", false); + }}) + .restrictedComponents(new LinkedHashMap() {{ + put("key0", true); + put("key1", false); + }}) + .build(); ``` diff --git a/doc/models/coupon-response.md b/doc/models/coupon-response.md index 0a97b312..fcb5bbf4 100644 --- a/doc/models/coupon-response.md +++ b/doc/models/coupon-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `Coupon` | [`Coupon`](../../doc/models/coupon.md) | Optional | - | Coupon getCoupon() | setCoupon(Coupon coupon) | -## Example (as JSON) - -```json -{ - "coupon": { - "id": 196, - "name": "name4", - "code": "code2", - "description": "description6", - "amount": 97.66 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Coupon; +import com.maxio.advancedbilling.models.CouponResponse; + +CouponResponse couponResponse = new CouponResponse.Builder() + .coupon(new Coupon.Builder() + .id(196) + .name("name4") + .code("code2") + .description("description6") + .amount(97.66D) + .build()) + .build(); ``` diff --git a/doc/models/coupon-restriction.md b/doc/models/coupon-restriction.md index 1624ea81..c09e8b70 100644 --- a/doc/models/coupon-restriction.md +++ b/doc/models/coupon-restriction.md @@ -15,15 +15,18 @@ | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | -## Example (as JSON) - -```json -{ - "id": 180, - "item_type": "Component", - "item_id": 184, - "name": "name4", - "handle": "handle0" -} +## Example + +```java +import com.maxio.advancedbilling.models.CouponRestriction; +import com.maxio.advancedbilling.models.RestrictionType; + +CouponRestriction couponRestriction = new CouponRestriction.Builder() + .id(66) + .itemType(RestrictionType.COMPONENT) + .itemId(214) + .name("name0") + .handle("handle6") + .build(); ``` diff --git a/doc/models/coupon-subcodes-response.md b/doc/models/coupon-subcodes-response.md index 33c30321..f03f974f 100644 --- a/doc/models/coupon-subcodes-response.md +++ b/doc/models/coupon-subcodes-response.md @@ -13,23 +13,23 @@ | `DuplicateCodes` | `List` | Optional | - | List getDuplicateCodes() | setDuplicateCodes(List duplicateCodes) | | `InvalidCodes` | `List` | Optional | - | List getInvalidCodes() | setInvalidCodes(List invalidCodes) | -## Example (as JSON) - -```json -{ - "created_codes": [ - "created_codes1", - "created_codes2" - ], - "duplicate_codes": [ - "duplicate_codes8", - "duplicate_codes7" - ], - "invalid_codes": [ - "invalid_codes0", - "invalid_codes9", - "invalid_codes8" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CouponSubcodesResponse; +import java.util.Arrays; + +CouponSubcodesResponse couponSubcodesResponse = new CouponSubcodesResponse.Builder() + .createdCodes(Arrays.asList( + "created_codes7" + )) + .duplicateCodes(Arrays.asList( + "duplicate_codes8" + )) + .invalidCodes(Arrays.asList( + "invalid_codes4", + "invalid_codes3" + )) + .build(); ``` diff --git a/doc/models/coupon-subcodes.md b/doc/models/coupon-subcodes.md index 160525de..ac4f439e 100644 --- a/doc/models/coupon-subcodes.md +++ b/doc/models/coupon-subcodes.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | --- | --- | | `Codes` | `List` | Optional | - | List getCodes() | setCodes(List codes) | -## Example (as JSON) - -```json -{ - "codes": [ - "codes8" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CouponSubcodes; +import java.util.Arrays; + +CouponSubcodes couponSubcodes = new CouponSubcodes.Builder() + .codes(Arrays.asList( + "codes8", + "codes9" + )) + .build(); ``` diff --git a/doc/models/coupon-usage.md b/doc/models/coupon-usage.md index ac5f8641..470b5d15 100644 --- a/doc/models/coupon-usage.md +++ b/doc/models/coupon-usage.md @@ -14,18 +14,20 @@ | `Signups` | `Integer` | Optional | Number of times the coupon has been applied | Integer getSignups() | setSignups(Integer signups) | | `Savings` | `Integer` | Optional | Dollar amount of customer savings as a result of the coupon. | Integer getSavings() | setSavings(Integer savings) | | `SavingsInCents` | `Long` | Optional | Dollar amount of customer savings as a result of the coupon. | Long getSavingsInCents() | setSavingsInCents(Long savingsInCents) | -| `Revenue` | `Integer` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | Integer getRevenue() | setRevenue(Integer revenue) | -| `RevenueInCents` | `Long` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | Long getRevenueInCents() | setRevenueInCents(Long revenueInCents) | - -## Example (as JSON) - -```json -{ - "id": 14, - "name": "name0", - "signups": 34, - "savings": 52, - "savings_in_cents": 138 -} +| `Revenue` | `Integer` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | Integer getRevenue() | setRevenue(Integer revenue) | +| `RevenueInCents` | `Long` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | Long getRevenueInCents() | setRevenueInCents(Long revenueInCents) | + +## Example + +```java +import com.maxio.advancedbilling.models.CouponUsage; + +CouponUsage couponUsage = new CouponUsage.Builder() + .id(240) + .name("name8") + .signups(4) + .savings(22) + .savingsInCents(108L) + .build(); ``` diff --git a/doc/models/coupon.md b/doc/models/coupon.md index f9fa6b73..b7995599 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -41,15 +41,17 @@ | `CouponRestrictions` | [`List`](../../doc/models/coupon-restriction.md) | Optional | - | List getCouponRestrictions() | setCouponRestrictions(List couponRestrictions) | | `CurrencyPrices` | [`List`](../../doc/models/coupon-currency.md) | Optional | Returned in read, find, and list endpoints if the query parameter is provided. | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "id": 22, - "name": "name2", - "code": "code0", - "description": "description2", - "amount": 62.64 -} +## Example + +```java +import com.maxio.advancedbilling.models.Coupon; + +Coupon coupon = new Coupon.Builder() + .id(196) + .name("name4") + .code("code2") + .description("description6") + .amount(97.66D) + .build(); ``` diff --git a/doc/models/create-allocation-request.md b/doc/models/create-allocation-request.md index 1fbe5aa8..47f43e0c 100644 --- a/doc/models/create-allocation-request.md +++ b/doc/models/create-allocation-request.md @@ -11,18 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `Allocation` | [`CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | CreateAllocation getAllocation() | setAllocation(CreateAllocation allocation) | -## Example (as JSON) - -```json -{ - "allocation": { - "quantity": 228.94, - "decimal_quantity": "decimal_quantity6", - "previous_quantity": 254.04, - "decimal_previous_quantity": "decimal_previous_quantity8", - "component_id": 8, - "memo": "memo2" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateAllocation; +import com.maxio.advancedbilling.models.CreateAllocationRequest; + +CreateAllocationRequest createAllocationRequest = new CreateAllocationRequest.Builder( + new CreateAllocation.Builder( + 228.94D + ) + .decimalQuantity("decimal_quantity6") + .previousQuantity(254.04D) + .decimalPreviousQuantity("decimal_previous_quantity8") + .componentId(8) + .memo("memo2") + .build() +) +.build(); ``` diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 7f2cb0ed..d79e0231 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Quantity` | `double` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1for on and 0 for off. | double getQuantity() | setQuantity(double quantity) | +| `Quantity` | `double` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1 for on and 0 for off. | double getQuantity() | setQuantity(double quantity) | | `DecimalQuantity` | `String` | Optional | Decimal representation of the allocated quantity. Only valid when decimal
allocations are enabled for the component. | String getDecimalQuantity() | setDecimalQuantity(String decimalQuantity) | | `PreviousQuantity` | `Double` | Optional | The quantity that was in effect before this allocation. Responses always
include this value; it may be supplied on preview requests to ensure the
expected change is evaluated. | Double getPreviousQuantity() | setPreviousQuantity(Double previousQuantity) | | `DecimalPreviousQuantity` | `String` | Optional | Decimal representation of `previous_quantity`. Only valid when decimal
allocations are enabled for the component. | String getDecimalPreviousQuantity() | setDecimalPreviousQuantity(String decimalPreviousQuantity) | @@ -25,16 +25,19 @@ | `BillingSchedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | BillingSchedule getBillingSchedule() | setBillingSchedule(BillingSchedule billingSchedule) | | `CustomPrice` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ComponentCustomPrice getCustomPrice() | setCustomPrice(ComponentCustomPrice customPrice) | -## Example (as JSON) - -```json -{ - "quantity": 8.06, - "decimal_quantity": "decimal_quantity4", - "previous_quantity": 218.92, - "decimal_previous_quantity": "decimal_previous_quantity0", - "component_id": 192, - "memo": "memo4" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateAllocation; + +CreateAllocation createAllocation = new CreateAllocation.Builder( + 6.56D +) +.decimalQuantity("decimal_quantity6") +.previousQuantity(35.58D) +.decimalPreviousQuantity("decimal_previous_quantity0") +.componentId(42) +.memo("memo4") +.build(); ``` diff --git a/doc/models/create-component-price-point-request.md b/doc/models/create-component-price-point-request.md index bab2a103..ac2849eb 100644 --- a/doc/models/create-component-price-point-request.md +++ b/doc/models/create-component-price-point-request.md @@ -11,26 +11,48 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`CreateComponentPricePointRequestPricePoint`](../../doc/models/containers/create-component-price-point-request-price-point.md) | Required | This is a container for any-of cases. | CreateComponentPricePointRequestPricePoint getPricePoint() | setPricePoint(CreateComponentPricePointRequestPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateComponentPricePoint; +import com.maxio.advancedbilling.models.CreateComponentPricePointRequest; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.CreateComponentPricePointRequestPricePoint; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateComponentPricePointRequest createComponentPricePointRequest = new CreateComponentPricePointRequest.Builder( + CreateComponentPricePointRequestPricePoint.fromCreateComponentPricePoint( + new CreateComponentPricePoint.Builder( + "name0", + PricingScheme.PER_UNIT, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .handle("handle6") + .useSiteExchangeRate(true) + .taxIncluded(false) + .interval(24) + .intervalUnit(IntervalUnit.DAY) + .build() + ) +) +.build(); ``` diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index b0906f8e..558d6c49 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -15,27 +15,44 @@ | `Prices` | [`List`](../../doc/models/price.md) | Required | - | List getPrices() | setPrices(List prices) | | `UseSiteExchangeRate` | `Boolean` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk.

**Default**: `true` | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `TaxIncluded` | `Boolean` | Optional | Whether or not the price point includes tax. Setting not supported when creating price points in bulk. | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | -## Example (as JSON) - -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateComponentPricePoint; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateComponentPricePoint createComponentPricePoint = new CreateComponentPricePoint.Builder( + "name4", + PricingScheme.PER_UNIT, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) +) +.handle("handle0") +.useSiteExchangeRate(true) +.taxIncluded(false) +.interval(140) +.intervalUnit(IntervalUnit.DAY) +.build(); ``` diff --git a/doc/models/create-component-price-points-request.md b/doc/models/create-component-price-points-request.md index 7b4a02b9..0009f6bc 100644 --- a/doc/models/create-component-price-points-request.md +++ b/doc/models/create-component-price-points-request.md @@ -11,64 +11,74 @@ | --- | --- | --- | --- | --- | --- | | `PricePoints` | [`List`](../../doc/models/containers/create-component-price-points-request-price-points.md) | Required | This is List of a container for any-of cases. | List getPricePoints() | setPricePoints(List pricePoints) | -## Example (as JSON) +## Example -```json -{ - "price_points": [ - { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - }, - { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } - ] -} +```java +import com.maxio.advancedbilling.models.CreateComponentPricePoint; +import com.maxio.advancedbilling.models.CreateComponentPricePointsRequest; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.CreateComponentPricePointsRequestPricePoints; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateComponentPricePointsRequest createComponentPricePointsRequest = new CreateComponentPricePointsRequest.Builder( + Arrays.asList( + CreateComponentPricePointsRequestPricePoints.fromCreateComponentPricePoint( + new CreateComponentPricePoint.Builder( + "name0", + PricingScheme.PER_UNIT, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .handle("handle6") + .useSiteExchangeRate(false) + .taxIncluded(false) + .interval(24) + .intervalUnit(IntervalUnit.DAY) + .build() + ) + ) +) +.build(); ``` diff --git a/doc/models/create-credit-note-event.md b/doc/models/create-credit-note-event.md index 8e067ff9..aa81cf5b 100644 --- a/doc/models/create-credit-note-event.md +++ b/doc/models/create-credit-note-event.md @@ -15,31 +15,38 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.CREATE_CREDIT_NOTE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`CreditNote`](../../doc/models/credit-note.md) | Required | Example schema for an `create_credit_note` event | CreditNote getEventData() | setEventData(CreditNote eventData) | -## Example (as JSON) - -```json -{ - "id": 28, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "create_credit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": "number6" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreateCreditNoteEvent; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; + +CreateCreditNoteEvent createCreditNoteEvent = new CreateCreditNoteEvent.Builder( + 82L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.CREATE_CREDIT_NOTE, + new CreditNote.Builder() + .uid("uid6") + .siteId(132) + .customerId(244) + .subscriptionId(60) + .number("number6") + .build() +) +.build(); ``` diff --git a/doc/models/create-currency-price.md b/doc/models/create-currency-price.md index b7728d3b..13339aa0 100644 --- a/doc/models/create-currency-price.md +++ b/doc/models/create-currency-price.md @@ -13,13 +13,15 @@ | `Price` | `Double` | Optional | Price for the price level in this currency | Double getPrice() | setPrice(Double price) | | `PriceId` | `Integer` | Optional | ID of the price that this corresponds with | Integer getPriceId() | setPriceId(Integer priceId) | -## Example (as JSON) - -```json -{ - "currency": "currency2", - "price": 10.4, - "price_id": 54 -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateCurrencyPrice; + +CreateCurrencyPrice createCurrencyPrice = new CreateCurrencyPrice.Builder() + .currency("currency2") + .price(54.8D) + .priceId(142) + .build(); ``` diff --git a/doc/models/create-currency-prices-request.md b/doc/models/create-currency-prices-request.md index 917b23a7..f7844162 100644 --- a/doc/models/create-currency-prices-request.md +++ b/doc/models/create-currency-prices-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `CurrencyPrices` | [`List`](../../doc/models/create-currency-price.md) | Required | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 233.74, - "price_id": 116 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateCurrencyPrice; +import com.maxio.advancedbilling.models.CreateCurrencyPricesRequest; +import java.util.Arrays; + +CreateCurrencyPricesRequest createCurrencyPricesRequest = new CreateCurrencyPricesRequest.Builder( + Arrays.asList( + new CreateCurrencyPrice.Builder() + .currency("currency8") + .price(233.74D) + .priceId(116) + .build() + ) +) +.build(); ``` diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md index 23b9f567..2f8cc476 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -11,20 +11,25 @@ | --- | --- | --- | --- | --- | --- | | `Customer` | [`CreateCustomer`](../../doc/models/create-customer.md) | Required | - | CreateCustomer getCustomer() | setCustomer(CreateCustomer customer) | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6", - "reference": "reference4", - "address": "address6", - "address_2": "address_24" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateCustomer; +import com.maxio.advancedbilling.models.CreateCustomerRequest; + +CreateCustomerRequest createCustomerRequest = new CreateCustomerRequest.Builder( + new CreateCustomer.Builder( + "first_name0", + "last_name8", + "email6" + ) + .ccEmails("cc_emails0") + .organization("organization6") + .reference("reference4") + .address("address6") + .address2("address_24") + .build() +) +.build(); ``` diff --git a/doc/models/create-customer.md b/doc/models/create-customer.md index abdd068d..df247925 100644 --- a/doc/models/create-customer.md +++ b/doc/models/create-customer.md @@ -25,22 +25,27 @@ | `Locale` | `String` | Optional | Set a specific language on a customer record. | String getLocale() | setLocale(String locale) | | `VatNumber` | `String` | Optional | - | String getVatNumber() | setVatNumber(String vatNumber) | | `TaxExempt` | `Boolean` | Optional | - | Boolean getTaxExempt() | setTaxExempt(Boolean taxExempt) | +| `Surcharging` | `Boolean` | Optional | Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | Boolean getSurcharging() | setSurcharging(Boolean surcharging) | | `TaxExemptReason` | `String` | Optional | - | String getTaxExemptReason() | setTaxExemptReason(String taxExemptReason) | | `ParentId` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | Integer getParentId() | setParentId(Integer parentId) | | `SalesforceId` | `String` | Optional | The Salesforce ID of the customer | String getSalesforceId() | setSalesforceId(String salesforceId) | - -## Example (as JSON) - -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails8", - "organization": "organization2", - "reference": "reference4", - "address": "address4", - "address_2": "address_22" -} +| `BrandingThemeId` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | Integer getBrandingThemeId() | setBrandingThemeId(Integer brandingThemeId) | + +## Example + +```java +import com.maxio.advancedbilling.models.CreateCustomer; + +CreateCustomer createCustomer = new CreateCustomer.Builder( + "first_name0", + "last_name8", + "email6" +) +.ccEmails("cc_emails0") +.organization("organization6") +.reference("reference4") +.address("address6") +.address2("address_24") +.build(); ``` diff --git a/doc/models/create-debit-note-event.md b/doc/models/create-debit-note-event.md index 1cfce375..a6bc87ee 100644 --- a/doc/models/create-debit-note-event.md +++ b/doc/models/create-debit-note-event.md @@ -15,31 +15,38 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.CREATE_DEBIT_NOTE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`DebitNote`](../../doc/models/debit-note.md) | Required | Example schema for an `create_debit_note` event | DebitNote getEventData() | setEventData(DebitNote eventData) | -## Example (as JSON) - -```json -{ - "id": 98, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "create_debit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": 64 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreateDebitNoteEvent; +import com.maxio.advancedbilling.models.DebitNote; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; + +CreateDebitNoteEvent createDebitNoteEvent = new CreateDebitNoteEvent.Builder( + 176L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.CREATE_DEBIT_NOTE, + new DebitNote.Builder() + .uid("uid6") + .siteId(132) + .customerId(244) + .subscriptionId(60) + .number(64) + .build() +) +.build(); ``` diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index 4e6400ec..9fda0199 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -11,35 +11,55 @@ | --- | --- | --- | --- | --- | --- | | `EventBasedComponent` | [`EBBComponent`](../../doc/models/ebb-component.md) | Required | - | EBBComponent getEventBasedComponent() | setEventBasedComponent(EBBComponent eventBasedComponent) | -## Example (as JSON) - -```json -{ - "event_based_component": { - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ], - "event_based_billing_metric_id": 68 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePointItem; +import com.maxio.advancedbilling.models.CreateEBBComponent; +import com.maxio.advancedbilling.models.EBBComponent; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateEBBComponent createEBBComponent = new CreateEBBComponent.Builder( + new EBBComponent.Builder( + "name8", + "unit_name0", + PricingScheme.STAIRSTEP, + 68 + ) + .description("description8") + .handle("handle4") + .taxable(false) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .pricePoints(Arrays.asList( + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build() + )) + .build() +) +.build(); ``` diff --git a/doc/models/create-invoice-address.md b/doc/models/create-invoice-address.md index b6b49988..711bf1dd 100644 --- a/doc/models/create-invoice-address.md +++ b/doc/models/create-invoice-address.md @@ -21,15 +21,17 @@ Overrides the default address. | `Zip` | `String` | Optional | - | String getZip() | setZip(String zip) | | `Country` | `String` | Optional | - | String getCountry() | setCountry(String country) | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "phone": "phone6", - "address": "address0", - "address_2": "address_28" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateInvoiceAddress; + +CreateInvoiceAddress createInvoiceAddress = new CreateInvoiceAddress.Builder() + .firstName("first_name6") + .lastName("last_name4") + .phone("phone4") + .address("address2") + .address2("address_20") + .build(); ``` diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index 5474b9bf..48fa9afc 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -17,15 +17,23 @@ | `ProductFamilyId` | [`CreateInvoiceCouponProductFamilyId`](../../doc/models/containers/create-invoice-coupon-product-family-id.md) | Optional | This is a container for one-of cases. | CreateInvoiceCouponProductFamilyId getProductFamilyId() | setProductFamilyId(CreateInvoiceCouponProductFamilyId productFamilyId) | | `CompoundingStrategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. | CompoundingStrategy getCompoundingStrategy() | setCompoundingStrategy(CompoundingStrategy compoundingStrategy) | -## Example (as JSON) - -```json -{ - "percentage": 50.0, - "code": "code4", - "subcode": "subcode8", - "amount": "String9", - "description": "description4" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateInvoiceCoupon; +import com.maxio.advancedbilling.models.containers.CreateInvoiceCouponAmount; +import com.maxio.advancedbilling.models.containers.CreateInvoiceCouponPercentage; + +CreateInvoiceCoupon createInvoiceCoupon = new CreateInvoiceCoupon.Builder() + .code("code8") + .subcode("subcode4") + .percentage(CreateInvoiceCouponPercentage.fromPrecision( + 50D + )) + .amount(CreateInvoiceCouponAmount.fromString( + "String9" + )) + .description("description0") + .build(); ``` diff --git a/doc/models/create-invoice-item.md b/doc/models/create-invoice-item.md index 6b1836eb..692f7947 100644 --- a/doc/models/create-invoice-item.md +++ b/doc/models/create-invoice-item.md @@ -22,15 +22,23 @@ | `ProductPricePointId` | [`CreateInvoiceItemProductPricePointId`](../../doc/models/containers/create-invoice-item-product-price-point-id.md) | Optional | This is a container for one-of cases. | CreateInvoiceItemProductPricePointId getProductPricePointId() | setProductPricePointId(CreateInvoiceItemProductPricePointId productPricePointId) | | `Description` | `String` | Optional | **Constraints**: *Maximum Length*: `255` | String getDescription() | setDescription(String description) | -## Example (as JSON) - -```json -{ - "title": "title2", - "quantity": 154.86, - "unit_price": 138.08, - "taxable": false, - "tax_code": "tax_code4" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateInvoiceItem; +import com.maxio.advancedbilling.models.containers.CreateInvoiceItemQuantity; +import com.maxio.advancedbilling.models.containers.CreateInvoiceItemUnitPrice; + +CreateInvoiceItem createInvoiceItem = new CreateInvoiceItem.Builder() + .title("title8") + .quantity(CreateInvoiceItemQuantity.fromPrecision( + 107.22D + )) + .unitPrice(CreateInvoiceItemUnitPrice.fromPrecision( + 90.44D + )) + .taxable(false) + .taxCode("tax_code0") + .build(); ``` diff --git a/doc/models/create-invoice-payment-application.md b/doc/models/create-invoice-payment-application.md index 0513fd92..d705ed51 100644 --- a/doc/models/create-invoice-payment-application.md +++ b/doc/models/create-invoice-payment-application.md @@ -12,12 +12,15 @@ | `InvoiceUid` | `String` | Required | Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. | String getInvoiceUid() | setInvoiceUid(String invoiceUid) | | `Amount` | `String` | Required | Dollar amount of the invoice payment (eg. "10.50" => $10.50). | String getAmount() | setAmount(String amount) | -## Example (as JSON) +## Example -```json -{ - "invoice_uid": "invoice_uid4", - "amount": "amount6" -} +```java +import com.maxio.advancedbilling.models.CreateInvoicePaymentApplication; + +CreateInvoicePaymentApplication createInvoicePaymentApplication = new CreateInvoicePaymentApplication.Builder( + "invoice_uid6", + "amount8" +) +.build(); ``` diff --git a/doc/models/create-invoice-payment-request.md b/doc/models/create-invoice-payment-request.md index 500896a5..c0af3625 100644 --- a/doc/models/create-invoice-payment-request.md +++ b/doc/models/create-invoice-payment-request.md @@ -12,18 +12,27 @@ | `Payment` | [`CreateInvoicePayment`](../../doc/models/create-invoice-payment.md) | Required | - | CreateInvoicePayment getPayment() | setPayment(CreateInvoicePayment payment) | | `Type` | [`InvoicePaymentType`](../../doc/models/invoice-payment-type.md) | Optional | The type of payment to be applied to an Invoice. Defaults to external. | InvoicePaymentType getType() | setType(InvoicePaymentType type) | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "memo": "memo0", - "method": "ach", - "details": "details6", - "payment_profile_id": 42 - }, - "type": "external" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateInvoicePayment; +import com.maxio.advancedbilling.models.CreateInvoicePaymentRequest; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; +import com.maxio.advancedbilling.models.InvoicePaymentType; +import com.maxio.advancedbilling.models.containers.CreateInvoicePaymentAmount; + +CreateInvoicePaymentRequest createInvoicePaymentRequest = new CreateInvoicePaymentRequest.Builder( + new CreateInvoicePayment.Builder() + .amount(CreateInvoicePaymentAmount.fromString( + "String9" + )) + .memo("memo0") + .method(InvoicePaymentMethodType.ACH) + .details("details6") + .paymentProfileId(42) + .build() +) +.type(InvoicePaymentType.EXTERNAL) +.build(); ``` diff --git a/doc/models/create-invoice-payment.md b/doc/models/create-invoice-payment.md index c100eca9..9fe626e6 100644 --- a/doc/models/create-invoice-payment.md +++ b/doc/models/create-invoice-payment.md @@ -16,15 +16,21 @@ | `PaymentProfileId` | `Integer` | Optional | The ID of the payment profile to be used for the payment. | Integer getPaymentProfileId() | setPaymentProfileId(Integer paymentProfileId) | | `ReceivedOn` | `LocalDate` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | LocalDate getReceivedOn() | setReceivedOn(LocalDate receivedOn) | -## Example (as JSON) - -```json -{ - "amount": "String9", - "memo": "memo0", - "method": "cash", - "details": "details6", - "payment_profile_id": 122 -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateInvoicePayment; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; +import com.maxio.advancedbilling.models.containers.CreateInvoicePaymentAmount; + +CreateInvoicePayment createInvoicePayment = new CreateInvoicePayment.Builder() + .amount(CreateInvoicePaymentAmount.fromString( + "String7" + )) + .memo("memo8") + .method(InvoicePaymentMethodType.ACH) + .details("details4") + .paymentProfileId(30) + .build(); ``` diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md index 1100b583..f1c18da6 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -11,40 +11,62 @@ | --- | --- | --- | --- | --- | --- | | `Invoice` | [`CreateInvoice`](../../doc/models/create-invoice.md) | Required | - | CreateInvoice getInvoice() | setInvoice(CreateInvoice invoice) | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - } - ], - "net_terms": 144, - "payment_instructions": "payment_instructions6", - "memo": "memo0" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreateInvoice; +import com.maxio.advancedbilling.models.CreateInvoiceItem; +import com.maxio.advancedbilling.models.CreateInvoiceRequest; +import com.maxio.advancedbilling.models.CreateInvoiceStatus; +import com.maxio.advancedbilling.models.containers.CreateInvoiceItemQuantity; +import com.maxio.advancedbilling.models.containers.CreateInvoiceItemUnitPrice; +import java.util.Arrays; + +CreateInvoiceRequest createInvoiceRequest = new CreateInvoiceRequest.Builder( + new CreateInvoice.Builder() + .lineItems(Arrays.asList( + new CreateInvoiceItem.Builder() + .title("title4") + .quantity(CreateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(CreateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build(), + new CreateInvoiceItem.Builder() + .title("title4") + .quantity(CreateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(CreateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build(), + new CreateInvoiceItem.Builder() + .title("title4") + .quantity(CreateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(CreateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build() + )) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .netTerms(144) + .paymentInstructions("payment_instructions6") + .memo("memo0") + .status(CreateInvoiceStatus.DRAFT) + .build() +) +.build(); ``` diff --git a/doc/models/create-invoice-status.md b/doc/models/create-invoice-status.md index 73171a87..91ecf88b 100644 --- a/doc/models/create-invoice-status.md +++ b/doc/models/create-invoice-status.md @@ -14,7 +14,9 @@ ## Example -``` -draft +```java +import com.maxio.advancedbilling.models.CreateInvoiceStatus; + +CreateInvoiceStatus createInvoiceStatus = CreateInvoiceStatus.DRAFT; ``` diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index dc481c49..292a237b 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -14,30 +14,53 @@ | `NetTerms` | `Integer` | Optional | By default, invoices will be created with a due date matching the date of invoice creation. If a different due date is desired, the net_terms parameter can be sent indicating the number of days in advance the due date should be. | Integer getNetTerms() | setNetTerms(Integer netTerms) | | `PaymentInstructions` | `String` | Optional | - | String getPaymentInstructions() | setPaymentInstructions(String paymentInstructions) | | `Memo` | `String` | Optional | A custom memo can be sent to override the site's default. | String getMemo() | setMemo(String memo) | -| `SellerAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site | CreateInvoiceAddress getSellerAddress() | setSellerAddress(CreateInvoiceAddress sellerAddress) | -| `BillingAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | CreateInvoiceAddress getBillingAddress() | setBillingAddress(CreateInvoiceAddress billingAddress) | -| `ShippingAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | CreateInvoiceAddress getShippingAddress() | setShippingAddress(CreateInvoiceAddress shippingAddress) | +| `SellerAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site. | CreateInvoiceAddress getSellerAddress() | setSellerAddress(CreateInvoiceAddress sellerAddress) | +| `BillingAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | CreateInvoiceAddress getBillingAddress() | setBillingAddress(CreateInvoiceAddress billingAddress) | +| `ShippingAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | CreateInvoiceAddress getShippingAddress() | setShippingAddress(CreateInvoiceAddress shippingAddress) | | `Coupons` | [`List`](../../doc/models/create-invoice-coupon.md) | Optional | - | List getCoupons() | setCoupons(List coupons) | | `Status` | [`CreateInvoiceStatus`](../../doc/models/create-invoice-status.md) | Optional | **Default**: `CreateInvoiceStatus.OPEN` | CreateInvoiceStatus getStatus() | setStatus(CreateInvoiceStatus status) | -## Example (as JSON) - -```json -{ - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - } - ], - "net_terms": 18, - "payment_instructions": "payment_instructions0", - "memo": "memo6" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreateInvoice; +import com.maxio.advancedbilling.models.CreateInvoiceItem; +import com.maxio.advancedbilling.models.CreateInvoiceStatus; +import com.maxio.advancedbilling.models.containers.CreateInvoiceItemQuantity; +import com.maxio.advancedbilling.models.containers.CreateInvoiceItemUnitPrice; +import java.util.Arrays; + +CreateInvoice createInvoice = new CreateInvoice.Builder() + .lineItems(Arrays.asList( + new CreateInvoiceItem.Builder() + .title("title4") + .quantity(CreateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(CreateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build(), + new CreateInvoiceItem.Builder() + .title("title4") + .quantity(CreateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(CreateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build() + )) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .netTerms(202) + .paymentInstructions("payment_instructions2") + .memo("memo8") + .status(CreateInvoiceStatus.DRAFT) + .build(); ``` diff --git a/doc/models/create-metadata-request.md b/doc/models/create-metadata-request.md index 89926a6d..1bd04ab3 100644 --- a/doc/models/create-metadata-request.md +++ b/doc/models/create-metadata-request.md @@ -11,16 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Metadata` | [`List`](../../doc/models/create-metadata.md) | Required | - | List getMetadata() | setMetadata(List metadata) | -## Example (as JSON) - -```json -{ - "metadata": [ - { - "name": "name6", - "value": "value8" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateMetadata; +import com.maxio.advancedbilling.models.CreateMetadataRequest; +import java.util.Arrays; + +CreateMetadataRequest createMetadataRequest = new CreateMetadataRequest.Builder( + Arrays.asList( + new CreateMetadata.Builder() + .name("name6") + .value("value8") + .build() + ) +) +.build(); ``` diff --git a/doc/models/create-metadata.md b/doc/models/create-metadata.md index 672921cd..6b99cbcb 100644 --- a/doc/models/create-metadata.md +++ b/doc/models/create-metadata.md @@ -12,12 +12,14 @@ | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Value` | `String` | Optional | - | String getValue() | setValue(String value) | -## Example (as JSON) +## Example -```json -{ - "name": "name4", - "value": "value6" -} +```java +import com.maxio.advancedbilling.models.CreateMetadata; + +CreateMetadata createMetadata = new CreateMetadata.Builder() + .name("name0") + .value("value2") + .build(); ``` diff --git a/doc/models/create-metafield.md b/doc/models/create-metafield.md index 995f35d7..2affac62 100644 --- a/doc/models/create-metafield.md +++ b/doc/models/create-metafield.md @@ -11,26 +11,32 @@ | --- | --- | --- | --- | --- | --- | | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | MetafieldScope getScope() | setScope(MetafieldScope scope) | -| `InputType` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | MetafieldInput getInputType() | setInputType(MetafieldInput inputType) | +| `InputType` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | MetafieldInput getInputType() | setInputType(MetafieldInput inputType) | | `Enum` | `List` | Optional | Only applicable when input_type is radio or dropdown. Empty strings will not be submitted. | List getEnum() | setEnum(List mEnum) | -## Example (as JSON) - -```json -{ - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" - }, - "input_type": "text", - "enum": [ - "string" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateMetafield; +import com.maxio.advancedbilling.models.IncludeOption; +import com.maxio.advancedbilling.models.MetafieldInput; +import com.maxio.advancedbilling.models.MetafieldScope; +import java.util.Arrays; + +CreateMetafield createMetafield = new CreateMetafield.Builder() + .name("my_field") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .publicEdit(IncludeOption.EXCLUDE) + .build()) + .inputType(MetafieldInput.TEXT) + .mEnum(Arrays.asList( + "string" + )) + .build(); ``` diff --git a/doc/models/create-metafields-request.md b/doc/models/create-metafields-request.md index 5ac0fd69..880d9ff7 100644 --- a/doc/models/create-metafields-request.md +++ b/doc/models/create-metafields-request.md @@ -11,25 +11,36 @@ | --- | --- | --- | --- | --- | --- | | `Metafields` | [`CreateMetafieldsRequestMetafields`](../../doc/models/containers/create-metafields-request-metafields.md) | Required | This is a container for one-of cases. | CreateMetafieldsRequestMetafields getMetafields() | setMetafields(CreateMetafieldsRequestMetafields metafields) | -## Example (as JSON) - -```json -{ - "metafields": { - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" - }, - "input_type": "text", - "enum": [ - "string" - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateMetafield; +import com.maxio.advancedbilling.models.CreateMetafieldsRequest; +import com.maxio.advancedbilling.models.IncludeOption; +import com.maxio.advancedbilling.models.MetafieldInput; +import com.maxio.advancedbilling.models.MetafieldScope; +import com.maxio.advancedbilling.models.containers.CreateMetafieldsRequestMetafields; +import java.util.Arrays; + +CreateMetafieldsRequest createMetafieldsRequest = new CreateMetafieldsRequest.Builder( + CreateMetafieldsRequestMetafields.fromCreateMetafield( + new CreateMetafield.Builder() + .name("my_field") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .publicEdit(IncludeOption.EXCLUDE) + .build()) + .inputType(MetafieldInput.TEXT) + .mEnum(Arrays.asList( + "string" + )) + .build() + ) +) +.build(); ``` diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index d63bd22c..d8ee04e9 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -11,58 +11,92 @@ | --- | --- | --- | --- | --- | --- | | `MeteredComponent` | [`MeteredComponent`](../../doc/models/metered-component.md) | Required | - | MeteredComponent getMeteredComponent() | setMeteredComponent(MeteredComponent meteredComponent) | -## Example (as JSON) +## Example -```json -{ - "metered_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - }, - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - }, - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ] - } -} +```java +import com.maxio.advancedbilling.models.ComponentPricePointItem; +import com.maxio.advancedbilling.models.CreateMeteredComponent; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.MeteredComponent; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateMeteredComponent createMeteredComponent = new CreateMeteredComponent.Builder( + new MeteredComponent.Builder( + "name0", + "unit_name2", + PricingScheme.STAIRSTEP + ) + .description("description0") + .handle("handle6") + .taxable(false) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .pricePoints(Arrays.asList( + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build(), + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build(), + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build() + )) + .build() +) +.build(); ``` diff --git a/doc/models/create-multi-invoice-payment-request.md b/doc/models/create-multi-invoice-payment-request.md index 02e5dd48..2ba90425 100644 --- a/doc/models/create-multi-invoice-payment-request.md +++ b/doc/models/create-multi-invoice-payment-request.md @@ -11,23 +11,35 @@ | --- | --- | --- | --- | --- | --- | | `Payment` | [`CreateMultiInvoicePayment`](../../doc/models/create-multi-invoice-payment.md) | Required | - | CreateMultiInvoicePayment getPayment() | setPayment(CreateMultiInvoicePayment payment) | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } - ], - "memo": "memo0", - "details": "details6", - "method": "ach", - "received_on": "received_on8" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateInvoicePaymentApplication; +import com.maxio.advancedbilling.models.CreateMultiInvoicePayment; +import com.maxio.advancedbilling.models.CreateMultiInvoicePaymentRequest; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; +import com.maxio.advancedbilling.models.containers.CreateMultiInvoicePaymentAmount; +import java.util.Arrays; + +CreateMultiInvoicePaymentRequest createMultiInvoicePaymentRequest = new CreateMultiInvoicePaymentRequest.Builder( + new CreateMultiInvoicePayment.Builder( + CreateMultiInvoicePaymentAmount.fromString( + "String9" + ), + Arrays.asList( + new CreateInvoicePaymentApplication.Builder( + "invoice_uid8", + "amount0" + ) + .build() + ) + ) + .memo("memo0") + .details("details6") + .method(InvoicePaymentMethodType.ACH) + .receivedOn("received_on8") + .build() +) +.build(); ``` diff --git a/doc/models/create-multi-invoice-payment.md b/doc/models/create-multi-invoice-payment.md index 48a5bd47..fe6031d3 100644 --- a/doc/models/create-multi-invoice-payment.md +++ b/doc/models/create-multi-invoice-payment.md @@ -16,21 +16,31 @@ | `ReceivedOn` | `String` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. | String getReceivedOn() | setReceivedOn(String receivedOn) | | `Applications` | [`List`](../../doc/models/create-invoice-payment-application.md) | Required | - | List getApplications() | setApplications(List applications) | -## Example (as JSON) - -```json -{ - "amount": "String7", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } - ], - "memo": "memo8", - "details": "details4", - "method": "credit_card", - "received_on": "received_on6" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateInvoicePaymentApplication; +import com.maxio.advancedbilling.models.CreateMultiInvoicePayment; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; +import com.maxio.advancedbilling.models.containers.CreateMultiInvoicePaymentAmount; +import java.util.Arrays; + +CreateMultiInvoicePayment createMultiInvoicePayment = new CreateMultiInvoicePayment.Builder( + CreateMultiInvoicePaymentAmount.fromString( + "String9" + ), + Arrays.asList( + new CreateInvoicePaymentApplication.Builder( + "invoice_uid8", + "amount0" + ) + .build() + ) +) +.memo("memo0") +.details("details6") +.method(InvoicePaymentMethodType.ACH) +.receivedOn("received_on8") +.build(); ``` diff --git a/doc/models/create-offer-component.md b/doc/models/create-offer-component.md index d72b27f0..01d40096 100644 --- a/doc/models/create-offer-component.md +++ b/doc/models/create-offer-component.md @@ -13,13 +13,15 @@ | `PricePointId` | `Integer` | Optional | - | Integer getPricePointId() | setPricePointId(Integer pricePointId) | | `StartingQuantity` | `Integer` | Optional | - | Integer getStartingQuantity() | setStartingQuantity(Integer startingQuantity) | -## Example (as JSON) - -```json -{ - "component_id": 242, - "price_point_id": 10, - "starting_quantity": 50 -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOfferComponent; + +CreateOfferComponent createOfferComponent = new CreateOfferComponent.Builder() + .componentId(252) + .pricePointId(20) + .startingQuantity(196) + .build(); ``` diff --git a/doc/models/create-offer-request.md b/doc/models/create-offer-request.md index 0510d2f1..eb1b6479 100644 --- a/doc/models/create-offer-request.md +++ b/doc/models/create-offer-request.md @@ -11,32 +11,39 @@ | --- | --- | --- | --- | --- | --- | | `Offer` | [`CreateOffer`](../../doc/models/create-offer.md) | Required | - | CreateOffer getOffer() | setOffer(CreateOffer offer) | -## Example (as JSON) - -```json -{ - "offer": { - "name": "name4", - "handle": "handle0", - "description": "description6", - "product_id": 30, - "product_price_point_id": 150, - "components": [ - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - }, - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - } - ], - "coupons": [ - "coupons6" - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOffer; +import com.maxio.advancedbilling.models.CreateOfferComponent; +import com.maxio.advancedbilling.models.CreateOfferRequest; +import java.util.Arrays; + +CreateOfferRequest createOfferRequest = new CreateOfferRequest.Builder( + new CreateOffer.Builder( + "name4", + "handle0", + 30 + ) + .description("description6") + .productPricePointId(150) + .components(Arrays.asList( + new CreateOfferComponent.Builder() + .componentId(108) + .pricePointId(124) + .startingQuantity(84) + .build(), + new CreateOfferComponent.Builder() + .componentId(108) + .pricePointId(124) + .startingQuantity(84) + .build() + )) + .coupons(Arrays.asList( + "coupons6" + )) + .build() +) +.build(); ``` diff --git a/doc/models/create-offer.md b/doc/models/create-offer.md index c4232341..987c9319 100644 --- a/doc/models/create-offer.md +++ b/doc/models/create-offer.md @@ -17,30 +17,42 @@ | `Components` | [`List`](../../doc/models/create-offer-component.md) | Optional | - | List getComponents() | setComponents(List components) | | `Coupons` | `List` | Optional | - | List getCoupons() | setCoupons(List coupons) | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "description": "description4", - "product_id": 208, - "product_price_point_id": 132, - "components": [ - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - }, - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - } - ], - "coupons": [ - "coupons4" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOffer; +import com.maxio.advancedbilling.models.CreateOfferComponent; +import java.util.Arrays; + +CreateOffer createOffer = new CreateOffer.Builder( + "name6", + "handle2", + 66 +) +.description("description6") +.productPricePointId(246) +.components(Arrays.asList( + new CreateOfferComponent.Builder() + .componentId(108) + .pricePointId(124) + .startingQuantity(84) + .build(), + new CreateOfferComponent.Builder() + .componentId(108) + .pricePointId(124) + .startingQuantity(84) + .build(), + new CreateOfferComponent.Builder() + .componentId(108) + .pricePointId(124) + .startingQuantity(84) + .build() + )) +.coupons(Arrays.asList( + "coupons6", + "coupons5", + "coupons4" + )) +.build(); ``` diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index 02987f59..8c8d6746 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -11,19 +11,28 @@ | --- | --- | --- | --- | --- | --- | | `OnOffComponent` | [`OnOffComponent`](../../doc/models/on-off-component.md) | Required | - | OnOffComponent getOnOffComponent() | setOnOffComponent(OnOffComponent onOffComponent) | -## Example (as JSON) - -```json -{ - "on_off_component": { - "name": "name6", - "description": "description6", - "handle": "handle2", - "taxable": false, - "upgrade_charge": "full", - "downgrade_credit": "full", - "unit_price": "String5" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOnOffComponent; +import com.maxio.advancedbilling.models.CreditType; +import com.maxio.advancedbilling.models.OnOffComponent; +import com.maxio.advancedbilling.models.containers.OnOffComponentUnitPrice; + +CreateOnOffComponent createOnOffComponent = new CreateOnOffComponent.Builder( + new OnOffComponent.Builder( + "name6", + OnOffComponentUnitPrice.fromString( + "String5" + ) + ) + .description("description6") + .handle("handle2") + .taxable(false) + .upgradeCharge(CreditType.FULL) + .downgradeCredit(CreditType.FULL) + .build() +) +.build(); ``` diff --git a/doc/models/create-or-update-endpoint-request.md b/doc/models/create-or-update-endpoint-request.md index b0e8f542..a35c8bdd 100644 --- a/doc/models/create-or-update-endpoint-request.md +++ b/doc/models/create-or-update-endpoint-request.md @@ -1,7 +1,7 @@ # Create or Update Endpoint Request -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -11,18 +11,25 @@ Used to Create or Update Endpoint | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint | CreateOrUpdateEndpoint getEndpoint() | setEndpoint(CreateOrUpdateEndpoint endpoint) | - -## Example (as JSON) - -```json -{ - "endpoint": { - "url": "url2", - "webhook_subscriptions": [ - "subscription_prepayment_account_balance_changed" - ] - } -} +| `Endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint. | CreateOrUpdateEndpoint getEndpoint() | setEndpoint(CreateOrUpdateEndpoint endpoint) | + +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateEndpoint; +import com.maxio.advancedbilling.models.CreateOrUpdateEndpointRequest; +import com.maxio.advancedbilling.models.WebhookSubscription; +import java.util.Arrays; + +CreateOrUpdateEndpointRequest createOrUpdateEndpointRequest = new CreateOrUpdateEndpointRequest.Builder( + new CreateOrUpdateEndpoint.Builder( + "url2", + Arrays.asList( + WebhookSubscription.STATEMENT_CLOSED + ) + ) + .build() +) +.build(); ``` diff --git a/doc/models/create-or-update-endpoint.md b/doc/models/create-or-update-endpoint.md index 686f4657..0b5ceb06 100644 --- a/doc/models/create-or-update-endpoint.md +++ b/doc/models/create-or-update-endpoint.md @@ -1,7 +1,7 @@ # Create or Update Endpoint -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -14,14 +14,21 @@ Used to Create or Update Endpoint | `Url` | `String` | Required | - | String getUrl() | setUrl(String url) | | `WebhookSubscriptions` | [`List`](../../doc/models/webhook-subscription.md) | Required | - | List getWebhookSubscriptions() | setWebhookSubscriptions(List webhookSubscriptions) | -## Example (as JSON) - -```json -{ - "url": "url8", - "webhook_subscriptions": [ - "refund_success" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateEndpoint; +import com.maxio.advancedbilling.models.WebhookSubscription; +import java.util.Arrays; + +CreateOrUpdateEndpoint createOrUpdateEndpoint = new CreateOrUpdateEndpoint.Builder( + "url4", + Arrays.asList( + WebhookSubscription.TRIAL_END_NOTICE, + WebhookSubscription.SUBSCRIPTION_STATE_CHANGE, + WebhookSubscription.SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED + ) +) +.build(); ``` diff --git a/doc/models/create-or-update-product-request.md b/doc/models/create-or-update-product-request.md index c61d350a..fb06e1c2 100644 --- a/doc/models/create-or-update-product-request.md +++ b/doc/models/create-or-update-product-request.md @@ -11,22 +11,28 @@ | --- | --- | --- | --- | --- | --- | | `Product` | [`CreateOrUpdateProduct`](../../doc/models/create-or-update-product.md) | Required | - | CreateOrUpdateProduct getProduct() | setProduct(CreateOrUpdateProduct product) | -## Example (as JSON) - -```json -{ - "product": { - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6", - "require_credit_card": false, - "price_in_cents": 54, - "interval": 186, - "interval_unit": "day", - "trial_price_in_cents": 34, - "trial_interval": 88 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateProduct; +import com.maxio.advancedbilling.models.CreateOrUpdateProductRequest; +import com.maxio.advancedbilling.models.IntervalUnit; + +CreateOrUpdateProductRequest createOrUpdateProductRequest = new CreateOrUpdateProductRequest.Builder( + new CreateOrUpdateProduct.Builder( + "name0", + "description0", + 54L, + 186, + IntervalUnit.DAY + ) + .handle("handle6") + .accountingCode("accounting_code6") + .requireCreditCard(false) + .trialPriceInCents(34L) + .trialInterval(88) + .build() +) +.build(); ``` diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index 38de720a..183ba3f4 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -15,31 +15,36 @@ | `AccountingCode` | `String` | Optional | E.g. Internal ID or SKU Number | String getAccountingCode() | setAccountingCode(String accountingCode) | | `RequireCreditCard` | `Boolean` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | Boolean getRequireCreditCard() | setRequireCreditCard(Boolean requireCreditCard) | | `PriceInCents` | `long` | Required | The product price, in integer cents | long getPriceInCents() | setPriceInCents(long priceInCents) | -| `Interval` | `int` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | int getInterval() | setInterval(int interval) | +| `Interval` | `int` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | int getInterval() | setInterval(int interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `TrialPriceInCents` | `Long` | Optional | The product trial price, in integer cents | Long getTrialPriceInCents() | setTrialPriceInCents(Long trialPriceInCents) | -| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | +| `TrialInterval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | | `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | -| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | -| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | +| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | | `AutoCreateSignupPage` | `Boolean` | Optional | - | Boolean getAutoCreateSignupPage() | setAutoCreateSignupPage(Boolean autoCreateSignupPage) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | String getTaxCode() | setTaxCode(String taxCode) | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "description": "description8", - "accounting_code": "accounting_code4", - "require_credit_card": false, - "price_in_cents": 190, - "interval": 174, - "interval_unit": "day", - "trial_price_in_cents": 22, - "trial_interval": 76 -} +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | + +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateProduct; +import com.maxio.advancedbilling.models.IntervalUnit; + +CreateOrUpdateProduct createOrUpdateProduct = new CreateOrUpdateProduct.Builder( + "name6", + "description4", + 138L, + 154, + IntervalUnit.DAY +) +.handle("handle2") +.accountingCode("accounting_code2") +.requireCreditCard(false) +.trialPriceInCents(50L) +.trialInterval(252) +.build(); ``` diff --git a/doc/models/create-or-update-segment-price.md b/doc/models/create-or-update-segment-price.md index 166de5a3..de35b0e9 100644 --- a/doc/models/create-or-update-segment-price.md +++ b/doc/models/create-or-update-segment-price.md @@ -13,13 +13,19 @@ | `EndingQuantity` | `Integer` | Optional | - | Integer getEndingQuantity() | setEndingQuantity(Integer endingQuantity) | | `UnitPrice` | [`CreateOrUpdateSegmentPriceUnitPrice`](../../doc/models/containers/create-or-update-segment-price-unit-price.md) | Required | This is a container for one-of cases. | CreateOrUpdateSegmentPriceUnitPrice getUnitPrice() | setUnitPrice(CreateOrUpdateSegmentPriceUnitPrice unitPrice) | -## Example (as JSON) - -```json -{ - "starting_quantity": 78, - "ending_quantity": 52, - "unit_price": "String7" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; + +CreateOrUpdateSegmentPrice createOrUpdateSegmentPrice = new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String9" + ) +) +.startingQuantity(98) +.endingQuantity(184) +.build(); ``` diff --git a/doc/models/create-payment-profile-request.md b/doc/models/create-payment-profile-request.md index daad234f..922461bd 100644 --- a/doc/models/create-payment-profile-request.md +++ b/doc/models/create-payment-profile-request.md @@ -11,18 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `PaymentProfile` | [`CreatePaymentProfile`](../../doc/models/create-payment-profile.md) | Required | - | CreatePaymentProfile getPaymentProfile() | setPaymentProfile(CreatePaymentProfile paymentProfile) | -## Example (as JSON) - -```json -{ - "payment_profile": { - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 44, - "payment_type": "credit_card", - "first_name": "first_name4", - "last_name": "last_name2" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreatePaymentProfile; +import com.maxio.advancedbilling.models.CreatePaymentProfileRequest; +import com.maxio.advancedbilling.models.PaymentType; + +CreatePaymentProfileRequest createPaymentProfileRequest = new CreatePaymentProfileRequest.Builder( + new CreatePaymentProfile.Builder() + .chargifyToken("tok_9g6hw85pnpt6knmskpwp4ttt") + .id(44) + .paymentType(PaymentType.CREDIT_CARD) + .firstName("first_name4") + .lastName("last_name2") + .fullNumber("5424000000000015") + .build() +) +.build(); ``` diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index cf17c648..cb188bd8 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -19,12 +19,12 @@ | `CardType` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | CardType getCardType() | setCardType(CardType cardType) | | `ExpirationMonth` | [`CreatePaymentProfileExpirationMonth`](../../doc/models/containers/create-payment-profile-expiration-month.md) | Optional | This is a container for one-of cases. | CreatePaymentProfileExpirationMonth getExpirationMonth() | setExpirationMonth(CreatePaymentProfileExpirationMonth expirationMonth) | | `ExpirationYear` | [`CreatePaymentProfileExpirationYear`](../../doc/models/containers/create-payment-profile-expiration-year.md) | Optional | This is a container for one-of cases. | CreatePaymentProfileExpirationYear getExpirationYear() | setExpirationYear(CreatePaymentProfileExpirationYear expirationYear) | -| `BillingAddress` | `String` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | String getBillingAddress() | setBillingAddress(String billingAddress) | -| `BillingAddress2` | `String` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | -| `BillingCity` | `String` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | String getBillingCity() | setBillingCity(String billingCity) | -| `BillingState` | `String` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | String getBillingState() | setBillingState(String billingState) | -| `BillingCountry` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | String getBillingCountry() | setBillingCountry(String billingCountry) | -| `BillingZip` | `String` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | String getBillingZip() | setBillingZip(String billingZip) | +| `BillingAddress` | `String` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | String getBillingAddress() | setBillingAddress(String billingAddress) | +| `BillingAddress2` | `String` | Optional | Second line of the customer’s billing address e.g., Apt. 100 | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | +| `BillingCity` | `String` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | String getBillingCity() | setBillingCity(String billingCity) | +| `BillingState` | `String` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | String getBillingState() | setBillingState(String billingState) | +| `BillingCountry` | `String` | Optional | “The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.” | String getBillingCountry() | setBillingCountry(String billingCountry) | +| `BillingZip` | `String` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | String getBillingZip() | setBillingZip(String billingZip) | | `CurrentVault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | AllVaults getCurrentVault() | setCurrentVault(AllVaults currentVault) | | `VaultToken` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | String getVaultToken() | setVaultToken(String vaultToken) | | `CustomerVaultToken` | `String` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | String getCustomerVaultToken() | setCustomerVaultToken(String customerVaultToken) | @@ -34,24 +34,27 @@ | `GatewayHandle` | `String` | Optional | This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | | `Cvv` | `String` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | String getCvv() | setCvv(String cvv) | | `BankName` | `String` | Optional | (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides | String getBankName() | setBankName(String bankName) | -| `BankIban` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided | String getBankIban() | setBankIban(String bankIban) | -| `BankRoutingNumber` | `String` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | String getBankRoutingNumber() | setBankRoutingNumber(String bankRoutingNumber) | +| `BankIban` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided. | String getBankIban() | setBankIban(String bankIban) | +| `BankRoutingNumber` | `String` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | String getBankRoutingNumber() | setBankRoutingNumber(String bankRoutingNumber) | | `BankAccountNumber` | `String` | Optional | (Required when creating with ACH, GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban is blank) The customerʼs bank account number | String getBankAccountNumber() | setBankAccountNumber(String bankAccountNumber) | -| `BankBranchCode` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided | String getBankBranchCode() | setBankBranchCode(String bankBranchCode) | +| `BankBranchCode` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided. | String getBankBranchCode() | setBankBranchCode(String bankBranchCode) | | `BankAccountType` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | BankAccountType getBankAccountType() | setBankAccountType(BankAccountType bankAccountType) | | `BankAccountHolderType` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | BankAccountHolderType getBankAccountHolderType() | setBankAccountHolderType(BankAccountHolderType bankAccountHolderType) | | `LastFour` | `String` | Optional | (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI | String getLastFour() | setLastFour(String lastFour) | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 76, - "payment_type": "credit_card", - "first_name": "first_name8", - "last_name": "last_name6" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreatePaymentProfile; +import com.maxio.advancedbilling.models.PaymentType; + +CreatePaymentProfile createPaymentProfile = new CreatePaymentProfile.Builder() + .chargifyToken("tok_9g6hw85pnpt6knmskpwp4ttt") + .id(124) + .paymentType(PaymentType.CREDIT_CARD) + .firstName("first_name6") + .lastName("last_name4") + .fullNumber("5424000000000015") + .build(); ``` diff --git a/doc/models/create-payment.md b/doc/models/create-payment.md index 7b678716..aa02365c 100644 --- a/doc/models/create-payment.md +++ b/doc/models/create-payment.md @@ -14,14 +14,18 @@ | `PaymentDetails` | `String` | Required | - | String getPaymentDetails() | setPaymentDetails(String paymentDetails) | | `PaymentMethod` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | The type of payment method used. Defaults to other. | InvoicePaymentMethodType getPaymentMethod() | setPaymentMethod(InvoicePaymentMethodType paymentMethod) | -## Example (as JSON) - -```json -{ - "amount": "amount6", - "memo": "memo8", - "payment_details": "payment_details4", - "payment_method": "cash" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreatePayment; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; + +CreatePayment createPayment = new CreatePayment.Builder( + "amount6", + "memo8", + "payment_details4", + InvoicePaymentMethodType.CREDIT_CARD +) +.build(); ``` diff --git a/doc/models/create-prepaid-component.md b/doc/models/create-prepaid-component.md index 9bbe884c..b47b1f17 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -11,36 +11,64 @@ | --- | --- | --- | --- | --- | --- | | `PrepaidUsageComponent` | [`PrepaidUsageComponent`](../../doc/models/prepaid-usage-component.md) | Required | - | PrepaidUsageComponent getPrepaidUsageComponent() | setPrepaidUsageComponent(PrepaidUsageComponent prepaidUsageComponent) | -## Example (as JSON) - -```json -{ - "prepaid_usage_component": { - "name": "name2", - "unit_name": "unit_name4", - "description": "description2", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "full", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreatePrepaidComponent; +import com.maxio.advancedbilling.models.CreditType; +import com.maxio.advancedbilling.models.OveragePricing; +import com.maxio.advancedbilling.models.PrepaidUsageComponent; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreatePrepaidComponent createPrepaidComponent = new CreatePrepaidComponent.Builder( + new PrepaidUsageComponent.Builder( + "name2", + "unit_name4", + PricingScheme.PER_UNIT, + new OveragePricing.Builder( + PricingScheme.STAIRSTEP + ) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .build() + ) + .description("description2") + .handle("handle8") + .taxable(false) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .upgradeCharge(CreditType.FULL) + .build() +) +.build(); ``` diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index fa2629a9..e583661b 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -15,39 +15,64 @@ | `Prices` | [`List`](../../doc/models/price.md) | Required | - | List getPrices() | setPrices(List prices) | | `OveragePricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | OveragePricing getOveragePricing() | setOveragePricing(OveragePricing overagePricing) | | `UseSiteExchangeRate` | `Boolean` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.

**Default**: `true` | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | -| `RolloverPrepaidRemainder` | `Boolean` | Optional | (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period | Boolean getRolloverPrepaidRemainder() | setRolloverPrepaidRemainder(Boolean rolloverPrepaidRemainder) | -| `RenewPrepaidAllocation` | `Boolean` | Optional | (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | Boolean getRenewPrepaidAllocation() | setRenewPrepaidAllocation(Boolean renewPrepaidAllocation) | -| `ExpirationInterval` | `Double` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | Double getExpirationInterval() | setExpirationInterval(Double expirationInterval) | -| `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | - -## Example (as JSON) - -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - "use_site_exchange_rate": true, - "handle": "handle6", - "rollover_prepaid_remainder": false, - "renew_prepaid_allocation": false, - "expiration_interval": 101.18 -} +| `RolloverPrepaidRemainder` | `Boolean` | Optional | (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period. | Boolean getRolloverPrepaidRemainder() | setRolloverPrepaidRemainder(Boolean rolloverPrepaidRemainder) | +| `RenewPrepaidAllocation` | `Boolean` | Optional | (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. | Boolean getRenewPrepaidAllocation() | setRenewPrepaidAllocation(Boolean renewPrepaidAllocation) | +| `ExpirationInterval` | `Double` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire. | Double getExpirationInterval() | setExpirationInterval(Double expirationInterval) | +| `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day. | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | + +## Example + +```java +import com.maxio.advancedbilling.models.CreatePrepaidUsageComponentPricePoint; +import com.maxio.advancedbilling.models.OveragePricing; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreatePrepaidUsageComponentPricePoint createPrepaidUsageComponentPricePoint = new CreatePrepaidUsageComponentPricePoint.Builder( + "name2", + PricingScheme.PER_UNIT, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ), + new OveragePricing.Builder( + PricingScheme.STAIRSTEP + ) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .build() +) +.handle("handle8") +.useSiteExchangeRate(true) +.rolloverPrepaidRemainder(false) +.renewPrepaidAllocation(false) +.expirationInterval(165.7D) +.build(); ``` diff --git a/doc/models/create-prepayment-method.md b/doc/models/create-prepayment-method.md index 2b0a9c05..9d046bbc 100644 --- a/doc/models/create-prepayment-method.md +++ b/doc/models/create-prepayment-method.md @@ -1,7 +1,7 @@ # Create Prepayment Method -:- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. +When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. ## Enumeration @@ -20,3 +20,11 @@ | `CREDIT_CARD_ON_FILE` | | `OTHER` | +## Example + +```java +import com.maxio.advancedbilling.models.CreatePrepaymentMethod; + +CreatePrepaymentMethod createPrepaymentMethod = CreatePrepaymentMethod.CHECK; +``` + diff --git a/doc/models/create-prepayment-request.md b/doc/models/create-prepayment-request.md index 5bfcb6c9..63ba3340 100644 --- a/doc/models/create-prepayment-request.md +++ b/doc/models/create-prepayment-request.md @@ -11,17 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `Prepayment` | [`CreatePrepayment`](../../doc/models/create-prepayment.md) | Required | - | CreatePrepayment getPrepayment() | setPrepayment(CreatePrepayment prepayment) | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 11.6, - "details": "details8", - "memo": "memo2", - "method": "money_order", - "payment_profile_id": 240 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreatePrepayment; +import com.maxio.advancedbilling.models.CreatePrepaymentMethod; +import com.maxio.advancedbilling.models.CreatePrepaymentRequest; + +CreatePrepaymentRequest createPrepaymentRequest = new CreatePrepaymentRequest.Builder( + new CreatePrepayment.Builder( + 11.6D, + "details8", + "memo2", + CreatePrepaymentMethod.MONEY_ORDER + ) + .paymentProfileId(240) + .build() +) +.build(); ``` diff --git a/doc/models/create-prepayment-response.md b/doc/models/create-prepayment-response.md index caaa3a3a..30e9c89c 100644 --- a/doc/models/create-prepayment-response.md +++ b/doc/models/create-prepayment-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Prepayment` | [`CreatedPrepayment`](../../doc/models/created-prepayment.md) | Required | - | CreatedPrepayment getPrepayment() | setPrepayment(CreatedPrepayment prepayment) | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreatePrepaymentResponse; +import com.maxio.advancedbilling.models.CreatedPrepayment; + +CreatePrepaymentResponse createPrepaymentResponse = new CreatePrepaymentResponse.Builder( + new CreatedPrepayment.Builder() + .id(38L) + .subscriptionId(148) + .amountInCents(124L) + .memo("memo2") + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() +) +.build(); ``` diff --git a/doc/models/create-prepayment.md b/doc/models/create-prepayment.md index 31e25660..3b0b43a9 100644 --- a/doc/models/create-prepayment.md +++ b/doc/models/create-prepayment.md @@ -12,18 +12,22 @@ | `Amount` | `double` | Required | - | double getAmount() | setAmount(double amount) | | `Details` | `String` | Required | - | String getDetails() | setDetails(String details) | | `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | -| `Method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | CreatePrepaymentMethod getMethod() | setMethod(CreatePrepaymentMethod method) | +| `Method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | CreatePrepaymentMethod getMethod() | setMethod(CreatePrepaymentMethod method) | | `PaymentProfileId` | `Integer` | Optional | - | Integer getPaymentProfileId() | setPaymentProfileId(Integer paymentProfileId) | -## Example (as JSON) +## Example -```json -{ - "amount": 23.92, - "details": "details6", - "memo": "memo0", - "method": "credit_card_on_file", - "payment_profile_id": 240 -} +```java +import com.maxio.advancedbilling.models.CreatePrepayment; +import com.maxio.advancedbilling.models.CreatePrepaymentMethod; + +CreatePrepayment createPrepayment = new CreatePrepayment.Builder( + 73.78D, + "details6", + "memo0", + CreatePrepaymentMethod.PAYPAL_ACCOUNT +) +.paymentProfileId(58) +.build(); ``` diff --git a/doc/models/create-product-currency-price.md b/doc/models/create-product-currency-price.md index ef0ce246..8fd9b747 100644 --- a/doc/models/create-product-currency-price.md +++ b/doc/models/create-product-currency-price.md @@ -13,13 +13,17 @@ | `Price` | `int` | Required | Price for the given role. | int getPrice() | setPrice(int price) | | `Role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Required | Role for the price. | CurrencyPriceRole getRole() | setRole(CurrencyPriceRole role) | -## Example (as JSON) - -```json -{ - "currency": "currency0", - "price": 222, - "role": "baseline" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateProductCurrencyPrice; +import com.maxio.advancedbilling.models.CurrencyPriceRole; + +CreateProductCurrencyPrice createProductCurrencyPrice = new CreateProductCurrencyPrice.Builder( + "currency2", + 78, + CurrencyPriceRole.BASELINE +) +.build(); ``` diff --git a/doc/models/create-product-currency-prices-request.md b/doc/models/create-product-currency-prices-request.md index a22f38c5..764c4758 100644 --- a/doc/models/create-product-currency-prices-request.md +++ b/doc/models/create-product-currency-prices-request.md @@ -11,17 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `CurrencyPrices` | [`List`](../../doc/models/create-product-currency-price.md) | Required | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78, - "role": "initial" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateProductCurrencyPrice; +import com.maxio.advancedbilling.models.CreateProductCurrencyPricesRequest; +import com.maxio.advancedbilling.models.CurrencyPriceRole; +import java.util.Arrays; + +CreateProductCurrencyPricesRequest createProductCurrencyPricesRequest = new CreateProductCurrencyPricesRequest.Builder( + Arrays.asList( + new CreateProductCurrencyPrice.Builder( + "currency8", + 78, + CurrencyPriceRole.INITIAL + ) + .build() + ) +) +.build(); ``` diff --git a/doc/models/create-product-family-request.md b/doc/models/create-product-family-request.md index 6c2b1894..97ad9e8d 100644 --- a/doc/models/create-product-family-request.md +++ b/doc/models/create-product-family-request.md @@ -11,15 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `ProductFamily` | [`CreateProductFamily`](../../doc/models/create-product-family.md) | Required | - | CreateProductFamily getProductFamily() | setProductFamily(CreateProductFamily productFamily) | -## Example (as JSON) - -```json -{ - "product_family": { - "name": "name0", - "handle": "handle6", - "description": "description0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateProductFamily; +import com.maxio.advancedbilling.models.CreateProductFamilyRequest; + +CreateProductFamilyRequest createProductFamilyRequest = new CreateProductFamilyRequest.Builder( + new CreateProductFamily.Builder( + "name0" + ) + .handle("handle6") + .description("description0") + .surcharging(false) + .build() +) +.build(); ``` diff --git a/doc/models/create-product-family.md b/doc/models/create-product-family.md index db87891b..667f4021 100644 --- a/doc/models/create-product-family.md +++ b/doc/models/create-product-family.md @@ -12,14 +12,19 @@ | `Name` | `String` | Required | - | String getName() | setName(String name) | | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | | `Description` | `String` | Optional | - | String getDescription() | setDescription(String description) | +| `Surcharging` | `Boolean` | Optional | Whether surcharging applies to this product family. Defaults to `true` when omitted. Only applied on sites where surcharging is enabled. | Boolean getSurcharging() | setSurcharging(Boolean surcharging) | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "description": "description6" -} +```java +import com.maxio.advancedbilling.models.CreateProductFamily; + +CreateProductFamily createProductFamily = new CreateProductFamily.Builder( + "name0" +) +.handle("handle6") +.description("description0") +.surcharging(false) +.build(); ``` diff --git a/doc/models/create-product-price-point-request.md b/doc/models/create-product-price-point-request.md index fc40ac36..8584be63 100644 --- a/doc/models/create-product-price-point-request.md +++ b/doc/models/create-product-price-point-request.md @@ -11,22 +11,29 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`CreateProductPricePoint`](../../doc/models/create-product-price-point.md) | Required | - | CreateProductPricePoint getPricePoint() | setPricePoint(CreateProductPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "price_in_cents": 196, - "interval": 44, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle6", - "trial_price_in_cents": 108, - "trial_interval": 202, - "trial_interval_unit": "day", - "trial_type": "no_obligation" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateProductPricePoint; +import com.maxio.advancedbilling.models.CreateProductPricePointRequest; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.TrialType; + +CreateProductPricePointRequest createProductPricePointRequest = new CreateProductPricePointRequest.Builder( + new CreateProductPricePoint.Builder( + "name0", + 196L, + 44, + IntervalUnit.DAY + ) + .handle("handle6") + .trialPriceInCents(108L) + .trialInterval(202) + .trialIntervalUnit(IntervalUnit.DAY) + .trialType(TrialType.NO_OBLIGATION) + .useSiteExchangeRate(true) + .build() +) +.build(); ``` diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 1d6c2c71..7b268e9d 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -12,32 +12,37 @@ | `Name` | `String` | Required | The product price point name | String getName() | setName(String name) | | `Handle` | `String` | Optional | The product price point API handle | String getHandle() | setHandle(String handle) | | `PriceInCents` | `long` | Required | The product price point price, in integer cents | long getPriceInCents() | setPriceInCents(long priceInCents) | -| `Interval` | `int` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | int getInterval() | setInterval(int interval) | +| `Interval` | `int` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | int getInterval() | setInterval(int interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product price point, either month or day | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `TrialPriceInCents` | `Long` | Optional | The product price point trial price, in integer cents | Long getTrialPriceInCents() | setTrialPriceInCents(Long trialPriceInCents) | -| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | +| `TrialInterval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | | `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | -| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | +| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | | `InitialChargeInCents` | `Long` | Optional | The product price point initial charge, in integer cents | Long getInitialChargeInCents() | setInitialChargeInCents(Long initialChargeInCents) | | `InitialChargeAfterTrial` | `Boolean` | Optional | - | Boolean getInitialChargeAfterTrial() | setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) | -| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | | `UseSiteExchangeRate` | `Boolean` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.

**Default**: `true` | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | -## Example (as JSON) - -```json -{ - "name": "name6", - "price_in_cents": 216, - "interval": 200, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle2", - "trial_price_in_cents": 48, - "trial_interval": 102, - "trial_interval_unit": "day", - "trial_type": "no_obligation" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateProductPricePoint; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.TrialType; + +CreateProductPricePoint createProductPricePoint = new CreateProductPricePoint.Builder( + "name6", + 180L, + 60, + IntervalUnit.DAY +) +.handle("handle2") +.trialPriceInCents(92L) +.trialInterval(218) +.trialIntervalUnit(IntervalUnit.DAY) +.trialType(TrialType.NO_OBLIGATION) +.useSiteExchangeRate(true) +.build(); ``` diff --git a/doc/models/create-quantity-based-component.md b/doc/models/create-quantity-based-component.md index 7f768358..f573ad72 100644 --- a/doc/models/create-quantity-based-component.md +++ b/doc/models/create-quantity-based-component.md @@ -11,31 +11,57 @@ | --- | --- | --- | --- | --- | --- | | `QuantityBasedComponent` | [`QuantityBasedComponent`](../../doc/models/quantity-based-component.md) | Required | - | QuantityBasedComponent getQuantityBasedComponent() | setQuantityBasedComponent(QuantityBasedComponent quantityBasedComponent) | -## Example (as JSON) - -```json -{ - "quantity_based_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "prorated" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateQuantityBasedComponent; +import com.maxio.advancedbilling.models.CreditType; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.QuantityBasedComponent; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateQuantityBasedComponent createQuantityBasedComponent = new CreateQuantityBasedComponent.Builder( + new QuantityBasedComponent.Builder( + "name0", + "unit_name2", + PricingScheme.STAIRSTEP + ) + .description("description0") + .handle("handle6") + .taxable(false) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .upgradeCharge(CreditType.PRORATED) + .build() +) +.build(); ``` diff --git a/doc/models/create-reason-code-request.md b/doc/models/create-reason-code-request.md index e81af257..54b1836f 100644 --- a/doc/models/create-reason-code-request.md +++ b/doc/models/create-reason-code-request.md @@ -11,15 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `ReasonCode` | [`CreateReasonCode`](../../doc/models/create-reason-code.md) | Required | - | CreateReasonCode getReasonCode() | setReasonCode(CreateReasonCode reasonCode) | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateReasonCode; +import com.maxio.advancedbilling.models.CreateReasonCodeRequest; + +CreateReasonCodeRequest createReasonCodeRequest = new CreateReasonCodeRequest.Builder( + new CreateReasonCode.Builder( + "code4", + "description6" + ) + .position(14) + .build() +) +.build(); ``` diff --git a/doc/models/create-reason-code.md b/doc/models/create-reason-code.md index aa8fdf25..da323c22 100644 --- a/doc/models/create-reason-code.md +++ b/doc/models/create-reason-code.md @@ -13,13 +13,16 @@ | `Description` | `String` | Required | The friendly summary of what the code signifies | String getDescription() | setDescription(String description) | | `Position` | `Integer` | Optional | The order that code appears in lists | Integer getPosition() | setPosition(Integer position) | -## Example (as JSON) - -```json -{ - "code": "code4", - "description": "description6", - "position": 86 -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateReasonCode; + +CreateReasonCode createReasonCode = new CreateReasonCode.Builder( + "code4", + "description6" +) +.position(40) +.build(); ``` diff --git a/doc/models/create-segment-request.md b/doc/models/create-segment-request.md index 955686ae..c23e65c0 100644 --- a/doc/models/create-segment-request.md +++ b/doc/models/create-segment-request.md @@ -11,34 +11,64 @@ | --- | --- | --- | --- | --- | --- | | `Segment` | [`CreateSegment`](../../doc/models/create-segment.md) | Required | - | CreateSegment getSegment() | setSegment(CreateSegment segment) | -## Example (as JSON) - -```json -{ - "segment": { - "segment_property_1_value": "String1", - "segment_property_2_value": "String3", - "segment_property_3_value": "String1", - "segment_property_4_value": "String5", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.CreateSegment; +import com.maxio.advancedbilling.models.CreateSegmentRequest; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty1Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty2Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty3Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty4Value; +import java.util.Arrays; + +CreateSegmentRequest createSegmentRequest = new CreateSegmentRequest.Builder( + new CreateSegment.Builder( + PricingScheme.STAIRSTEP + ) + .segmentProperty1Value(CreateSegmentSegmentProperty1Value.fromString( + "String1" + )) + .segmentProperty2Value(CreateSegmentSegmentProperty2Value.fromString( + "String3" + )) + .segmentProperty3Value(CreateSegmentSegmentProperty3Value.fromString( + "String1" + )) + .segmentProperty4Value(CreateSegmentSegmentProperty4Value.fromString( + "String5" + )) + .prices(Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + )) + .build() +) +.build(); ``` diff --git a/doc/models/create-segment.md b/doc/models/create-segment.md index ca1aa4a6..25d96f0a 100644 --- a/doc/models/create-segment.md +++ b/doc/models/create-segment.md @@ -16,32 +16,52 @@ | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/create-or-update-segment-price.md) | Optional | - | List getPrices() | setPrices(List prices) | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "String9", - "segment_property_2_value": "String1", - "segment_property_3_value": "String3", - "segment_property_4_value": "String3", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.CreateSegment; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty1Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty2Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty3Value; +import com.maxio.advancedbilling.models.containers.CreateSegmentSegmentProperty4Value; +import java.util.Arrays; + +CreateSegment createSegment = new CreateSegment.Builder( + PricingScheme.STAIRSTEP +) +.segmentProperty1Value(CreateSegmentSegmentProperty1Value.fromString( + "String7" + )) +.segmentProperty2Value(CreateSegmentSegmentProperty2Value.fromString( + "String9" + )) +.segmentProperty3Value(CreateSegmentSegmentProperty3Value.fromString( + "String5" + )) +.segmentProperty4Value(CreateSegmentSegmentProperty4Value.fromString( + "String1" + )) +.prices(Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + )) +.build(); ``` diff --git a/doc/models/create-signup-proforma-preview-include.md b/doc/models/create-signup-proforma-preview-include.md index e652ba44..e476c651 100644 --- a/doc/models/create-signup-proforma-preview-include.md +++ b/doc/models/create-signup-proforma-preview-include.md @@ -13,7 +13,9 @@ ## Example -``` -next_proforma_invoice +```java +import com.maxio.advancedbilling.models.CreateSignupProformaPreviewInclude; + +CreateSignupProformaPreviewInclude createSignupProformaPreviewInclude = CreateSignupProformaPreviewInclude.NEXT_PROFORMA_INVOICE; ``` diff --git a/doc/models/create-subscription-component.md b/doc/models/create-subscription-component.md index c01ff86a..8b525ebc 100644 --- a/doc/models/create-subscription-component.md +++ b/doc/models/create-subscription-component.md @@ -11,21 +11,32 @@ | --- | --- | --- | --- | --- | --- | | `ComponentId` | [`CreateSubscriptionComponentComponentId`](../../doc/models/containers/create-subscription-component-component-id.md) | Optional | This is a container for one-of cases. | CreateSubscriptionComponentComponentId getComponentId() | setComponentId(CreateSubscriptionComponentComponentId componentId) | | `Enabled` | `Boolean` | Optional | Used for on/off components only. | Boolean getEnabled() | setEnabled(Boolean enabled) | -| `UnitBalance` | `Integer` | Optional | Used for metered and events based components. | Integer getUnitBalance() | setUnitBalance(Integer unitBalance) | +| `UnitBalance` | [`CreateSubscriptionComponentUnitBalance`](../../doc/models/containers/create-subscription-component-unit-balance.md) | Optional | This is a container for one-of cases. | CreateSubscriptionComponentUnitBalance getUnitBalance() | setUnitBalance(CreateSubscriptionComponentUnitBalance unitBalance) | | `AllocatedQuantity` | [`CreateSubscriptionComponentAllocatedQuantity`](../../doc/models/containers/create-subscription-component-allocated-quantity.md) | Optional | This is a container for one-of cases. | CreateSubscriptionComponentAllocatedQuantity getAllocatedQuantity() | setAllocatedQuantity(CreateSubscriptionComponentAllocatedQuantity allocatedQuantity) | | `Quantity` | `Integer` | Optional | Deprecated. Use `allocated_quantity` instead. | Integer getQuantity() | setQuantity(Integer quantity) | | `PricePointId` | [`CreateSubscriptionComponentPricePointId`](../../doc/models/containers/create-subscription-component-price-point-id.md) | Optional | This is a container for one-of cases. | CreateSubscriptionComponentPricePointId getPricePointId() | setPricePointId(CreateSubscriptionComponentPricePointId pricePointId) | | `CustomPrice` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ComponentCustomPrice getCustomPrice() | setCustomPrice(ComponentCustomPrice customPrice) | -## Example (as JSON) - -```json -{ - "component_id": 8, - "enabled": false, - "unit_balance": 144, - "allocated_quantity": 102, - "quantity": 188 -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateSubscriptionComponent; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentAllocatedQuantity; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; + +CreateSubscriptionComponent createSubscriptionComponent = new CreateSubscriptionComponent.Builder() + .componentId(CreateSubscriptionComponentComponentId.fromNumber( + 210 + )) + .enabled(false) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber( + 12 + )) + .allocatedQuantity(CreateSubscriptionComponentAllocatedQuantity.fromNumber( + 48 + )) + .quantity(134) + .build(); ``` diff --git a/doc/models/create-subscription-group-request.md b/doc/models/create-subscription-group-request.md index 56dee11c..8ac285e8 100644 --- a/doc/models/create-subscription-group-request.md +++ b/doc/models/create-subscription-group-request.md @@ -11,17 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionGroup` | [`CreateSubscriptionGroup`](../../doc/models/create-subscription-group.md) | Required | - | CreateSubscriptionGroup getSubscriptionGroup() | setSubscriptionGroup(CreateSubscriptionGroup subscriptionGroup) | -## Example (as JSON) - -```json -{ - "subscription_group": { - "subscription_id": 36, - "member_ids": [ - 164, - 165 - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateSubscriptionGroup; +import com.maxio.advancedbilling.models.CreateSubscriptionGroupRequest; +import java.util.Arrays; + +CreateSubscriptionGroupRequest createSubscriptionGroupRequest = new CreateSubscriptionGroupRequest.Builder( + new CreateSubscriptionGroup.Builder( + 36 + ) + .memberIds(Arrays.asList( + 164, + 165 + )) + .build() +) +.build(); ``` diff --git a/doc/models/create-subscription-group.md b/doc/models/create-subscription-group.md index a97275b6..1618b696 100644 --- a/doc/models/create-subscription-group.md +++ b/doc/models/create-subscription-group.md @@ -12,14 +12,18 @@ | `SubscriptionId` | `int` | Required | - | int getSubscriptionId() | setSubscriptionId(int subscriptionId) | | `MemberIds` | `List` | Optional | - | List getMemberIds() | setMemberIds(List memberIds) | -## Example (as JSON) - -```json -{ - "subscription_id": 38, - "member_ids": [ - 162 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateSubscriptionGroup; +import java.util.Arrays; + +CreateSubscriptionGroup createSubscriptionGroup = new CreateSubscriptionGroup.Builder( + 204 +) +.memberIds(Arrays.asList( + 48 + )) +.build(); ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 4132f6c2..fb0c0760 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -11,33 +11,53 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | [`CreateSubscription`](../../doc/models/create-subscription.md) | Required | - | CreateSubscription getSubscription() | setSubscription(CreateSubscription subscription) | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 206, - "product_price_point_handle": "product_price_point_handle2", - "product_price_point_id": 130, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateSubscription; +import com.maxio.advancedbilling.models.CreateSubscriptionRequest; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.SubscriptionCustomPrice; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceInterval; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPricePriceInCents; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceTrialInterval; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceTrialPriceInCents; +import java.util.LinkedHashMap; + +CreateSubscriptionRequest createSubscriptionRequest = new CreateSubscriptionRequest.Builder( + new CreateSubscription.Builder() + .productHandle("product_handle6") + .productId(206) + .productPricePointHandle("product_price_point_handle2") + .productPricePointId(130) + .customPrice(new SubscriptionCustomPrice.Builder( + SubscriptionCustomPricePriceInCents.fromString( + "String3" + ), + SubscriptionCustomPriceInterval.fromString( + "String3" + ), + IntervalUnit.DAY + ) + .name("name4") + .handle("handle0") + .trialPriceInCents(SubscriptionCustomPriceTrialPriceInCents.fromString( + "String3" + )) + .trialInterval(SubscriptionCustomPriceTrialInterval.fromString( + "String5" + )) + .trialIntervalUnit(IntervalUnit.DAY) + .build()) + .deferSignup(false) + .metafields(new LinkedHashMap() {{ + put("custom_field_name_1", "custom_field_value_1"); + put("custom_field_name_2", "custom_field_value_2"); + }}) + .dunningCommunicationDelayEnabled(false) + .dunningCommunicationDelayTimeZone("\"Eastern Time (US & Canada)\"") + .build() +) +.build(); ``` diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index e6450fbb..e0361676 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -20,19 +20,20 @@ | `ReceivesInvoiceEmails` | `String` | Optional | (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. | String getReceivesInvoiceEmails() | setReceivesInvoiceEmails(String receivesInvoiceEmails) | | `NetTerms` | `String` | Optional | (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180. | String getNetTerms() | setNetTerms(String netTerms) | | `CustomerId` | `Integer` | Optional | The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. | Integer getCustomerId() | setCustomerId(Integer customerId) | +| `BrandingThemeId` | `Integer` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | Integer getBrandingThemeId() | setBrandingThemeId(Integer brandingThemeId) | | `NextBillingAt` | `ZonedDateTime` | Optional | (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal schedule. See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). If you provide a next_billing_at timestamp that is in the future, no trial or initial charges will be applied when you create the subscription. In fact, no payment will be captured at all. The first payment will be captured, according to the prices defined by the product, near the time specified by next_billing_at. If you do not provide a value for next_billing_at, any trial and/or initial charges will be assessed and charged at the time of subscription creation. If the card cannot be successfully charged, the subscription will not be created. See further notes in the section on Importing Subscriptions. | ZonedDateTime getNextBillingAt() | setNextBillingAt(ZonedDateTime nextBillingAt) | | `InitialBillingAt` | `ZonedDateTime` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time Formats. | ZonedDateTime getInitialBillingAt() | setInitialBillingAt(ZonedDateTime initialBillingAt) | -| `DeferSignup` | `Boolean` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | Boolean getDeferSignup() | setDeferSignup(Boolean deferSignup) | +| `DeferSignup` | `Boolean` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | Boolean getDeferSignup() | setDeferSignup(Boolean deferSignup) | | `StoredCredentialTransactionId` | `Integer` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | Integer getStoredCredentialTransactionId() | setStoredCredentialTransactionId(Integer storedCredentialTransactionId) | | `SalesRepId` | `Integer` | Optional | - | Integer getSalesRepId() | setSalesRepId(Integer salesRepId) | -| `PaymentProfileId` | `Integer` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id) | Integer getPaymentProfileId() | setPaymentProfileId(Integer paymentProfileId) | +| `PaymentProfileId` | `Integer` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id.) | Integer getPaymentProfileId() | setPaymentProfileId(Integer paymentProfileId) | | `Reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | String getReference() | setReference(String reference) | | `CustomerAttributes` | [`CustomerAttributes`](../../doc/models/customer-attributes.md) | Optional | - | CustomerAttributes getCustomerAttributes() | setCustomerAttributes(CustomerAttributes customerAttributes) | | `PaymentProfileAttributes` | [`PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | alias to credit_card_attributes | PaymentProfileAttributes getPaymentProfileAttributes() | setPaymentProfileAttributes(PaymentProfileAttributes paymentProfileAttributes) | | `CreditCardAttributes` | [`PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. | PaymentProfileAttributes getCreditCardAttributes() | setCreditCardAttributes(PaymentProfileAttributes creditCardAttributes) | | `BankAccountAttributes` | [`BankAccountAttributes`](../../doc/models/bank-account-attributes.md) | Optional | - | BankAccountAttributes getBankAccountAttributes() | setBankAccountAttributes(BankAccountAttributes bankAccountAttributes) | | `Components` | [`List`](../../doc/models/create-subscription-component.md) | Optional | (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview) for more information. | List getComponents() | setComponents(List components) | -| `CalendarBilling` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | CalendarBilling getCalendarBilling() | setCalendarBilling(CalendarBilling calendarBilling) | +| `CalendarBilling` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | CalendarBilling getCalendarBilling() | setCalendarBilling(CalendarBilling calendarBilling) | | `Metafields` | `Map` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | Map getMetafields() | setMetafields(Map metafields) | | `CustomerReference` | `String` | Optional | The reference value (provided by your app) of an existing customer within Chargify. Required, unless a `customer_id` or a set of `customer_attributes` is given. | String getCustomerReference() | setCustomerReference(String customerReference) | | `Group` | [`GroupSettings`](../../doc/models/group-settings.md) | Optional | - | GroupSettings getGroup() | setGroup(GroupSettings group) | @@ -60,31 +61,49 @@ | `DunningCommunicationDelayTimeZone` | `String` | Optional | Time zone for the Dunning Communication Delay feature. | String getDunningCommunicationDelayTimeZone() | setDunningCommunicationDelayTimeZone(String dunningCommunicationDelayTimeZone) | | `SkipBillingManifestTaxes` | `Boolean` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests. Defaults to `false` when not provided. | Boolean getSkipBillingManifestTaxes() | setSkipBillingManifestTaxes(Boolean skipBillingManifestTaxes) | -## Example (as JSON) +## Example -```json -{ - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 212, - "product_price_point_handle": "product_price_point_handle0", - "product_price_point_id": 136, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } -} +```java +import com.maxio.advancedbilling.models.CreateSubscription; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.SubscriptionCustomPrice; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceInterval; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPricePriceInCents; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceTrialInterval; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceTrialPriceInCents; +import java.util.LinkedHashMap; + +CreateSubscription createSubscription = new CreateSubscription.Builder() + .productHandle("product_handle4") + .productId(82) + .productPricePointHandle("product_price_point_handle2") + .productPricePointId(6) + .customPrice(new SubscriptionCustomPrice.Builder( + SubscriptionCustomPricePriceInCents.fromString( + "String3" + ), + SubscriptionCustomPriceInterval.fromString( + "String3" + ), + IntervalUnit.DAY + ) + .name("name4") + .handle("handle0") + .trialPriceInCents(SubscriptionCustomPriceTrialPriceInCents.fromString( + "String3" + )) + .trialInterval(SubscriptionCustomPriceTrialInterval.fromString( + "String5" + )) + .trialIntervalUnit(IntervalUnit.DAY) + .build()) + .deferSignup(false) + .metafields(new LinkedHashMap() {{ + put("custom_field_name_1", "custom_field_value_1"); + put("custom_field_name_2", "custom_field_value_2"); + }}) + .dunningCommunicationDelayEnabled(false) + .dunningCommunicationDelayTimeZone("\"Eastern Time (US & Canada)\"") + .build(); ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index d01909aa..551111fe 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -11,37 +11,66 @@ | --- | --- | --- | --- | --- | --- | | `Usage` | [`CreateUsage`](../../doc/models/create-usage.md) | Required | - | CreateUsage getUsage() | setUsage(CreateUsage usage) | -## Example (as JSON) - -```json -{ - "usage": { - "quantity": 162.34, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BillingSchedule; +import com.maxio.advancedbilling.models.ComponentCustomPrice; +import com.maxio.advancedbilling.models.CreateUsage; +import com.maxio.advancedbilling.models.CreateUsageRequest; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateUsageRequest createUsageRequest = new CreateUsageRequest.Builder( + new CreateUsage.Builder() + .quantity(162.34D) + .pricePointId("price_point_id0") + .memo("memo2") + .billingSchedule(new BillingSchedule.Builder() + .initialBillingAt(DateTimeHelper.fromSimpleDate("2016-03-13")) + .build()) + .customPrice(new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(66) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(174) + .build()) + .build() +) +.build(); ``` diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 8db2f310..44b94935 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -15,35 +15,62 @@ | `BillingSchedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | BillingSchedule getBillingSchedule() | setBillingSchedule(BillingSchedule billingSchedule) | | `CustomPrice` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ComponentCustomPrice getCustomPrice() | setCustomPrice(ComponentCustomPrice customPrice) | -## Example (as JSON) - -```json -{ - "quantity": 23.44, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BillingSchedule; +import com.maxio.advancedbilling.models.ComponentCustomPrice; +import com.maxio.advancedbilling.models.CreateUsage; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +CreateUsage createUsage = new CreateUsage.Builder() + .quantity(204.7D) + .pricePointId("price_point_id4") + .memo("memo8") + .billingSchedule(new BillingSchedule.Builder() + .initialBillingAt(DateTimeHelper.fromSimpleDate("2016-03-13")) + .build()) + .customPrice(new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(66) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(174) + .build()) + .build(); ``` diff --git a/doc/models/created-prepayment.md b/doc/models/created-prepayment.md index 45d7b0b0..8fc8ebb8 100644 --- a/doc/models/created-prepayment.md +++ b/doc/models/created-prepayment.md @@ -17,15 +17,18 @@ | `StartingBalanceInCents` | `Long` | Optional | **Constraints**: `>= 0` | Long getStartingBalanceInCents() | setStartingBalanceInCents(Long startingBalanceInCents) | | `EndingBalanceInCents` | `Long` | Optional | - | Long getEndingBalanceInCents() | setEndingBalanceInCents(Long endingBalanceInCents) | -## Example (as JSON) - -```json -{ - "id": 110, - "subscription_id": 220, - "amount_in_cents": 196, - "memo": "memo6", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreatedPrepayment; + +CreatedPrepayment createdPrepayment = new CreatedPrepayment.Builder() + .id(186L) + .subscriptionId(40) + .amountInCents(240L) + .memo("memo6") + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/credit-account-balance-changed.md b/doc/models/credit-account-balance-changed.md index 2b863e70..f66ebded 100644 --- a/doc/models/credit-account-balance-changed.md +++ b/doc/models/credit-account-balance-changed.md @@ -15,15 +15,19 @@ | `CurrencyCode` | `String` | Required | - | String getCurrencyCode() | setCurrencyCode(String currencyCode) | | `AtTime` | `ZonedDateTime` | Required | - | ZonedDateTime getAtTime() | setAtTime(ZonedDateTime atTime) | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "service_credit_account_balance_in_cents": 10, - "service_credit_balance_change_in_cents": 116, - "currency_code": "currency_code8", - "at_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditAccountBalanceChanged; + +CreditAccountBalanceChanged creditAccountBalanceChanged = new CreditAccountBalanceChanged.Builder( + "reason4", + 216L, + 166L, + "currency_code6", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") +) +.build(); ``` diff --git a/doc/models/credit-card-attributes.md b/doc/models/credit-card-attributes.md index e070ba39..c5ceebeb 100644 --- a/doc/models/credit-card-attributes.md +++ b/doc/models/credit-card-attributes.md @@ -13,13 +13,15 @@ | `ExpirationMonth` | `String` | Optional | - | String getExpirationMonth() | setExpirationMonth(String expirationMonth) | | `ExpirationYear` | `String` | Optional | - | String getExpirationYear() | setExpirationYear(String expirationYear) | -## Example (as JSON) - -```json -{ - "full_number": "full_number0", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year0" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreditCardAttributes; + +CreditCardAttributes creditCardAttributes = new CreditCardAttributes.Builder() + .fullNumber("full_number8") + .expirationMonth("expiration_month8") + .expirationYear("expiration_year2") + .build(); ``` diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index 42ed7a8a..d0ff646e 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -12,10 +12,10 @@ | `Id` | `Integer` | Optional | The Chargify-assigned ID of the stored card. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | Integer getId() | setId(Integer id) | | `FirstName` | `String` | Optional | The first name of the card holder. | String getFirstName() | setFirstName(String firstName) | | `LastName` | `String` | Optional | The last name of the card holder. | String getLastName() | setLastName(String lastName) | -| `MaskedCardNumber` | `String` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). | String getMaskedCardNumber() | setMaskedCardNumber(String maskedCardNumber) | +| `MaskedCardNumber` | `String` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). | String getMaskedCardNumber() | setMaskedCardNumber(String maskedCardNumber) | | `CardType` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | CardType getCardType() | setCardType(CardType cardType) | | `ExpirationMonth` | `Integer` | Optional | An integer representing the expiration month of the card(1 – 12). | Integer getExpirationMonth() | setExpirationMonth(Integer expirationMonth) | -| `ExpirationYear` | `Integer` | Optional | An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). | Integer getExpirationYear() | setExpirationYear(Integer expirationYear) | +| `ExpirationYear` | `Integer` | Optional | An integer representing the 4-digit expiration year of the card(e.g., ‘2012’). | Integer getExpirationYear() | setExpirationYear(Integer expirationYear) | | `CustomerId` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the card belongs. | Integer getCustomerId() | setCustomerId(Integer customerId) | | `CurrentVault` | [`CreditCardVault`](../../doc/models/credit-card-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | CreditCardVault getCurrentVault() | setCurrentVault(CreditCardVault currentVault) | | `VaultToken` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile. | String getVaultToken() | setVaultToken(String vaultToken) | @@ -28,36 +28,42 @@ | `BillingAddress2` | `String` | Optional | The current billing street address, second line, for the card. | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | | `PaymentType` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType.CREDIT_CARD` | PaymentType getPaymentType() | setPaymentType(PaymentType paymentType) | | `Disabled` | `Boolean` | Optional | - | Boolean getDisabled() | setDisabled(Boolean disabled) | -| `ChargifyToken` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | String getChargifyToken() | setChargifyToken(String chargifyToken) | +| `ChargifyToken` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). | String getChargifyToken() | setChargifyToken(String chargifyToken) | | `SiteGatewaySettingId` | `Integer` | Optional | - | Integer getSiteGatewaySettingId() | setSiteGatewaySettingId(Integer siteGatewaySettingId) | | `GatewayHandle` | `String` | Optional | An identifier of connected gateway. | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | | `CreatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was last updated | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -## Example (as JSON) - -```json -{ - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null -} +## Example + +```java +import com.maxio.advancedbilling.models.CardType; +import com.maxio.advancedbilling.models.CreditCardPaymentProfile; +import com.maxio.advancedbilling.models.CreditCardVault; +import com.maxio.advancedbilling.models.PaymentType; + +CreditCardPaymentProfile creditCardPaymentProfile = new CreditCardPaymentProfile.Builder( + PaymentType.CREDIT_CARD +) +.id(10088716) +.firstName("Test") +.lastName("Subscription") +.maskedCardNumber("XXXX-XXXX-XXXX-1") +.cardType(CardType.BOGUS) +.expirationMonth(1) +.expirationYear(2022) +.customerId(14543792) +.currentVault(CreditCardVault.BOGUS) +.vaultToken("1") +.billingAddress("123 Montana Way") +.billingCity("Billings") +.billingState("MT") +.billingZip("59101") +.billingCountry("US") +.customerVaultToken("customer_vault_token2") +.billingAddress2("") +.siteGatewaySettingId(1) +.gatewayHandle("gateway_handle8") +.build(); ``` diff --git a/doc/models/credit-card-vault.md b/doc/models/credit-card-vault.md index 64f7914a..3317e65c 100644 --- a/doc/models/credit-card-vault.md +++ b/doc/models/credit-card-vault.md @@ -45,3 +45,11 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```java +import com.maxio.advancedbilling.models.CreditCardVault; + +CreditCardVault creditCardVault = CreditCardVault.UNIPAAS; +``` + diff --git a/doc/models/credit-note-application.md b/doc/models/credit-note-application.md index ee943dd2..7c88f935 100644 --- a/doc/models/credit-note-application.md +++ b/doc/models/credit-note-application.md @@ -15,15 +15,18 @@ | `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | | `AppliedAmount` | `String` | Optional | - | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "invoice_uid": "invoice_uid0", - "memo": "memo4", - "applied_amount": "applied_amount8" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditNoteApplication; + +CreditNoteApplication creditNoteApplication = new CreditNoteApplication.Builder() + .uid("uid0") + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .invoiceUid("invoice_uid0") + .memo("memo4") + .appliedAmount("applied_amount8") + .build(); ``` diff --git a/doc/models/credit-note-line-item.md b/doc/models/credit-note-line-item.md index 63ef7036..2c63de3d 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -13,7 +13,7 @@ | `Title` | `String` | Optional | A short descriptor for the credit given by this line. | String getTitle() | setTitle(String title) | | `Description` | `String` | Optional | Detailed description for the credit given by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the credit note. | String getDescription() | setDescription(String description) | | `Quantity` | `String` | Optional | The quantity or count of units credited by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | String getQuantity() | setQuantity(String quantity) | -| `UnitPrice` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | String getUnitPrice() | setUnitPrice(String unitPrice) | +| `UnitPrice` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | String getUnitPrice() | setUnitPrice(String unitPrice) | | `SubtotalAmount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | String getSubtotalAmount() | setSubtotalAmount(String subtotalAmount) | | `DiscountAmount` | `String` | Optional | The approximate discount of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | String getDiscountAmount() | setDiscountAmount(String discountAmount) | | `TaxAmount` | `String` | Optional | The approximate tax of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | String getTaxAmount() | setTaxAmount(String taxAmount) | @@ -30,15 +30,17 @@ | `CustomItem` | `Boolean` | Optional | - | Boolean getCustomItem() | setCustomItem(Boolean customItem) | | `PrepaidAllocationExpiresAt` | `LocalDate` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | LocalDate getPrepaidAllocationExpiresAt() | setPrepaidAllocationExpiresAt(LocalDate prepaidAllocationExpiresAt) | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```java +import com.maxio.advancedbilling.models.CreditNoteLineItem; + +CreditNoteLineItem creditNoteLineItem = new CreditNoteLineItem.Builder() + .uid("uid0") + .title("title6") + .description("description0") + .quantity("quantity6") + .unitPrice("unit_price8") + .build(); ``` diff --git a/doc/models/credit-note-status.md b/doc/models/credit-note-status.md index 1b4271a3..623aca4b 100644 --- a/doc/models/credit-note-status.md +++ b/doc/models/credit-note-status.md @@ -14,3 +14,11 @@ Current status of the credit note. | `OPEN` | | `APPLIED` | +## Example + +```java +import com.maxio.advancedbilling.models.CreditNoteStatus; + +CreditNoteStatus creditNoteStatus = CreditNoteStatus.OPEN; +``` + diff --git a/doc/models/credit-note.md b/doc/models/credit-note.md index d8a31ebe..38b2382d 100644 --- a/doc/models/credit-note.md +++ b/doc/models/credit-note.md @@ -21,13 +21,13 @@ | `Currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | String getCurrency() | setCurrency(String currency) | | `Memo` | `String` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | String getMemo() | setMemo(String memo) | | `Seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the credit note. | InvoiceSeller getSeller() | setSeller(InvoiceSeller seller) | -| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the credited subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | +| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the credited subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | | `BillingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the credit subscription. | InvoiceAddress getBillingAddress() | setBillingAddress(InvoiceAddress billingAddress) | | `ShippingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the credited subscription. | InvoiceAddress getShippingAddress() | setShippingAddress(InvoiceAddress shippingAddress) | | `SubtotalAmount` | `String` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | String getSubtotalAmount() | setSubtotalAmount(String subtotalAmount) | -| `DiscountAmount` | `String` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | String getDiscountAmount() | setDiscountAmount(String discountAmount) | -| `TaxAmount` | `String` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | String getTaxAmount() | setTaxAmount(String taxAmount) | -| `TotalAmount` | `String` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | String getTotalAmount() | setTotalAmount(String totalAmount) | +| `DiscountAmount` | `String` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e., a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | String getDiscountAmount() | setDiscountAmount(String discountAmount) | +| `TaxAmount` | `String` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxed amount being credited back to the customer (i.e., a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | String getTaxAmount() | setTaxAmount(String taxAmount) | +| `TotalAmount` | `String` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. | String getTotalAmount() | setTotalAmount(String totalAmount) | | `AppliedAmount` | `String` | Optional | The amount of the credit note that has already been applied to invoices. | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | | `RemainingAmount` | `String` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | String getRemainingAmount() | setRemainingAmount(String remainingAmount) | | `LineItems` | [`List`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | List getLineItems() | setLineItems(List lineItems) | @@ -35,17 +35,19 @@ | `Taxes` | [`List`](../../doc/models/invoice-tax.md) | Optional | - | List getTaxes() | setTaxes(List taxes) | | `Applications` | [`List`](../../doc/models/credit-note-application.md) | Optional | - | List getApplications() | setApplications(List applications) | | `Refunds` | [`List`](../../doc/models/invoice-refund.md) | Optional | - | List getRefunds() | setRefunds(List refunds) | -| `OriginInvoices` | [`List`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices) | List getOriginInvoices() | setOriginInvoices(List originInvoices) | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "site_id": 218, - "customer_id": 74, - "subscription_id": 146, - "number": "number0" -} +| `OriginInvoices` | [`List`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices). | List getOriginInvoices() | setOriginInvoices(List originInvoices) | + +## Example + +```java +import com.maxio.advancedbilling.models.CreditNote; + +CreditNote creditNote = new CreditNote.Builder() + .uid("uid6") + .siteId(20) + .customerId(132) + .subscriptionId(204) + .number("number4") + .build(); ``` diff --git a/doc/models/credit-scheme-request.md b/doc/models/credit-scheme-request.md index eea700a0..5f6172ea 100644 --- a/doc/models/credit-scheme-request.md +++ b/doc/models/credit-scheme-request.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `CreditScheme` | [`CreditScheme`](../../doc/models/credit-scheme.md) | Required | - | CreditScheme getCreditScheme() | setCreditScheme(CreditScheme creditScheme) | -## Example (as JSON) +## Example -```json -{ - "credit_scheme": "credit" -} +```java +import com.maxio.advancedbilling.models.CreditScheme; +import com.maxio.advancedbilling.models.CreditSchemeRequest; + +CreditSchemeRequest creditSchemeRequest = new CreditSchemeRequest.Builder( + CreditScheme.CREDIT +) +.build(); ``` diff --git a/doc/models/credit-scheme.md b/doc/models/credit-scheme.md index fdf3956d..00290184 100644 --- a/doc/models/credit-scheme.md +++ b/doc/models/credit-scheme.md @@ -13,3 +13,11 @@ | `CREDIT` | | `REFUND` | +## Example + +```java +import com.maxio.advancedbilling.models.CreditScheme; + +CreditScheme creditScheme = CreditScheme.NONE; +``` + diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index f7d2a090..1464a367 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -15,3 +15,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```java +import com.maxio.advancedbilling.models.CreditType; + +CreditType creditType = CreditType.PRORATED; +``` + diff --git a/doc/models/currency-overage-prices.md b/doc/models/currency-overage-prices.md index b30bafac..6b8090de 100644 --- a/doc/models/currency-overage-prices.md +++ b/doc/models/currency-overage-prices.md @@ -13,7 +13,7 @@ Extends a component price point with currency overage prices. | --- | --- | --- | --- | --- | --- | | `Id` | `Integer` | Optional | - | Integer getId() | setId(Integer id) | | `Type` | [`PricePointType`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | PricePointType getType() | setType(PricePointType type) | -| `Default` | `Boolean` | Optional | Note: Refer to type attribute instead | Boolean getDefault() | setDefault(Boolean mDefault) | +| `Default` | `Boolean` | Optional | Note: Refer to type attribute instead. | Boolean getDefault() | setDefault(Boolean mDefault) | | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `ComponentId` | `Integer` | Optional | - | Integer getComponentId() | setComponentId(Integer componentId) | @@ -25,7 +25,7 @@ Extends a component price point with currency overage prices. | `UseSiteExchangeRate` | `Boolean` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Defaults to true during creation. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `SubscriptionId` | `Integer` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `TaxIncluded` | `Boolean` | Optional | - | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `CurrencyPrices` | [`List`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | | `OveragePrices` | [`List`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | List getOveragePrices() | setOveragePrices(List overagePrices) | @@ -36,15 +36,19 @@ Extends a component price point with currency overage prices. | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | | `CurrencyOveragePrices` | [`List`](../../doc/models/component-currency-price.md) | Optional | Applicable only to prepaid usage components. An array of currency pricing data for overage prices. | List getCurrencyOveragePrices() | setCurrencyOveragePrices(List currencyOveragePrices) | -## Example (as JSON) +## Example -```json -{ - "id": 50, - "type": "catalog", - "default": false, - "name": "name8", - "pricing_scheme": "stairstep" -} +```java +import com.maxio.advancedbilling.models.CurrencyOveragePrices; +import com.maxio.advancedbilling.models.PricePointType; +import com.maxio.advancedbilling.models.PricingScheme; + +CurrencyOveragePrices currencyOveragePrices = new CurrencyOveragePrices.Builder() + .id(96) + .type(PricePointType.CATALOG) + .mDefault(false) + .name("name0") + .pricingScheme(PricingScheme.PER_UNIT) + .build(); ``` diff --git a/doc/models/currency-price-role.md b/doc/models/currency-price-role.md index 32d78475..fbcfb9e8 100644 --- a/doc/models/currency-price-role.md +++ b/doc/models/currency-price-role.md @@ -15,3 +15,11 @@ Role for the price. | `TRIAL` | | `INITIAL` | +## Example + +```java +import com.maxio.advancedbilling.models.CurrencyPriceRole; + +CurrencyPriceRole currencyPriceRole = CurrencyPriceRole.INITIAL; +``` + diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index 7c9f6b20..c2599835 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -18,15 +18,17 @@ | `ProductPricePointId` | `Integer` | Optional | - | Integer getProductPricePointId() | setProductPricePointId(Integer productPricePointId) | | `Role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Optional | Role for the price. | CurrencyPriceRole getRole() | setRole(CurrencyPriceRole role) | -## Example (as JSON) - -```json -{ - "id": 88, - "currency": "currency6", - "price": 41.36, - "formatted_price": "formatted_price4", - "price_id": 178 -} +## Example + +```java +import com.maxio.advancedbilling.models.CurrencyPrice; + +CurrencyPrice currencyPrice = new CurrencyPrice.Builder() + .id(208) + .currency("currency4") + .price(70.88D) + .formattedPrice("formatted_price2") + .priceId(214) + .build(); ``` diff --git a/doc/models/currency-prices-response.md b/doc/models/currency-prices-response.md index 9960891c..33f8e125 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `CurrencyPrices` | [`List`](../../doc/models/currency-price.md) | Required | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "formatted_price": "formatted_price6", - "price_id": 116 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CurrencyPrice; +import com.maxio.advancedbilling.models.CurrencyPricesResponse; +import java.util.Arrays; + +CurrencyPricesResponse currencyPricesResponse = new CurrencyPricesResponse.Builder( + Arrays.asList( + new CurrencyPrice.Builder() + .id(50) + .currency("currency8") + .price(233.74D) + .formattedPrice("formatted_price6") + .priceId(116) + .build() + ) +) +.build(); ``` diff --git a/doc/models/custom-field-owner.md b/doc/models/custom-field-owner.md index 77c2f821..f2a8792a 100644 --- a/doc/models/custom-field-owner.md +++ b/doc/models/custom-field-owner.md @@ -12,3 +12,11 @@ | `CUSTOMER` | | `SUBSCRIPTION` | +## Example + +```java +import com.maxio.advancedbilling.models.CustomFieldOwner; + +CustomFieldOwner customFieldOwner = CustomFieldOwner.CUSTOMER; +``` + diff --git a/doc/models/custom-field-value-change.md b/doc/models/custom-field-value-change.md index cda4f9f4..1199d694 100644 --- a/doc/models/custom-field-value-change.md +++ b/doc/models/custom-field-value-change.md @@ -17,17 +17,20 @@ | `ResourceType` | `String` | Required | - | String getResourceType() | setResourceType(String resourceType) | | `ResourceId` | `int` | Required | - | int getResourceId() | setResourceId(int resourceId) | -## Example (as JSON) - -```json -{ - "event_type": "event_type2", - "metafield_name": "metafield_name6", - "metafield_id": 78, - "old_value": "old_value2", - "new_value": "new_value8", - "resource_type": "resource_type2", - "resource_id": 74 -} +## Example + +```java +import com.maxio.advancedbilling.models.CustomFieldValueChange; + +CustomFieldValueChange customFieldValueChange = new CustomFieldValueChange.Builder( + "event_type8", + "metafield_name2", + 138, + "old_value6", + "new_value2", + "resource_type6", + 14 +) +.build(); ``` diff --git a/doc/models/customer-attributes.md b/doc/models/customer-attributes.md index 7ef57303..e5b4daa5 100644 --- a/doc/models/customer-attributes.md +++ b/doc/models/customer-attributes.md @@ -12,37 +12,41 @@ | `FirstName` | `String` | Optional | The first name of the customer. Required when creating a customer via attributes. | String getFirstName() | setFirstName(String firstName) | | `LastName` | `String` | Optional | The last name of the customer. Required when creating a customer via attributes. | String getLastName() | setLastName(String lastName) | | `Email` | `String` | Optional | The email address of the customer. Required when creating a customer via attributes. | String getEmail() | setEmail(String email) | -| `CcEmails` | `String` | Optional | A list of emails that should be cc’d on all customer communications. Optional. | String getCcEmails() | setCcEmails(String ccEmails) | -| `Organization` | `String` | Optional | The organization/company of the customer. Optional. | String getOrganization() | setOrganization(String organization) | -| `Reference` | `String` | Optional | A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional. | String getReference() | setReference(String reference) | -| `Address` | `String` | Optional | (Optional) The customer’s shipping street address (i.e. “123 Main St.”). | String getAddress() | setAddress(String address) | -| `Address2` | `String` | Optional | (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” | String getAddress2() | setAddress2(String address2) | -| `City` | `String` | Optional | (Optional) The customer’s shipping address city (i.e. “Boston”). | String getCity() | setCity(String city) | -| `State` | `String` | Optional | (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | String getState() | setState(String state) | -| `Zip` | `String` | Optional | (Optional) The customer’s shipping address zip code (i.e. “12345”). | String getZip() | setZip(String zip) | -| `Country` | `String` | Optional | (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). | String getCountry() | setCountry(String country) | +| `CcEmails` | `String` | Optional | (Optional) A list of emails that should be cc’d on all customer communications. | String getCcEmails() | setCcEmails(String ccEmails) | +| `Organization` | `String` | Optional | (Optional) The organization/company of the customer. | String getOrganization() | setOrganization(String organization) | +| `Reference` | `String` | Optional | (Optional) A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. | String getReference() | setReference(String reference) | +| `Address` | `String` | Optional | (Optional) The customer’s shipping street address (e.g., “123 Main St.”). | String getAddress() | setAddress(String address) | +| `Address2` | `String` | Optional | (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” | String getAddress2() | setAddress2(String address2) | +| `City` | `String` | Optional | (Optional) The customer’s shipping address city (e.g., “Boston”). | String getCity() | setCity(String city) | +| `State` | `String` | Optional | “(Optional) The customer’s shipping address state (e.g., “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.” | String getState() | setState(String state) | +| `Zip` | `String` | Optional | (Optional) The customer’s shipping address zip code (e.g., “12345”). | String getZip() | setZip(String zip) | +| `Country` | `String` | Optional | “(Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”).” | String getCountry() | setCountry(String country) | | `Phone` | `String` | Optional | (Optional) The phone number of the customer. | String getPhone() | setPhone(String phone) | | `Verified` | `Boolean` | Optional | - | Boolean getVerified() | setVerified(Boolean verified) | | `TaxExempt` | `Boolean` | Optional | (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. | Boolean getTaxExempt() | setTaxExempt(Boolean taxExempt) | -| `VatNumber` | `String` | Optional | (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | String getVatNumber() | setVatNumber(String vatNumber) | +| `Surcharging` | `Boolean` | Optional | (Optional) Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | Boolean getSurcharging() | setSurcharging(Boolean surcharging) | +| `VatNumber` | `String` | Optional | (Optional) Supplying the VAT number allows EU customers to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | String getVatNumber() | setVatNumber(String vatNumber) | | `Metafields` | `Map` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | Map getMetafields() | setMetafields(Map metafields) | | `ParentId` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | Integer getParentId() | setParentId(Integer parentId) | | `SalesforceId` | `String` | Optional | (Optional) The Salesforce ID of the customer. | String getSalesforceId() | setSalesforceId(String salesforceId) | | `DefaultAutoRenewalProfileId` | `Integer` | Optional | (Optional) The default auto-renewal profile ID for the customer | Integer getDefaultAutoRenewalProfileId() | setDefaultAutoRenewalProfileId(Integer defaultAutoRenewalProfileId) | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails6", - "organization": "organization8" -} +## Example + +```java +import com.maxio.advancedbilling.models.CustomerAttributes; +import java.util.LinkedHashMap; + +CustomerAttributes customerAttributes = new CustomerAttributes.Builder() + .firstName("first_name2") + .lastName("last_name0") + .email("email4") + .ccEmails("cc_emails2") + .organization("organization6") + .metafields(new LinkedHashMap() {{ + put("custom_field_name_1", "custom_field_value_1"); + put("custom_field_name_2", "custom_field_value_2"); + }}) + .build(); ``` diff --git a/doc/models/customer-change.md b/doc/models/customer-change.md index 9ff0cfe5..f3cd5f0a 100644 --- a/doc/models/customer-change.md +++ b/doc/models/customer-change.md @@ -14,97 +14,111 @@ | `BillingAddress` | [`AddressChange`](../../doc/models/address-change.md) | Optional | - | AddressChange getBillingAddress() | setBillingAddress(AddressChange billingAddress) | | `CustomFields` | [`CustomerCustomFieldsChange`](../../doc/models/customer-custom-fields-change.md) | Optional | - | CustomerCustomFieldsChange getCustomFields() | setCustomFields(CustomerCustomFieldsChange customFields) | -## Example (as JSON) +## Example -```json -{ - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } - }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } - ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } - ] - } -} +```java +import com.maxio.advancedbilling.models.AddressChange; +import com.maxio.advancedbilling.models.CustomFieldOwner; +import com.maxio.advancedbilling.models.CustomerChange; +import com.maxio.advancedbilling.models.CustomerCustomFieldsChange; +import com.maxio.advancedbilling.models.CustomerPayerChange; +import com.maxio.advancedbilling.models.InvoiceAddress; +import com.maxio.advancedbilling.models.InvoiceCustomField; +import com.maxio.advancedbilling.models.InvoicePayerChange; +import java.util.Arrays; + +CustomerChange customerChange = new CustomerChange.Builder() + .payer(new CustomerPayerChange.Builder( + new InvoicePayerChange.Builder() + .firstName("first_name0") + .lastName("last_name8") + .organization("organization4") + .email("email6") + .build(), + new InvoicePayerChange.Builder() + .firstName("first_name2") + .lastName("last_name0") + .organization("organization4") + .email("email4") + .build() + ) + .build()) + .shippingAddress(new AddressChange.Builder( + new InvoiceAddress.Builder() + .street("street0") + .line2("line24") + .city("city0") + .state("state6") + .zip("zip4") + .build(), + new InvoiceAddress.Builder() + .street("street2") + .line2("line26") + .city("city8") + .state("state2") + .zip("zip4") + .build() + ) + .build()) + .billingAddress(new AddressChange.Builder( + new InvoiceAddress.Builder() + .street("street0") + .line2("line24") + .city("city0") + .state("state6") + .zip("zip4") + .build(), + new InvoiceAddress.Builder() + .street("street2") + .line2("line26") + .city("city8") + .state("state2") + .zip("zip4") + .build() + ) + .build()) + .customFields(new CustomerCustomFieldsChange.Builder( + Arrays.asList( + new InvoiceCustomField.Builder() + .ownerId(26) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name0") + .value("value2") + .metadatumId(26) + .build(), + new InvoiceCustomField.Builder() + .ownerId(26) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name0") + .value("value2") + .metadatumId(26) + .build() + ), + Arrays.asList( + new InvoiceCustomField.Builder() + .ownerId(130) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name2") + .value("value4") + .metadatumId(130) + .build(), + new InvoiceCustomField.Builder() + .ownerId(130) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name2") + .value("value4") + .metadatumId(130) + .build(), + new InvoiceCustomField.Builder() + .ownerId(130) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name2") + .value("value4") + .metadatumId(130) + .build() + ) + ) + .build()) + .build(); ``` diff --git a/doc/models/customer-changes-preview-response.md b/doc/models/customer-changes-preview-response.md index 85ab20bb..913a9401 100644 --- a/doc/models/customer-changes-preview-response.md +++ b/doc/models/customer-changes-preview-response.md @@ -11,99 +11,115 @@ | --- | --- | --- | --- | --- | --- | | `Changes` | [`CustomerChange`](../../doc/models/customer-change.md) | Required | - | CustomerChange getChanges() | setChanges(CustomerChange changes) | -## Example (as JSON) +## Example -```json -{ - "changes": { - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } - }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } - ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } - ] - } - } -} +```java +import com.maxio.advancedbilling.models.AddressChange; +import com.maxio.advancedbilling.models.CustomFieldOwner; +import com.maxio.advancedbilling.models.CustomerChange; +import com.maxio.advancedbilling.models.CustomerChangesPreviewResponse; +import com.maxio.advancedbilling.models.CustomerCustomFieldsChange; +import com.maxio.advancedbilling.models.CustomerPayerChange; +import com.maxio.advancedbilling.models.InvoiceAddress; +import com.maxio.advancedbilling.models.InvoiceCustomField; +import com.maxio.advancedbilling.models.InvoicePayerChange; +import java.util.Arrays; + +CustomerChangesPreviewResponse customerChangesPreviewResponse = new CustomerChangesPreviewResponse.Builder( + new CustomerChange.Builder() + .payer(new CustomerPayerChange.Builder( + new InvoicePayerChange.Builder() + .firstName("first_name0") + .lastName("last_name8") + .organization("organization4") + .email("email6") + .build(), + new InvoicePayerChange.Builder() + .firstName("first_name2") + .lastName("last_name0") + .organization("organization4") + .email("email4") + .build() + ) + .build()) + .shippingAddress(new AddressChange.Builder( + new InvoiceAddress.Builder() + .street("street0") + .line2("line24") + .city("city0") + .state("state6") + .zip("zip4") + .build(), + new InvoiceAddress.Builder() + .street("street2") + .line2("line26") + .city("city8") + .state("state2") + .zip("zip4") + .build() + ) + .build()) + .billingAddress(new AddressChange.Builder( + new InvoiceAddress.Builder() + .street("street0") + .line2("line24") + .city("city0") + .state("state6") + .zip("zip4") + .build(), + new InvoiceAddress.Builder() + .street("street2") + .line2("line26") + .city("city8") + .state("state2") + .zip("zip4") + .build() + ) + .build()) + .customFields(new CustomerCustomFieldsChange.Builder( + Arrays.asList( + new InvoiceCustomField.Builder() + .ownerId(26) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name0") + .value("value2") + .metadatumId(26) + .build(), + new InvoiceCustomField.Builder() + .ownerId(26) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name0") + .value("value2") + .metadatumId(26) + .build() + ), + Arrays.asList( + new InvoiceCustomField.Builder() + .ownerId(130) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name2") + .value("value4") + .metadatumId(130) + .build(), + new InvoiceCustomField.Builder() + .ownerId(130) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name2") + .value("value4") + .metadatumId(130) + .build(), + new InvoiceCustomField.Builder() + .ownerId(130) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name2") + .value("value4") + .metadatumId(130) + .build() + ) + ) + .build()) + .build() +) +.build(); ``` diff --git a/doc/models/customer-custom-fields-change.md b/doc/models/customer-custom-fields-change.md index d6a5c5ee..c65b4087 100644 --- a/doc/models/customer-custom-fields-change.md +++ b/doc/models/customer-custom-fields-change.md @@ -12,28 +12,34 @@ | `Before` | [`List`](../../doc/models/invoice-custom-field.md) | Required | - | List getBefore() | setBefore(List before) | | `After` | [`List`](../../doc/models/invoice-custom-field.md) | Required | - | List getAfter() | setAfter(List after) | -## Example (as JSON) - -```json -{ - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } - ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CustomFieldOwner; +import com.maxio.advancedbilling.models.CustomerCustomFieldsChange; +import com.maxio.advancedbilling.models.InvoiceCustomField; +import java.util.Arrays; + +CustomerCustomFieldsChange customerCustomFieldsChange = new CustomerCustomFieldsChange.Builder( + Arrays.asList( + new InvoiceCustomField.Builder() + .ownerId(26) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name0") + .value("value2") + .metadatumId(26) + .build() + ), + Arrays.asList( + new InvoiceCustomField.Builder() + .ownerId(130) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name2") + .value("value4") + .metadatumId(130) + .build() + ) +) +.build(); ``` diff --git a/doc/models/customer-error-response-exception.md b/doc/models/customer-error-response-exception.md index 8cd85718..c618ca65 100644 --- a/doc/models/customer-error-response-exception.md +++ b/doc/models/customer-error-response-exception.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`CustomerErrorResponseErrors`](../../doc/models/containers/customer-error-response-errors.md) | Optional | This is a container for one-of cases. | CustomerErrorResponseErrors getErrors() | setErrors(CustomerErrorResponseErrors errors) | -## Example (as JSON) - -```json -{ - "errors": { - "customer": "customer8" - } +## Example + +```java +try { + // make the API call +} catch (CustomerErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/customer-error.md b/doc/models/customer-error.md index 074eade3..6c7058bf 100644 --- a/doc/models/customer-error.md +++ b/doc/models/customer-error.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `Customer` | `String` | Optional | - | String getCustomer() | setCustomer(String customer) | -## Example (as JSON) +## Example -```json -{ - "customer": "customer8" -} +```java +import com.maxio.advancedbilling.models.CustomerError; + +CustomerError customerError = new CustomerError.Builder() + .customer("customer8") + .build(); ``` diff --git a/doc/models/customer-payer-change.md b/doc/models/customer-payer-change.md index f961c67d..2ae69b56 100644 --- a/doc/models/customer-payer-change.md +++ b/doc/models/customer-payer-change.md @@ -12,22 +12,26 @@ | `Before` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | InvoicePayerChange getBefore() | setBefore(InvoicePayerChange before) | | `After` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | InvoicePayerChange getAfter() | setAfter(InvoicePayerChange after) | -## Example (as JSON) - -```json -{ - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CustomerPayerChange; +import com.maxio.advancedbilling.models.InvoicePayerChange; + +CustomerPayerChange customerPayerChange = new CustomerPayerChange.Builder( + new InvoicePayerChange.Builder() + .firstName("first_name0") + .lastName("last_name8") + .organization("organization4") + .email("email6") + .build(), + new InvoicePayerChange.Builder() + .firstName("first_name2") + .lastName("last_name0") + .organization("organization4") + .email("email4") + .build() +) +.build(); ``` diff --git a/doc/models/customer-response.md b/doc/models/customer-response.md index 40ea5cd1..04c304b5 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Customer` | [`Customer`](../../doc/models/customer.md) | Required | - | Customer getCustomer() | setCustomer(Customer customer) | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Customer; +import com.maxio.advancedbilling.models.CustomerResponse; + +CustomerResponse customerResponse = new CustomerResponse.Builder( + new Customer.Builder() + .firstName("first_name0") + .lastName("last_name8") + .email("email6") + .ccEmails("cc_emails0") + .organization("organization6") + .build() +) +.build(); ``` diff --git a/doc/models/customer.md b/doc/models/customer.md index ffc813bf..18332ecf 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -12,18 +12,18 @@ | `FirstName` | `String` | Optional | The first name of the customer | String getFirstName() | setFirstName(String firstName) | | `LastName` | `String` | Optional | The last name of the customer | String getLastName() | setLastName(String lastName) | | `Email` | `String` | Optional | The email address of the customer | String getEmail() | setEmail(String email) | -| `CcEmails` | `String` | Optional | A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) | String getCcEmails() | setCcEmails(String ccEmails) | +| `CcEmails` | `String` | Optional | “A comma-separated list of emails that should be cc’d on all customer communications (e.g., “joe@example.com, sue@example.com”)” | String getCcEmails() | setCcEmails(String ccEmails) | | `Organization` | `String` | Optional | The organization of the customer. If no value, `null` or empty string is provided, `organization` will be populated with the customer's first and last name, separated with a space. | String getOrganization() | setOrganization(String organization) | | `Reference` | `String` | Optional | The unique identifier used within your own application for this customer | String getReference() | setReference(String reference) | | `Id` | `Integer` | Optional | The customer ID in Chargify | Integer getId() | setId(Integer id) | | `CreatedAt` | `ZonedDateTime` | Optional | The timestamp in which the customer object was created in Chargify | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | The timestamp in which the customer object was last edited | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -| `Address` | `String` | Optional | The customer’s shipping street address (i.e. “123 Main St.”) | String getAddress() | setAddress(String address) | -| `Address2` | `String` | Optional | Second line of the customer’s shipping address i.e. “Apt. 100” | String getAddress2() | setAddress2(String address2) | -| `City` | `String` | Optional | The customer’s shipping address city (i.e. “Boston”) | String getCity() | setCity(String city) | -| `State` | `String` | Optional | The customer’s shipping address state (i.e. “MA”) | String getState() | setState(String state) | +| `Address` | `String` | Optional | The customer’s shipping street address (e.g., “123 Main St.”) | String getAddress() | setAddress(String address) | +| `Address2` | `String` | Optional | Second line of the customer’s shipping address e.g., “Apt. 100” | String getAddress2() | setAddress2(String address2) | +| `City` | `String` | Optional | The customer’s shipping address city (e.g., “Boston”) | String getCity() | setCity(String city) | +| `State` | `String` | Optional | The customer’s shipping address state (e.g., “MA”) | String getState() | setState(String state) | | `StateName` | `String` | Optional | The customer's full name of state | String getStateName() | setStateName(String stateName) | -| `Zip` | `String` | Optional | The customer’s shipping address zip code (i.e. “12345”) | String getZip() | setZip(String zip) | +| `Zip` | `String` | Optional | The customer’s shipping address zip code (e.g., “12345”) | String getZip() | setZip(String zip) | | `Country` | `String` | Optional | The customer shipping address country | String getCountry() | setCountry(String country) | | `CountryName` | `String` | Optional | The customer's full name of country | String getCountryName() | setCountryName(String countryName) | | `Phone` | `String` | Optional | The phone number of the customer | String getPhone() | setPhone(String phone) | @@ -32,6 +32,7 @@ | `PortalInviteLastSentAt` | `ZonedDateTime` | Optional | The timestamp of when the Billing Portal invite was last sent at | ZonedDateTime getPortalInviteLastSentAt() | setPortalInviteLastSentAt(ZonedDateTime portalInviteLastSentAt) | | `PortalInviteLastAcceptedAt` | `ZonedDateTime` | Optional | The timestamp of when the Billing Portal invite was last accepted | ZonedDateTime getPortalInviteLastAcceptedAt() | setPortalInviteLastAcceptedAt(ZonedDateTime portalInviteLastAcceptedAt) | | `TaxExempt` | `Boolean` | Optional | The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. | Boolean getTaxExempt() | setTaxExempt(Boolean taxExempt) | +| `Surcharging` | `Boolean` | Optional | Whether surcharging is enabled for the customer. Only included on sites where surcharging control is enabled. | Boolean getSurcharging() | setSurcharging(Boolean surcharging) | | `VatNumber` | `String` | Optional | The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out. | String getVatNumber() | setVatNumber(String vatNumber) | | `ParentId` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | Integer getParentId() | setParentId(Integer parentId) | | `Locale` | `String` | Optional | The locale for the customer to identify language-region | String getLocale() | setLocale(String locale) | @@ -40,16 +41,19 @@ | `TaxExemptReason` | `String` | Optional | The Tax Exemption Reason Code for the customer | String getTaxExemptReason() | setTaxExemptReason(String taxExemptReason) | | `DefaultAutoRenewalProfileId` | `Integer` | Optional | The default auto-renewal profile ID for the customer | Integer getDefaultAutoRenewalProfileId() | setDefaultAutoRenewalProfileId(Integer defaultAutoRenewalProfileId) | | `Maxioid` | `String` | Optional | The Maxio-generated unique identifier for the customer. | String getMaxioid() | setMaxioid(String maxioid) | +| `BrandingThemeId` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | Integer getBrandingThemeId() | setBrandingThemeId(Integer brandingThemeId) | -## Example (as JSON) +## Example -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails2", - "organization": "organization8" -} +```java +import com.maxio.advancedbilling.models.Customer; + +Customer customer = new Customer.Builder() + .firstName("first_name0") + .lastName("last_name8") + .email("email6") + .ccEmails("cc_emails0") + .organization("organization6") + .build(); ``` diff --git a/doc/models/debit-note-role.md b/doc/models/debit-note-role.md index 9c261a9f..ece03a8b 100644 --- a/doc/models/debit-note-role.md +++ b/doc/models/debit-note-role.md @@ -14,3 +14,11 @@ The role of the debit note. | `CHARGEBACK` | | `REFUND` | +## Example + +```java +import com.maxio.advancedbilling.models.DebitNoteRole; + +DebitNoteRole debitNoteRole = DebitNoteRole.CHARGEBACK; +``` + diff --git a/doc/models/debit-note-status.md b/doc/models/debit-note-status.md index 48eb3cb1..277d445c 100644 --- a/doc/models/debit-note-status.md +++ b/doc/models/debit-note-status.md @@ -16,3 +16,11 @@ Current status of the debit note. | `BANISHED` | | `PAID` | +## Example + +```java +import com.maxio.advancedbilling.models.DebitNoteStatus; + +DebitNoteStatus debitNoteStatus = DebitNoteStatus.OPEN; +``` + diff --git a/doc/models/debit-note.md b/doc/models/debit-note.md index d1172953..85c4be5e 100644 --- a/doc/models/debit-note.md +++ b/doc/models/debit-note.md @@ -13,10 +13,10 @@ | `SiteId` | `Integer` | Optional | ID of the site to which the debit note belongs. | Integer getSiteId() | setSiteId(Integer siteId) | | `CustomerId` | `Integer` | Optional | ID of the customer to which the debit note belongs. | Integer getCustomerId() | setCustomerId(Integer customerId) | | `SubscriptionId` | `Integer` | Optional | ID of the subscription that generated the debit note. | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | -| `Number` | `Integer` | Optional | A unique, identifier that appears on the debit note and in places it is referenced. | Integer getNumber() | setNumber(Integer number) | +| `Number` | `Integer` | Optional | A unique identifier that appears on the debit note and in places it is referenced. | Integer getNumber() | setNumber(Integer number) | | `SequenceNumber` | `Integer` | Optional | A monotonically increasing number assigned to debit notes as they are created. | Integer getSequenceNumber() | setSequenceNumber(Integer sequenceNumber) | | `OriginCreditNoteUid` | `String` | Optional | Unique identifier for the connected credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | String getOriginCreditNoteUid() | setOriginCreditNoteUid(String originCreditNoteUid) | -| `OriginCreditNoteNumber` | `String` | Optional | A unique, identifying string of the connected credit note. | String getOriginCreditNoteNumber() | setOriginCreditNoteNumber(String originCreditNoteNumber) | +| `OriginCreditNoteNumber` | `String` | Optional | A unique identifying string of the connected credit note. | String getOriginCreditNoteNumber() | setOriginCreditNoteNumber(String originCreditNoteNumber) | | `IssueDate` | `LocalDate` | Optional | Date the document was issued to the customer. This is the date that the document was made available for payment.

The format is "YYYY-MM-DD". | LocalDate getIssueDate() | setIssueDate(LocalDate issueDate) | | `AppliedDate` | `LocalDate` | Optional | Debit notes are applied to invoices to offset invoiced amounts - they adjust the amount due. This field is the date the debit note document became fully applied to the invoice.

The format is "YYYY-MM-DD". | LocalDate getAppliedDate() | setAppliedDate(LocalDate appliedDate) | | `DueDate` | `LocalDate` | Optional | Date the document is due for payment. The format is "YYYY-MM-DD". | LocalDate getDueDate() | setDueDate(LocalDate dueDate) | @@ -25,7 +25,7 @@ | `Role` | [`DebitNoteRole`](../../doc/models/debit-note-role.md) | Optional | The role of the debit note. | DebitNoteRole getRole() | setRole(DebitNoteRole role) | | `Currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | String getCurrency() | setCurrency(String currency) | | `Seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the debit note. | InvoiceSeller getSeller() | setSeller(InvoiceSeller seller) | -| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the debited subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | +| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is the owner or recipient of the debited subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | | `BillingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the debited subscription. | InvoiceAddress getBillingAddress() | setBillingAddress(InvoiceAddress billingAddress) | | `ShippingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the debited subscription. | InvoiceAddress getShippingAddress() | setShippingAddress(InvoiceAddress shippingAddress) | | `LineItems` | [`List`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the debit note. | List getLineItems() | setLineItems(List lineItems) | @@ -33,15 +33,17 @@ | `Taxes` | [`List`](../../doc/models/invoice-tax.md) | Optional | - | List getTaxes() | setTaxes(List taxes) | | `Refunds` | [`List`](../../doc/models/invoice-refund.md) | Optional | - | List getRefunds() | setRefunds(List refunds) | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": 172 -} +```java +import com.maxio.advancedbilling.models.DebitNote; + +DebitNote debitNote = new DebitNote.Builder() + .uid("uid2") + .siteId(196) + .customerId(52) + .subscriptionId(124) + .number(0) + .build(); ``` diff --git a/doc/models/deduct-service-credit-request.md b/doc/models/deduct-service-credit-request.md index ff79df94..8c2c8a6b 100644 --- a/doc/models/deduct-service-credit-request.md +++ b/doc/models/deduct-service-credit-request.md @@ -11,14 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Deduction` | [`DeductServiceCredit`](../../doc/models/deduct-service-credit.md) | Required | - | DeductServiceCredit getDeduction() | setDeduction(DeductServiceCredit deduction) | -## Example (as JSON) - -```json -{ - "deduction": { - "amount": "String9", - "memo": "memo0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.DeductServiceCredit; +import com.maxio.advancedbilling.models.DeductServiceCreditRequest; +import com.maxio.advancedbilling.models.containers.DeductServiceCreditAmount; + +DeductServiceCreditRequest deductServiceCreditRequest = new DeductServiceCreditRequest.Builder( + new DeductServiceCredit.Builder( + DeductServiceCreditAmount.fromString( + "String9" + ) + ) + .memo("memo0") + .build() +) +.build(); ``` diff --git a/doc/models/deduct-service-credit.md b/doc/models/deduct-service-credit.md index a5c0b087..0216be9b 100644 --- a/doc/models/deduct-service-credit.md +++ b/doc/models/deduct-service-credit.md @@ -12,12 +12,18 @@ | `Amount` | [`DeductServiceCreditAmount`](../../doc/models/containers/deduct-service-credit-amount.md) | Required | This is a container for one-of cases. | DeductServiceCreditAmount getAmount() | setAmount(DeductServiceCreditAmount amount) | | `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | -## Example (as JSON) - -```json -{ - "amount": "String1", - "memo": "memo2" -} +## Example + +```java +import com.maxio.advancedbilling.models.DeductServiceCredit; +import com.maxio.advancedbilling.models.containers.DeductServiceCreditAmount; + +DeductServiceCredit deductServiceCredit = new DeductServiceCredit.Builder( + DeductServiceCreditAmount.fromString( + "String5" + ) +) +.memo("memo6") +.build(); ``` diff --git a/doc/models/delayed-cancellation-response.md b/doc/models/delayed-cancellation-response.md index 8e278eb0..38d6cbc2 100644 --- a/doc/models/delayed-cancellation-response.md +++ b/doc/models/delayed-cancellation-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `Message` | `String` | Optional | - | String getMessage() | setMessage(String message) | -## Example (as JSON) +## Example -```json -{ - "message": "message8" -} +```java +import com.maxio.advancedbilling.models.DelayedCancellationResponse; + +DelayedCancellationResponse delayedCancellationResponse = new DelayedCancellationResponse.Builder() + .message("message4") + .build(); ``` diff --git a/doc/models/delete-subscription-group-response.md b/doc/models/delete-subscription-group-response.md index 5db58ef0..ffd6c711 100644 --- a/doc/models/delete-subscription-group-response.md +++ b/doc/models/delete-subscription-group-response.md @@ -12,12 +12,14 @@ | `Uid` | `String` | Optional | - | String getUid() | setUid(String uid) | | `Deleted` | `Boolean` | Optional | - | Boolean getDeleted() | setDeleted(Boolean deleted) | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "deleted": false -} +```java +import com.maxio.advancedbilling.models.DeleteSubscriptionGroupResponse; + +DeleteSubscriptionGroupResponse deleteSubscriptionGroupResponse = new DeleteSubscriptionGroupResponse.Builder() + .uid("uid0") + .deleted(false) + .build(); ``` diff --git a/doc/models/deliver-proforma-invoice-request.md b/doc/models/deliver-proforma-invoice-request.md index bd1eb570..c2993e76 100644 --- a/doc/models/deliver-proforma-invoice-request.md +++ b/doc/models/deliver-proforma-invoice-request.md @@ -13,21 +13,25 @@ | `CcRecipientEmails` | `List` | Optional | - | List getCcRecipientEmails() | setCcRecipientEmails(List ccRecipientEmails) | | `BccRecipientEmails` | `List` | Optional | - | List getBccRecipientEmails() | setBccRecipientEmails(List bccRecipientEmails) | -## Example (as JSON) - -```json -{ - "recipient_emails": [ - "recipient_emails9" - ], - "cc_recipient_emails": [ - "cc_recipient_emails8" - ], - "bcc_recipient_emails": [ - "bcc_recipient_emails2", - "bcc_recipient_emails3", - "bcc_recipient_emails4" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.DeliverProformaInvoiceRequest; +import java.util.Arrays; + +DeliverProformaInvoiceRequest deliverProformaInvoiceRequest = new DeliverProformaInvoiceRequest.Builder() + .recipientEmails(Arrays.asList( + "recipient_emails3", + "recipient_emails4" + )) + .ccRecipientEmails(Arrays.asList( + "cc_recipient_emails2", + "cc_recipient_emails1", + "cc_recipient_emails0" + )) + .bccRecipientEmails(Arrays.asList( + "bcc_recipient_emails6" + )) + .build(); ``` diff --git a/doc/models/direction.md b/doc/models/direction.md index ef6c29da..fe1c7b74 100644 --- a/doc/models/direction.md +++ b/doc/models/direction.md @@ -12,3 +12,11 @@ | `ASC` | | `DESC` | +## Example + +```java +import com.maxio.advancedbilling.models.Direction; + +Direction direction = Direction.ASC; +``` + diff --git a/doc/models/discount-type.md b/doc/models/discount-type.md index 77357ece..102e3d28 100644 --- a/doc/models/discount-type.md +++ b/doc/models/discount-type.md @@ -12,3 +12,11 @@ | `AMOUNT` | | `PERCENT` | +## Example + +```java +import com.maxio.advancedbilling.models.DiscountType; + +DiscountType discountType = DiscountType.AMOUNT; +``` + diff --git a/doc/models/downgrade-credit-credit-type.md b/doc/models/downgrade-credit-credit-type.md index 50858a3b..bd43c38e 100644 --- a/doc/models/downgrade-credit-credit-type.md +++ b/doc/models/downgrade-credit-credit-type.md @@ -21,3 +21,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```java +import com.maxio.advancedbilling.models.DowngradeCreditCreditType; + +DowngradeCreditCreditType downgradeCreditCreditType = DowngradeCreditCreditType.FULL; +``` + diff --git a/doc/models/dunner-data.md b/doc/models/dunner-data.md index 21aa206e..8bac6bf2 100644 --- a/doc/models/dunner-data.md +++ b/doc/models/dunner-data.md @@ -16,16 +16,20 @@ | `Attempts` | `int` | Required | - | int getAttempts() | setAttempts(int attempts) | | `LastAttemptedAt` | `ZonedDateTime` | Required | - | ZonedDateTime getLastAttemptedAt() | setLastAttemptedAt(ZonedDateTime lastAttemptedAt) | -## Example (as JSON) - -```json -{ - "state": "state4", - "subscription_id": 126, - "revenue_at_risk_in_cents": 30, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 110, - "last_attempted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.DunnerData; + +DunnerData dunnerData = new DunnerData.Builder( + "state4", + 230, + 134L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + 6, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") +) +.build(); ``` diff --git a/doc/models/dunning-step-data.md b/doc/models/dunning-step-data.md index 9fede74c..dd3b09b2 100644 --- a/doc/models/dunning-step-data.md +++ b/doc/models/dunning-step-data.md @@ -18,18 +18,21 @@ | `SendSms` | `boolean` | Required | - | boolean getSendSms() | setSendSms(boolean sendSms) | | `SmsBody` | `String` | Optional | - | String getSmsBody() | setSmsBody(String smsBody) | -## Example (as JSON) - -```json -{ - "day_threshold": 88, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" -} +## Example + +```java +import com.maxio.advancedbilling.models.DunningStepData; + +DunningStepData dunningStepData = new DunningStepData.Builder( + 206, + "action6", + false, + false, + false +) +.emailBody("email_body6") +.emailSubject("email_subject6") +.smsBody("sms_body8") +.build(); ``` diff --git a/doc/models/dunning-step-reached.md b/doc/models/dunning-step-reached.md index 2f0dd017..f3378429 100644 --- a/doc/models/dunning-step-reached.md +++ b/doc/models/dunning-step-reached.md @@ -13,38 +13,47 @@ | `CurrentStep` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | DunningStepData getCurrentStep() | setCurrentStep(DunningStepData currentStep) | | `NextStep` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | DunningStepData getNextStep() | setNextStep(DunningStepData nextStep) | -## Example (as JSON) - -```json -{ - "dunner": { - "state": "state8", - "subscription_id": 194, - "revenue_at_risk_in_cents": 98, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 42, - "last_attempted_at": "2016-03-13T12:52:32.123Z" - }, - "current_step": { - "day_threshold": 198, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject6", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" - }, - "next_step": { - "day_threshold": 30, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.DunnerData; +import com.maxio.advancedbilling.models.DunningStepData; +import com.maxio.advancedbilling.models.DunningStepReached; + +DunningStepReached dunningStepReached = new DunningStepReached.Builder( + new DunnerData.Builder( + "state8", + 194, + 98L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + 42, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") + ) + .build(), + new DunningStepData.Builder( + 198, + "action4", + false, + false, + false + ) + .emailBody("email_body4") + .emailSubject("email_subject6") + .smsBody("sms_body0") + .build(), + new DunningStepData.Builder( + 30, + "action4", + false, + false, + false + ) + .emailBody("email_body4") + .emailSubject("email_subject4") + .smsBody("sms_body0") + .build() +) +.build(); ``` diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index cf96b422..ed1d7ebc 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | String getName() | setName(String name) | -| `UnitName` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | String getUnitName() | setUnitName(String unitName) | +| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, i.e., "Minutes". | String getName() | setName(String name) | +| `UnitName` | `String` | Required | “The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e., “message”, which may then be shown as “5 messages” on a subscription’s component line-item” | String getUnitName() | setUnitName(String unitName) | | `Description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | String getDescription() | setDescription(String description) | -| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | +| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | @@ -21,36 +21,81 @@ | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | String getTaxCode() | setTaxCode(String taxCode) | | `HideDateRangeOnInvoice` | `Boolean` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | Boolean getHideDateRangeOnInvoice() | setHideDateRangeOnInvoice(Boolean hideDateRangeOnInvoice) | | `EventBasedBillingMetricId` | `int` | Required | The ID of an event based billing metric that will be attached to this component. | int getEventBasedBillingMetricId() | setEventBasedBillingMetricId(int eventBasedBillingMetricId) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. i.e., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | -## Example (as JSON) - -```json -{ - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ], - "event_based_billing_metric_id": 190 -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePointItem; +import com.maxio.advancedbilling.models.EBBComponent; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +EBBComponent eBBComponent = new EBBComponent.Builder( + "name0", + "unit_name2", + PricingScheme.STAIRSTEP, + 36 +) +.description("description0") +.handle("handle6") +.taxable(false) +.prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) +.pricePoints(Arrays.asList( + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build(), + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build(), + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build() + )) +.build(); ``` diff --git a/doc/models/ebb-event.md b/doc/models/ebb-event.md index 16d33fd3..e1e541aa 100644 --- a/doc/models/ebb-event.md +++ b/doc/models/ebb-event.md @@ -11,28 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `Chargify` | [`ChargifyEBB`](../../doc/models/chargify-ebb.md) | Optional | - | ChargifyEBB getChargify() | setChargify(ChargifyEBB chargify) | -## Example (as JSON) - -```json -{ - "chargify": { - "subscription_id": 1, - "timestamp": "2020-02-27T17:45:50-05:00", - "id": "id6", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token2" - }, - "messages": 150, - "country": "US", - "customer": { - "name": "John", - "lastName": "Doe", - "address": { - "street": "Maple Street", - "zip": 4888, - "state": "MA" - } - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ChargifyEBB; +import com.maxio.advancedbilling.models.EBBEvent; + +EBBEvent eBBEvent = new EBBEvent.Builder() + .chargify(new ChargifyEBB.Builder() + .timestamp(DateTimeHelper.fromRfc8601DateTime("2020-02-27T17:45:50-05:00")) + .subscriptionId(1) + .build()) + .build(); ``` diff --git a/doc/models/enable-webhooks-request.md b/doc/models/enable-webhooks-request.md index 16e2b4f9..0efc58b4 100644 --- a/doc/models/enable-webhooks-request.md +++ b/doc/models/enable-webhooks-request.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | --- | --- | | `WebhooksEnabled` | `boolean` | Required | - | boolean getWebhooksEnabled() | setWebhooksEnabled(boolean webhooksEnabled) | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```java +import com.maxio.advancedbilling.models.EnableWebhooksRequest; + +EnableWebhooksRequest enableWebhooksRequest = new EnableWebhooksRequest.Builder( + false +) +.build(); ``` diff --git a/doc/models/enable-webhooks-response.md b/doc/models/enable-webhooks-response.md index 258d7a24..fb8dad49 100644 --- a/doc/models/enable-webhooks-response.md +++ b/doc/models/enable-webhooks-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `WebhooksEnabled` | `Boolean` | Optional | - | Boolean getWebhooksEnabled() | setWebhooksEnabled(Boolean webhooksEnabled) | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```java +import com.maxio.advancedbilling.models.EnableWebhooksResponse; + +EnableWebhooksResponse enableWebhooksResponse = new EnableWebhooksResponse.Builder() + .webhooksEnabled(false) + .build(); ``` diff --git a/doc/models/endpoint-response.md b/doc/models/endpoint-response.md index 1e55891c..2c8fd433 100644 --- a/doc/models/endpoint-response.md +++ b/doc/models/endpoint-response.md @@ -11,19 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `Endpoint` | [`Endpoint`](../../doc/models/endpoint.md) | Optional | - | Endpoint getEndpoint() | setEndpoint(Endpoint endpoint) | -## Example (as JSON) - -```json -{ - "endpoint": { - "id": 202, - "url": "url2", - "site_id": 128, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4" - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Endpoint; +import com.maxio.advancedbilling.models.EndpointResponse; +import java.util.Arrays; + +EndpointResponse endpointResponse = new EndpointResponse.Builder() + .endpoint(new Endpoint.Builder() + .id(202) + .url("url2") + .siteId(128) + .status("status0") + .webhookSubscriptions(Arrays.asList( + "webhook_subscriptions4" + )) + .build()) + .build(); ``` diff --git a/doc/models/endpoint.md b/doc/models/endpoint.md index 271f7d87..136dca02 100644 --- a/doc/models/endpoint.md +++ b/doc/models/endpoint.md @@ -15,18 +15,20 @@ | `Status` | `String` | Optional | - | String getStatus() | setStatus(String status) | | `WebhookSubscriptions` | `List` | Optional | - | List getWebhookSubscriptions() | setWebhookSubscriptions(List webhookSubscriptions) | -## Example (as JSON) - -```json -{ - "id": 196, - "url": "url2", - "site_id": 122, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4", - "webhook_subscriptions3" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.Endpoint; +import java.util.Arrays; + +Endpoint endpoint = new Endpoint.Builder() + .id(202) + .url("url2") + .siteId(128) + .status("status0") + .webhookSubscriptions(Arrays.asList( + "webhook_subscriptions4" + )) + .build(); ``` diff --git a/doc/models/error-array-map-response-exception.md b/doc/models/error-array-map-response-exception.md index 49e35242..6c9a880f 100644 --- a/doc/models/error-array-map-response-exception.md +++ b/doc/models/error-array-map-response-exception.md @@ -11,16 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | `Map` | Optional | - | Map getErrors() | setErrors(Map errors) | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } +## Example + +```java +try { + // make the API call +} catch (ErrorArrayMapResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/error-list-response-exception.md b/doc/models/error-list-response-exception.md index 0d6a69ce..dddd7e44 100644 --- a/doc/models/error-list-response-exception.md +++ b/doc/models/error-list-response-exception.md @@ -13,15 +13,15 @@ Error which contains list of messages. | --- | --- | --- | --- | --- | --- | | `Errors` | `List` | Required | - | List getErrors() | setErrors(List errors) | -## Example (as JSON) - -```json -{ - "errors": [ - "errors5", - "errors6", - "errors7" - ] +## Example + +```java +try { + // make the API call +} catch (ErrorListResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/error-string-map-response-exception.md b/doc/models/error-string-map-response-exception.md index 219e1f31..fabed619 100644 --- a/doc/models/error-string-map-response-exception.md +++ b/doc/models/error-string-map-response-exception.md @@ -11,14 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | `Map` | Optional | - | Map getErrors() | setErrors(Map errors) | -## Example (as JSON) - -```json -{ - "errors": { - "key0": "errors3", - "key1": "errors4" - } +## Example + +```java +try { + // make the API call +} catch (ErrorStringMapResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/errors.md b/doc/models/errors.md index dd23da6f..32182e53 100644 --- a/doc/models/errors.md +++ b/doc/models/errors.md @@ -12,18 +12,23 @@ | `PerPage` | `List` | Optional | - | List getPerPage() | setPerPage(List perPage) | | `PricePoint` | `List` | Optional | - | List getPricePoint() | setPricePoint(List pricePoint) | -## Example (as JSON) - -```json -{ - "per_page": [ - "per_page7", - "per_page8" - ], - "price_point": [ - "price_point6", - "price_point7" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.Errors; +import java.util.Arrays; + +Errors errors = new Errors.Builder() + .perPage(Arrays.asList( + "per_page1", + "per_page2", + "per_page3" + )) + .pricePoint(Arrays.asList( + "price_point0", + "price_point9", + "price_point8" + )) + .build(); ``` diff --git a/doc/models/event-based-billing-list-segments-errors-exception.md b/doc/models/event-based-billing-list-segments-errors-exception.md index 1cc15fd6..ca5c50ac 100644 --- a/doc/models/event-based-billing-list-segments-errors-exception.md +++ b/doc/models/event-based-billing-list-segments-errors-exception.md @@ -11,22 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`Errors`](../../doc/models/errors.md) | Optional | - | Errors getErrors() | setErrors(Errors errors) | -## Example (as JSON) - -```json -{ - "errors": { - "per_page": [ - "per_page1", - "per_page2", - "per_page3" - ], - "price_point": [ - "price_point0", - "price_point9", - "price_point8" - ] - } +## Example + +```java +try { + // make the API call +} catch (EventBasedBillingListSegmentsErrorsException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/event-based-billing-segment-error.md b/doc/models/event-based-billing-segment-error.md index f4ad7c92..e4f96901 100644 --- a/doc/models/event-based-billing-segment-error.md +++ b/doc/models/event-based-billing-segment-error.md @@ -11,20 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `Segments` | `Map` | Required | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | Map getSegments() | setSegments(Map segments) | -## Example (as JSON) - -```json -{ - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - } - } -} +## Example + +```java +import com.maxio.advancedbilling.ApiHelper; +import com.maxio.advancedbilling.models.EventBasedBillingSegmentError; +import java.io.IOException; +import java.util.LinkedHashMap; + +EventBasedBillingSegmentError eventBasedBillingSegmentError = new EventBasedBillingSegmentError.Builder( + new LinkedHashMap() {{ + put("key0", ApiHelper.deserialize("{\"key1\":\"val1\",\"key2\":\"val2\"}")); + put("key1", ApiHelper.deserialize("{\"key1\":\"val1\",\"key2\":\"val2\"}")); + }} +) +.build(); ``` diff --git a/doc/models/event-based-billing-segment-errors-exception.md b/doc/models/event-based-billing-segment-errors-exception.md index b90d7cdf..7001a4e3 100644 --- a/doc/models/event-based-billing-segment-errors-exception.md +++ b/doc/models/event-based-billing-segment-errors-exception.md @@ -11,24 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | `Map` | Optional | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | Map getErrors() | setErrors(Map errors) | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - }, - "key2": { - "key1": "val1", - "key2": "val2" - } - } +## Example + +```java +try { + // make the API call +} catch (EventBasedBillingSegmentErrorsException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/event-based-billing-segment-exception.md b/doc/models/event-based-billing-segment-exception.md index 4a19d19a..893bb730 100644 --- a/doc/models/event-based-billing-segment-exception.md +++ b/doc/models/event-based-billing-segment-exception.md @@ -11,18 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error.md) | Required | - | EventBasedBillingSegmentError getErrors() | setErrors(EventBasedBillingSegmentError errors) | -## Example (as JSON) - -```json -{ - "errors": { - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } - } +## Example + +```java +try { + // make the API call +} catch (EventBasedBillingSegmentException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/event-key.md b/doc/models/event-key.md index a400739e..515809db 100644 --- a/doc/models/event-key.md +++ b/doc/models/event-key.md @@ -21,6 +21,7 @@ | `RENEWAL_FAILURE` | | `SUBSCRIPTION_STATE_CHANGE` | | `SUBSCRIPTION_PRODUCT_CHANGE` | +| `SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED` | | `PENDING_CANCELLATION_CHANGE` | | `EXPIRING_CARD` | | `CUSTOMER_UPDATE` | @@ -93,3 +94,11 @@ | `SUBSCRIPTION_TERM_RENEWAL_ACTIVATED` | | `SUBSCRIPTION_TERM_RENEWAL_REMOVED` | +## Example + +```java +import com.maxio.advancedbilling.models.EventKey; + +EventKey eventKey = EventKey.SUBSCRIPTION_GROUP_SIGNUP_SUCCESS; +``` + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 13f19a70..2cde1204 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -11,34 +11,37 @@ | --- | --- | --- | --- | --- | --- | | `Event` | [`Event`](../../doc/models/event.md) | Required | - | Event getEvent() | setEvent(Event event) | -## Example (as JSON) - -```json -{ - "event": { - "id": 242, - "key": "maxio_payments_direct_debit_payment_rejected", - "message": "message0", - "subscription_id": 96, - "customer_id": 24, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Event; +import com.maxio.advancedbilling.models.EventKey; +import com.maxio.advancedbilling.models.EventResponse; +import com.maxio.advancedbilling.models.SubscriptionProductChange; +import com.maxio.advancedbilling.models.containers.EventEventSpecificData; + +EventResponse eventResponse = new EventResponse.Builder( + new Event.Builder( + 242L, + EventKey.SUBSCRIPTION_REMOVED_FROM_GROUP, + "message0", + 96, + 24, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + EventEventSpecificData.fromSubscriptionProductChange( + new SubscriptionProductChange.Builder( + 126, + 12 + ) + .previousProductPricePointId(250) + .newProductPricePointId(244) + .effectiveAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() + ) + ) + .build() +) +.build(); ``` diff --git a/doc/models/event.md b/doc/models/event.md index 876929d7..99e37bfb 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -17,32 +17,33 @@ | `CreatedAt` | `ZonedDateTime` | Required | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `EventSpecificData` | [`EventEventSpecificData`](../../doc/models/containers/event-event-specific-data.md) | Required | This is a container for one-of cases. | EventEventSpecificData getEventSpecificData() | setEventSpecificData(EventEventSpecificData eventSpecificData) | -## Example (as JSON) - -```json -{ - "id": 40, - "key": "subscription_group_signup_success", - "message": "message8", - "subscription_id": 150, - "customer_id": 78, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Event; +import com.maxio.advancedbilling.models.EventKey; +import com.maxio.advancedbilling.models.SubscriptionProductChange; +import com.maxio.advancedbilling.models.containers.EventEventSpecificData; + +Event event = new Event.Builder( + 242L, + EventKey.SUBSCRIPTION_REMOVED_FROM_GROUP, + "message0", + 96, + 24, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + EventEventSpecificData.fromSubscriptionProductChange( + new SubscriptionProductChange.Builder( + 126, + 12 + ) + .previousProductPricePointId(250) + .newProductPricePointId(244) + .effectiveAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() + ) +) +.build(); ``` diff --git a/doc/models/expiration-interval-unit.md b/doc/models/expiration-interval-unit.md index d6b75bef..0d00a1ac 100644 --- a/doc/models/expiration-interval-unit.md +++ b/doc/models/expiration-interval-unit.md @@ -13,3 +13,11 @@ | `MONTH` | | `NEVER` | +## Example + +```java +import com.maxio.advancedbilling.models.ExpirationIntervalUnit; + +ExpirationIntervalUnit expirationIntervalUnit = ExpirationIntervalUnit.NEVER; +``` + diff --git a/doc/models/failed-payment-action.md b/doc/models/failed-payment-action.md index 4d48d023..c3b86427 100644 --- a/doc/models/failed-payment-action.md +++ b/doc/models/failed-payment-action.md @@ -5,7 +5,7 @@ Action taken when payment for an invoice fails: - `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option. - `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history. -- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings). +- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings). ## Enumeration @@ -19,3 +19,11 @@ Action taken when payment for an invoice fails: | `ROLLBACK_TO_PENDING` | | `INITIATE_DUNNING` | +## Example + +```java +import com.maxio.advancedbilling.models.FailedPaymentAction; + +FailedPaymentAction failedPaymentAction = FailedPaymentAction.LEAVE_OPEN_INVOICE; +``` + diff --git a/doc/models/failed-payment-event-data.md b/doc/models/failed-payment-event-data.md index 7e0b996b..6f8e367b 100644 --- a/doc/models/failed-payment-event-data.md +++ b/doc/models/failed-payment-event-data.md @@ -17,15 +17,19 @@ Example schema for an `failed_payment` event | `PaymentMethod` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | - | InvoicePaymentMethodType getPaymentMethod() | setPaymentMethod(InvoicePaymentMethodType paymentMethod) | | `TransactionId` | `int` | Required | The transaction ID of the failed payment. | int getTransactionId() | setTransactionId(int transactionId) | -## Example (as JSON) - -```json -{ - "amount_in_cents": 128, - "applied_amount": 154, - "memo": "memo2", - "payment_method": "credit_card", - "transaction_id": 170 -} +## Example + +```java +import com.maxio.advancedbilling.models.FailedPaymentEventData; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; + +FailedPaymentEventData failedPaymentEventData = new FailedPaymentEventData.Builder( + 34, + 196, + InvoicePaymentMethodType.ACH, + 76 +) +.memo("memo0") +.build(); ``` diff --git a/doc/models/failed-payment-event.md b/doc/models/failed-payment-event.md index 2bd9fb6e..bcbdaa50 100644 --- a/doc/models/failed-payment-event.md +++ b/doc/models/failed-payment-event.md @@ -15,31 +15,40 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.FAILED_PAYMENT` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`FailedPaymentEventData`](../../doc/models/failed-payment-event-data.md) | Required | Example schema for an `failed_payment` event | FailedPaymentEventData getEventData() | setEventData(FailedPaymentEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 120, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "failed_payment", - "event_data": { - "amount_in_cents": 220, - "applied_amount": 194, - "memo": "memo0", - "payment_method": "cash", - "transaction_id": 78 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.FailedPaymentEvent; +import com.maxio.advancedbilling.models.FailedPaymentEventData; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; + +FailedPaymentEvent failedPaymentEvent = new FailedPaymentEvent.Builder( + 186L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.FAILED_PAYMENT, + new FailedPaymentEventData.Builder( + 220, + 194, + InvoicePaymentMethodType.CASH, + 78 + ) + .memo("memo0") + .build() +) +.build(); ``` diff --git a/doc/models/first-charge-type.md b/doc/models/first-charge-type.md index 9fa953d6..76c2ef43 100644 --- a/doc/models/first-charge-type.md +++ b/doc/models/first-charge-type.md @@ -13,3 +13,11 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```java +import com.maxio.advancedbilling.models.FirstChargeType; + +FirstChargeType firstChargeType = FirstChargeType.DELAYED; +``` + diff --git a/doc/models/full-subscription-group-response.md b/doc/models/full-subscription-group-response.md index 0648df06..421052cf 100644 --- a/doc/models/full-subscription-group-response.md +++ b/doc/models/full-subscription-group-response.md @@ -22,19 +22,22 @@ | `Customer` | [`SubscriptionGroupCustomer`](../../doc/models/subscription-group-customer.md) | Optional | - | SubscriptionGroupCustomer getCustomer() | setCustomer(SubscriptionGroupCustomer customer) | | `AccountBalances` | [`SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | SubscriptionGroupBalances getAccountBalances() | setAccountBalances(SubscriptionGroupBalances accountBalances) | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 90, - "customer_id": 110, - "payment_profile_id": 18, - "subscription_ids": [ - 220, - 221, - 222 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.FullSubscriptionGroupResponse; +import java.util.Arrays; + +FullSubscriptionGroupResponse fullSubscriptionGroupResponse = new FullSubscriptionGroupResponse.Builder() + .uid("uid6") + .scheme(80) + .customerId(100) + .paymentProfileId(8) + .subscriptionIds(Arrays.asList( + 210, + 211, + 212 + )) + .build(); ``` diff --git a/doc/models/get-one-time-token-bank-account-payment-profile.md b/doc/models/get-one-time-token-bank-account-payment-profile.md new file mode 100644 index 00000000..90de5526 --- /dev/null +++ b/doc/models/get-one-time-token-bank-account-payment-profile.md @@ -0,0 +1,70 @@ + +# Get One Time Token Bank Account Payment Profile + +## Structure + +`GetOneTimeTokenBankAccountPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Id` | `String` | Optional | - | String getId() | setId(String id) | +| `FirstName` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getFirstName() | setFirstName(String firstName) | +| `LastName` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getLastName() | setLastName(String lastName) | +| `CustomerId` | `String` | Optional | - | String getCustomerId() | setCustomerId(String customerId) | +| `CurrentVault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Required | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | BankAccountVault getCurrentVault() | setCurrentVault(BankAccountVault currentVault) | +| `VaultToken` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getVaultToken() | setVaultToken(String vaultToken) | +| `BillingAddress` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getBillingAddress() | setBillingAddress(String billingAddress) | +| `BillingAddress2` | `String` | Optional | - | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | +| `BillingCity` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getBillingCity() | setBillingCity(String billingCity) | +| `BillingCountry` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getBillingCountry() | setBillingCountry(String billingCountry) | +| `BillingState` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getBillingState() | setBillingState(String billingState) | +| `BillingZip` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getBillingZip() | setBillingZip(String billingZip) | +| `BankName` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getBankName() | setBankName(String bankName) | +| `MaskedBankRoutingNumber` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getMaskedBankRoutingNumber() | setMaskedBankRoutingNumber(String maskedBankRoutingNumber) | +| `MaskedBankAccountNumber` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getMaskedBankAccountNumber() | setMaskedBankAccountNumber(String maskedBankAccountNumber) | +| `BankAccountType` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Required | Defaults to checking | BankAccountType getBankAccountType() | setBankAccountType(BankAccountType bankAccountType) | +| `BankAccountHolderType` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Required | Defaults to personal | BankAccountHolderType getBankAccountHolderType() | setBankAccountHolderType(BankAccountHolderType bankAccountHolderType) | +| `PaymentType` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getPaymentType() | setPaymentType(String paymentType) | +| `Disabled` | `boolean` | Required | - | boolean getDisabled() | setDisabled(boolean disabled) | +| `SiteGatewaySettingId` | `int` | Required | - | int getSiteGatewaySettingId() | setSiteGatewaySettingId(int siteGatewaySettingId) | +| `CustomerVaultToken` | `String` | Optional | - | String getCustomerVaultToken() | setCustomerVaultToken(String customerVaultToken) | +| `GatewayHandle` | `String` | Optional | - | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | +| `Verified` | `Boolean` | Optional | - | Boolean getVerified() | setVerified(Boolean verified) | + +## Example + +```java +import com.maxio.advancedbilling.models.BankAccountHolderType; +import com.maxio.advancedbilling.models.BankAccountType; +import com.maxio.advancedbilling.models.BankAccountVault; +import com.maxio.advancedbilling.models.GetOneTimeTokenBankAccountPaymentProfile; + +GetOneTimeTokenBankAccountPaymentProfile getOneTimeTokenBankAccountPaymentProfile = new GetOneTimeTokenBankAccountPaymentProfile.Builder( + "first_name0", + "last_name8", + BankAccountVault.MAXP, + "vault_token2", + "billing_address2", + "billing_city8", + "billing_country4", + "billing_state6", + "billing_zip8", + "bank_name4", + "masked_bank_routing_number4", + "masked_bank_account_number2", + BankAccountType.CHECKING, + BankAccountHolderType.PERSONAL, + "payment_type0", + false, + 246 +) +.id("id0") +.customerId("customer_id8") +.billingAddress2("billing_address_22") +.customerVaultToken("customer_vault_token8") +.gatewayHandle("gateway_handle2") +.build(); +``` + diff --git a/doc/models/get-one-time-token-payment-profile.md b/doc/models/get-one-time-token-payment-profile.md index 672adbb8..dfac6765 100644 --- a/doc/models/get-one-time-token-payment-profile.md +++ b/doc/models/get-one-time-token-payment-profile.md @@ -31,31 +31,36 @@ | `CustomerVaultToken` | `String` | Optional | - | String getCustomerVaultToken() | setCustomerVaultToken(String customerVaultToken) | | `GatewayHandle` | `String` | Optional | - | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | -## Example (as JSON) - -```json -{ - "id": "id2", - "first_name": "first_name2", - "last_name": "last_name0", - "masked_card_number": "masked_card_number0", - "card_type": "routex", - "expiration_month": 187.78, - "expiration_year": 164.44, - "customer_id": "customer_id0", - "current_vault": "braintree_blue", - "vault_token": "vault_token4", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_24", - "billing_city": "billing_city0", - "billing_country": "billing_country6", - "billing_state": "billing_state6", - "billing_zip": "billing_zip0", - "payment_type": "payment_type2", - "disabled": false, - "site_gateway_setting_id": 232, - "customer_vault_token": "customer_vault_token0", - "gateway_handle": "gateway_handle4" -} +## Example + +```java +import com.maxio.advancedbilling.models.CardType; +import com.maxio.advancedbilling.models.CreditCardVault; +import com.maxio.advancedbilling.models.GetOneTimeTokenPaymentProfile; + +GetOneTimeTokenPaymentProfile getOneTimeTokenPaymentProfile = new GetOneTimeTokenPaymentProfile.Builder( + "first_name4", + "last_name2", + "masked_card_number2", + CardType.MAESTRO_NO_LUHN, + 28.3D, + 4.96D, + CreditCardVault.TRUST_COMMERCE, + "vault_token6", + "billing_address6", + "billing_city2", + "billing_country8", + "billing_state2", + "billing_zip2", + "payment_type6", + false, + 156 +) +.id("id4") +.customerId("customer_id2") +.billingAddress2("billing_address_26") +.customerVaultToken("customer_vault_token2") +.gatewayHandle("gateway_handle6") +.build(); ``` diff --git a/doc/models/get-one-time-token-request.md b/doc/models/get-one-time-token-request.md index 563ca366..eb68b024 100644 --- a/doc/models/get-one-time-token-request.md +++ b/doc/models/get-one-time-token-request.md @@ -9,35 +9,45 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `PaymentProfile` | [`GetOneTimeTokenPaymentProfile`](../../doc/models/get-one-time-token-payment-profile.md) | Required | - | GetOneTimeTokenPaymentProfile getPaymentProfile() | setPaymentProfile(GetOneTimeTokenPaymentProfile paymentProfile) | - -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": "id4", - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2", - "card_type": "bogus", - "expiration_month": 133.5, - "expiration_year": 156.84, - "customer_id": "customer_id2", - "current_vault": "stripe", - "vault_token": "vault_token6", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_26", - "billing_city": "billing_city8", - "billing_country": "billing_country2", - "billing_state": "billing_state2", - "billing_zip": "billing_zip2", - "payment_type": "payment_type6", - "disabled": false, - "site_gateway_setting_id": 104, - "customer_vault_token": "customer_vault_token2", - "gateway_handle": "gateway_handle4" - } -} +| `PaymentProfile` | [`GetOneTimeTokenRequestPaymentProfile`](../../doc/models/containers/get-one-time-token-request-payment-profile.md) | Required | This is a container for any-of cases. | GetOneTimeTokenRequestPaymentProfile getPaymentProfile() | setPaymentProfile(GetOneTimeTokenRequestPaymentProfile paymentProfile) | + +## Example + +```java +import com.maxio.advancedbilling.models.CardType; +import com.maxio.advancedbilling.models.CreditCardVault; +import com.maxio.advancedbilling.models.GetOneTimeTokenPaymentProfile; +import com.maxio.advancedbilling.models.GetOneTimeTokenRequest; +import com.maxio.advancedbilling.models.containers.GetOneTimeTokenRequestPaymentProfile; + +GetOneTimeTokenRequest getOneTimeTokenRequest = new GetOneTimeTokenRequest.Builder( + GetOneTimeTokenRequestPaymentProfile.fromGetOneTimeTokenPaymentProfile( + new GetOneTimeTokenPaymentProfile.Builder( + "first_name2", + "last_name0", + "masked_card_number0", + CardType.ROUTEX, + 187.78D, + 164.44D, + CreditCardVault.BRAINTREE_BLUE, + "vault_token4", + "billing_address4", + "billing_city0", + "billing_country6", + "billing_state6", + "billing_zip0", + "payment_type2", + false, + 232 + ) + .id("id2") + .customerId("customer_id0") + .billingAddress2("billing_address_24") + .customerVaultToken("customer_vault_token0") + .gatewayHandle("gateway_handle4") + .build() + ) +) +.build(); ``` diff --git a/doc/models/group-billing.md b/doc/models/group-billing.md index 1c029beb..a55e5e8c 100644 --- a/doc/models/group-billing.md +++ b/doc/models/group-billing.md @@ -1,7 +1,7 @@ # Group Billing -Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. +(Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. ## Structure @@ -15,13 +15,15 @@ Optional attributes related to billing date and accrual. Note: Only applicable f | `AlignDate` | `Boolean` | Optional | A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.

**Default**: `false` | Boolean getAlignDate() | setAlignDate(Boolean alignDate) | | `Prorate` | `Boolean` | Optional | A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.

**Default**: `false` | Boolean getProrate() | setProrate(Boolean prorate) | -## Example (as JSON) +## Example -```json -{ - "accrue": false, - "align_date": false, - "prorate": false -} +```java +import com.maxio.advancedbilling.models.GroupBilling; + +GroupBilling groupBilling = new GroupBilling.Builder() + .accrue(false) + .alignDate(false) + .prorate(false) + .build(); ``` diff --git a/doc/models/group-settings.md b/doc/models/group-settings.md index 980791ff..a199a3ba 100644 --- a/doc/models/group-settings.md +++ b/doc/models/group-settings.md @@ -10,21 +10,28 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Target` | [`GroupTarget`](../../doc/models/group-target.md) | Required | Attributes of the target customer who will be the responsible payer of the created subscription. Required. | GroupTarget getTarget() | setTarget(GroupTarget target) | -| `Billing` | [`GroupBilling`](../../doc/models/group-billing.md) | Optional | Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | GroupBilling getBilling() | setBilling(GroupBilling billing) | - -## Example (as JSON) - -```json -{ - "target": { - "type": "parent", - "id": 236 - }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } -} +| `Billing` | [`GroupBilling`](../../doc/models/group-billing.md) | Optional | (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | GroupBilling getBilling() | setBilling(GroupBilling billing) | + +## Example + +```java +import com.maxio.advancedbilling.models.GroupBilling; +import com.maxio.advancedbilling.models.GroupSettings; +import com.maxio.advancedbilling.models.GroupTarget; +import com.maxio.advancedbilling.models.GroupTargetType; + +GroupSettings groupSettings = new GroupSettings.Builder( + new GroupTarget.Builder( + GroupTargetType.PARENT + ) + .id(236) + .build() +) +.billing(new GroupBilling.Builder() + .accrue(false) + .alignDate(false) + .prorate(false) + .build()) +.build(); ``` diff --git a/doc/models/group-status.md b/doc/models/group-status.md new file mode 100644 index 00000000..b6059f37 --- /dev/null +++ b/doc/models/group-status.md @@ -0,0 +1,22 @@ + +# Group Status + +## Enumeration + +`GroupStatus` + +## Fields + +| Name | +| --- | +| `UNGROUPED` | +| `GROUPED` | + +## Example + +```java +import com.maxio.advancedbilling.models.GroupStatus; + +GroupStatus groupStatus = GroupStatus.UNGROUPED; +``` + diff --git a/doc/models/group-target-type.md b/doc/models/group-target-type.md index 431d4fba..c703ddcf 100644 --- a/doc/models/group-target-type.md +++ b/doc/models/group-target-type.md @@ -17,3 +17,11 @@ The type of object indicated by the id attribute. | `PARENT` | | `ELDEST` | +## Example + +```java +import com.maxio.advancedbilling.models.GroupTargetType; + +GroupTargetType groupTargetType = GroupTargetType.SELF; +``` + diff --git a/doc/models/group-target.md b/doc/models/group-target.md index fa4d1b6f..cb343aa7 100644 --- a/doc/models/group-target.md +++ b/doc/models/group-target.md @@ -12,14 +12,18 @@ Attributes of the target customer who will be the responsible payer of the creat | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Type` | [`GroupTargetType`](../../doc/models/group-target-type.md) | Required | The type of object indicated by the id attribute. | GroupTargetType getType() | setType(GroupTargetType type) | -| `Id` | `Integer` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest" | Integer getId() | setId(Integer id) | +| `Id` | `Integer` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self", "parent", or "eldest". | Integer getId() | setId(Integer id) | -## Example (as JSON) +## Example -```json -{ - "type": "self", - "id": 134 -} +```java +import com.maxio.advancedbilling.models.GroupTarget; +import com.maxio.advancedbilling.models.GroupTargetType; + +GroupTarget groupTarget = new GroupTarget.Builder( + GroupTargetType.PARENT +) +.id(234) +.build(); ``` diff --git a/doc/models/group-type.md b/doc/models/group-type.md index bc9c31b9..c58e925d 100644 --- a/doc/models/group-type.md +++ b/doc/models/group-type.md @@ -12,3 +12,11 @@ | `SINGLE_CUSTOMER` | | `MULTIPLE_CUSTOMERS` | +## Example + +```java +import com.maxio.advancedbilling.models.GroupType; + +GroupType groupType = GroupType.SINGLE_CUSTOMER; +``` + diff --git a/doc/models/historic-usage.md b/doc/models/historic-usage.md index 61d09d64..0f381ddb 100644 --- a/doc/models/historic-usage.md +++ b/doc/models/historic-usage.md @@ -1,7 +1,7 @@ # Historic Usage -Optional for Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. +(Optional) For Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. ## Structure @@ -15,13 +15,16 @@ Optional for Event Based Components. If the `include=historic_usages` query para | `BillingPeriodStartsAt` | `ZonedDateTime` | Optional | Start date of billing period | ZonedDateTime getBillingPeriodStartsAt() | setBillingPeriodStartsAt(ZonedDateTime billingPeriodStartsAt) | | `BillingPeriodEndsAt` | `ZonedDateTime` | Optional | End date of billing period | ZonedDateTime getBillingPeriodEndsAt() | setBillingPeriodEndsAt(ZonedDateTime billingPeriodEndsAt) | -## Example (as JSON) +## Example -```json -{ - "total_usage_quantity": 26.6, - "billing_period_starts_at": "2016-03-13T12:52:32.123Z", - "billing_period_ends_at": "2016-03-13T12:52:32.123Z" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.HistoricUsage; + +HistoricUsage historicUsage = new HistoricUsage.Builder() + .totalUsageQuantity(140.74D) + .billingPeriodStartsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .billingPeriodEndsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/include-not-null.md b/doc/models/include-not-null.md index 694ffcf9..c2e59451 100644 --- a/doc/models/include-not-null.md +++ b/doc/models/include-not-null.md @@ -15,7 +15,9 @@ Passed as a parameter to list methods to return only non null values. ## Example -``` -not_null +```java +import com.maxio.advancedbilling.models.IncludeNotNull; + +IncludeNotNull includeNotNull = IncludeNotNull.NOT_NULL; ``` diff --git a/doc/models/include-null-or-not-null.md b/doc/models/include-null-or-not-null.md index 1c9e442d..49286611 100644 --- a/doc/models/include-null-or-not-null.md +++ b/doc/models/include-null-or-not-null.md @@ -16,7 +16,9 @@ Allows to filter by `not_null` or `null`. ## Example -``` -not_null +```java +import com.maxio.advancedbilling.models.IncludeNullOrNotNull; + +IncludeNullOrNotNull includeNullOrNotNull = IncludeNullOrNotNull.NOT_NULL; ``` diff --git a/doc/models/include-option.md b/doc/models/include-option.md index 0ad125f0..cfc779f6 100644 --- a/doc/models/include-option.md +++ b/doc/models/include-option.md @@ -12,3 +12,11 @@ | `EXCLUDE` | | `INCLUDE` | +## Example + +```java +import com.maxio.advancedbilling.models.IncludeOption; + +IncludeOption includeOption = IncludeOption.EXCLUDE; +``` + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md index 7e4cab3b..b0644448 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -12,3 +12,11 @@ | `DAY` | | `MONTH` | +## Example + +```java +import com.maxio.advancedbilling.models.IntervalUnit; + +IntervalUnit intervalUnit = IntervalUnit.DAY; +``` + diff --git a/doc/models/invoice-address.md b/doc/models/invoice-address.md index 22d7ffae..7298f678 100644 --- a/doc/models/invoice-address.md +++ b/doc/models/invoice-address.md @@ -16,15 +16,17 @@ | `Zip` | `String` | Optional | - | String getZip() | setZip(String zip) | | `Country` | `String` | Optional | - | String getCountry() | setCountry(String country) | -## Example (as JSON) - -```json -{ - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceAddress; + +InvoiceAddress invoiceAddress = new InvoiceAddress.Builder() + .street("street2") + .line2("line26") + .city("city2") + .state("state8") + .zip("zip6") + .build(); ``` diff --git a/doc/models/invoice-avatax-details.md b/doc/models/invoice-avatax-details.md index 11352d20..504b5637 100644 --- a/doc/models/invoice-avatax-details.md +++ b/doc/models/invoice-avatax-details.md @@ -15,15 +15,18 @@ | `CommitDate` | `ZonedDateTime` | Optional | - | ZonedDateTime getCommitDate() | setCommitDate(ZonedDateTime commitDate) | | `ModifyDate` | `ZonedDateTime` | Optional | - | ZonedDateTime getModifyDate() | setModifyDate(ZonedDateTime modifyDate) | -## Example (as JSON) - -```json -{ - "id": 112, - "status": "status2", - "document_code": "document_code0", - "commit_date": "2016-03-13T12:52:32.123Z", - "modify_date": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.InvoiceAvataxDetails; + +InvoiceAvataxDetails invoiceAvataxDetails = new InvoiceAvataxDetails.Builder() + .id(184L) + .status("status2") + .documentCode("document_code4") + .commitDate(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .modifyDate(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/invoice-balance-item.md b/doc/models/invoice-balance-item.md index aa5186f4..244f64b3 100644 --- a/doc/models/invoice-balance-item.md +++ b/doc/models/invoice-balance-item.md @@ -13,13 +13,15 @@ | `Number` | `String` | Optional | - | String getNumber() | setNumber(String number) | | `OutstandingAmount` | `String` | Optional | - | String getOutstandingAmount() | setOutstandingAmount(String outstandingAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "number": "number6", - "outstanding_amount": "outstanding_amount6" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceBalanceItem; + +InvoiceBalanceItem invoiceBalanceItem = new InvoiceBalanceItem.Builder() + .uid("uid8") + .number("number6") + .outstandingAmount("outstanding_amount6") + .build(); ``` diff --git a/doc/models/invoice-consolidation-level.md b/doc/models/invoice-consolidation-level.md index 8b4786e9..e91140b5 100644 --- a/doc/models/invoice-consolidation-level.md +++ b/doc/models/invoice-consolidation-level.md @@ -1,7 +1,7 @@ # Invoice Consolidation Level -Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: +Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * "none": A normal invoice with no consolidation. * "child": An invoice segment which has been combined into a consolidated invoice. @@ -23,3 +23,11 @@ See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/ | `CHILD` | | `PARENT` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; + +InvoiceConsolidationLevel invoiceConsolidationLevel = InvoiceConsolidationLevel.NONE; +``` + diff --git a/doc/models/invoice-credit.md b/doc/models/invoice-credit.md index 1d8dd521..764e892d 100644 --- a/doc/models/invoice-credit.md +++ b/doc/models/invoice-credit.md @@ -17,15 +17,18 @@ | `OriginalAmount` | `String` | Optional | - | String getOriginalAmount() | setOriginalAmount(String originalAmount) | | `AppliedAmount` | `String` | Optional | - | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.InvoiceCredit; + +InvoiceCredit invoiceCredit = new InvoiceCredit.Builder() + .uid("uid8") + .creditNoteNumber("credit_note_number2") + .creditNoteUid("credit_note_uid2") + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .memo("memo2") + .build(); ``` diff --git a/doc/models/invoice-custom-field.md b/doc/models/invoice-custom-field.md index 30953e93..b7c236bd 100644 --- a/doc/models/invoice-custom-field.md +++ b/doc/models/invoice-custom-field.md @@ -15,15 +15,18 @@ | `Value` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | String getValue() | setValue(String value) | | `MetadatumId` | `Integer` | Optional | - | Integer getMetadatumId() | setMetadatumId(Integer metadatumId) | -## Example (as JSON) - -```json -{ - "owner_id": 142, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 142 -} +## Example + +```java +import com.maxio.advancedbilling.models.CustomFieldOwner; +import com.maxio.advancedbilling.models.InvoiceCustomField; + +InvoiceCustomField invoiceCustomField = new InvoiceCustomField.Builder() + .ownerId(14) + .ownerType(CustomFieldOwner.CUSTOMER) + .name("name0") + .value("value2") + .metadatumId(14) + .build(); ``` diff --git a/doc/models/invoice-customer.md b/doc/models/invoice-customer.md index 1bf2791e..798896da 100644 --- a/doc/models/invoice-customer.md +++ b/doc/models/invoice-customer.md @@ -1,7 +1,7 @@ # Invoice Customer -Information about the customer who is owner or recipient the invoiced subscription. +Information about the customer who is owner or recipient of the invoiced subscription. ## Structure @@ -19,15 +19,17 @@ Information about the customer who is owner or recipient the invoiced subscripti | `VatNumber` | `String` | Optional | - | String getVatNumber() | setVatNumber(String vatNumber) | | `Reference` | `String` | Optional | - | String getReference() | setReference(String reference) | -## Example (as JSON) +## Example -```json -{ - "chargify_id": 236, - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" -} +```java +import com.maxio.advancedbilling.models.InvoiceCustomer; + +InvoiceCustomer invoiceCustomer = new InvoiceCustomer.Builder() + .chargifyId(82) + .firstName("first_name2") + .lastName("last_name0") + .organization("organization6") + .email("email4") + .build(); ``` diff --git a/doc/models/invoice-date-field.md b/doc/models/invoice-date-field.md index 05d7f5f1..87bba207 100644 --- a/doc/models/invoice-date-field.md +++ b/doc/models/invoice-date-field.md @@ -17,7 +17,9 @@ ## Example -``` -issue_date +```java +import com.maxio.advancedbilling.models.InvoiceDateField; + +InvoiceDateField invoiceDateField = InvoiceDateField.UPDATED_AT; ``` diff --git a/doc/models/invoice-debit.md b/doc/models/invoice-debit.md index 7467bdfc..369ed1e8 100644 --- a/doc/models/invoice-debit.md +++ b/doc/models/invoice-debit.md @@ -18,15 +18,19 @@ | `OriginalAmount` | `String` | Optional | - | String getOriginalAmount() | setOriginalAmount(String originalAmount) | | `AppliedAmount` | `String` | Optional | - | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "debit_note_number": "debit_note_number2", - "debit_note_uid": "debit_note_uid8", - "role": "chargeback", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.DebitNoteRole; +import com.maxio.advancedbilling.models.InvoiceDebit; + +InvoiceDebit invoiceDebit = new InvoiceDebit.Builder() + .uid("uid8") + .debitNoteNumber("debit_note_number8") + .debitNoteUid("debit_note_uid4") + .role(DebitNoteRole.CHARGEBACK) + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/invoice-discount-breakout.md b/doc/models/invoice-discount-breakout.md index e29c5a4c..b67192a6 100644 --- a/doc/models/invoice-discount-breakout.md +++ b/doc/models/invoice-discount-breakout.md @@ -13,13 +13,15 @@ | `EligibleAmount` | `String` | Optional | - | String getEligibleAmount() | setEligibleAmount(String eligibleAmount) | | `DiscountAmount` | `String` | Optional | - | String getDiscountAmount() | setDiscountAmount(String discountAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "eligible_amount": "eligible_amount0", - "discount_amount": "discount_amount8" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceDiscountBreakout; + +InvoiceDiscountBreakout invoiceDiscountBreakout = new InvoiceDiscountBreakout.Builder() + .uid("uid0") + .eligibleAmount("eligible_amount2") + .discountAmount("discount_amount4") + .build(); ``` diff --git a/doc/models/invoice-discount-source-type.md b/doc/models/invoice-discount-source-type.md index 7218f6c9..532b7cbd 100644 --- a/doc/models/invoice-discount-source-type.md +++ b/doc/models/invoice-discount-source-type.md @@ -13,3 +13,11 @@ | `REFERRAL` | | `ENUM_AD_HOC_COUPON` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceDiscountSourceType; + +InvoiceDiscountSourceType invoiceDiscountSourceType = InvoiceDiscountSourceType.REFERRAL; +``` + diff --git a/doc/models/invoice-discount-type.md b/doc/models/invoice-discount-type.md index 3e5355b5..9994947b 100644 --- a/doc/models/invoice-discount-type.md +++ b/doc/models/invoice-discount-type.md @@ -13,3 +13,11 @@ | `FLAT_AMOUNT` | | `ROLLOVER` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceDiscountType; + +InvoiceDiscountType invoiceDiscountType = InvoiceDiscountType.PERCENTAGE; +``` + diff --git a/doc/models/invoice-discount.md b/doc/models/invoice-discount.md index cb921905..8e5a102e 100644 --- a/doc/models/invoice-discount.md +++ b/doc/models/invoice-discount.md @@ -22,15 +22,18 @@ | `TransactionId` | `Integer` | Optional | - | Integer getTransactionId() | setTransactionId(Integer transactionId) | | `LineItemBreakouts` | [`List`](../../doc/models/invoice-discount-breakout.md) | Optional | - | List getLineItemBreakouts() | setLineItemBreakouts(List lineItemBreakouts) | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title4", - "description": "description0", - "code": "code8", - "source_type": "Coupon" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceDiscount; +import com.maxio.advancedbilling.models.InvoiceDiscountSourceType; + +InvoiceDiscount invoiceDiscount = new InvoiceDiscount.Builder() + .uid("uid4") + .title("title0") + .description("description6") + .code("code2") + .sourceType(InvoiceDiscountSourceType.COUPON) + .build(); ``` diff --git a/doc/models/invoice-display-settings.md b/doc/models/invoice-display-settings.md index 14c9ef35..419959e2 100644 --- a/doc/models/invoice-display-settings.md +++ b/doc/models/invoice-display-settings.md @@ -12,12 +12,14 @@ | `HideZeroSubtotalLines` | `Boolean` | Optional | - | Boolean getHideZeroSubtotalLines() | setHideZeroSubtotalLines(Boolean hideZeroSubtotalLines) | | `IncludeDiscountsOnLines` | `Boolean` | Optional | - | Boolean getIncludeDiscountsOnLines() | setIncludeDiscountsOnLines(Boolean includeDiscountsOnLines) | -## Example (as JSON) +## Example -```json -{ - "hide_zero_subtotal_lines": false, - "include_discounts_on_lines": false -} +```java +import com.maxio.advancedbilling.models.InvoiceDisplaySettings; + +InvoiceDisplaySettings invoiceDisplaySettings = new InvoiceDisplaySettings.Builder() + .hideZeroSubtotalLines(false) + .includeDiscountsOnLines(false) + .build(); ``` diff --git a/doc/models/invoice-event-payment-method.md b/doc/models/invoice-event-payment-method.md index 8df097ea..2fd491ff 100644 --- a/doc/models/invoice-event-payment-method.md +++ b/doc/models/invoice-event-payment-method.md @@ -15,3 +15,11 @@ | `EXTERNAL` | | `PAYPAL_ACCOUNT` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; + +InvoiceEventPaymentMethod invoiceEventPaymentMethod = InvoiceEventPaymentMethod.CREDIT_CARD; +``` + diff --git a/doc/models/invoice-event-type.md b/doc/models/invoice-event-type.md index c6c09926..64353100 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -27,3 +27,11 @@ Invoice Event Type | `FAILED_PAYMENT` | | `CHANGE_CHARGEBACK_STATUS` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceEventType; + +InvoiceEventType invoiceEventType = InvoiceEventType.CREATE_CREDIT_NOTE; +``` + diff --git a/doc/models/invoice-issued.md b/doc/models/invoice-issued.md index 687847e1..966279fb 100644 --- a/doc/models/invoice-issued.md +++ b/doc/models/invoice-issued.md @@ -25,33 +25,39 @@ | `ConsolidationLevel` | `String` | Required | - | String getConsolidationLevel() | setConsolidationLevel(String consolidationLevel) | | `LineItems` | [`List`](../../doc/models/invoice-line-item-event-data.md) | Required | - | List getLineItems() | setLineItems(List lineItems) | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "number": "number8", - "role": "role2", - "due_date": "2016-03-13", - "issue_date": "issue_date0", - "paid_date": "paid_date6", - "due_amount": "due_amount6", - "paid_amount": "paid_amount4", - "tax_amount": "tax_amount2", - "refund_amount": "refund_amount0", - "total_amount": "total_amount0", - "status_amount": "status_amount4", - "product_name": "product_name0", - "consolidation_level": "consolidation_level4", - "line_items": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.InvoiceIssued; +import com.maxio.advancedbilling.models.InvoiceLineItemEventData; +import java.util.Arrays; + +InvoiceIssued invoiceIssued = new InvoiceIssued.Builder( + "uid8", + "number4", + "role8", + DateTimeHelper.fromSimpleDate("2016-03-13"), + "issue_date4", + "paid_date8", + "due_amount0", + "paid_amount0", + "tax_amount8", + "refund_amount6", + "total_amount4", + "status_amount8", + "product_name4", + "consolidation_level0", + Arrays.asList( + new InvoiceLineItemEventData.Builder() + .uid("uid8") + .title("title4") + .description("description8") + .quantity(102) + .quantityDelta(204) + .build() + ) +) +.build(); ``` diff --git a/doc/models/invoice-line-item-component-cost-data.md b/doc/models/invoice-line-item-component-cost-data.md index 8e0dc399..0af3407a 100644 --- a/doc/models/invoice-line-item-component-cost-data.md +++ b/doc/models/invoice-line-item-component-cost-data.md @@ -11,33 +11,30 @@ | --- | --- | --- | --- | --- | --- | | `Rates` | [`List`](../../doc/models/component-cost-data.md) | Optional | - | List getRates() | setRates(List rates) | -## Example (as JSON) - -```json -{ - "rates": [ - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - }, - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - }, - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCostData; +import com.maxio.advancedbilling.models.InvoiceLineItemComponentCostData; +import java.util.Arrays; + +InvoiceLineItemComponentCostData invoiceLineItemComponentCostData = new InvoiceLineItemComponentCostData.Builder() + .rates(Arrays.asList( + new ComponentCostData.Builder() + .componentCodeId(116) + .pricePointId(226) + .productId(94) + .quantity("quantity0") + .amount("amount6") + .build(), + new ComponentCostData.Builder() + .componentCodeId(116) + .pricePointId(226) + .productId(94) + .quantity("quantity0") + .amount("amount6") + .build() + )) + .build(); ``` diff --git a/doc/models/invoice-line-item-event-data.md b/doc/models/invoice-line-item-event-data.md index 75ab8d2e..a9cfaaa3 100644 --- a/doc/models/invoice-line-item-event-data.md +++ b/doc/models/invoice-line-item-event-data.md @@ -30,15 +30,17 @@ | `BillingScheduleItemId` | `Integer` | Optional | - | Integer getBillingScheduleItemId() | setBillingScheduleItemId(Integer billingScheduleItemId) | | `CustomItem` | `Boolean` | Optional | - | Boolean getCustomItem() | setCustomItem(Boolean customItem) | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": 40, - "quantity_delta": 114 -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceLineItemEventData; + +InvoiceLineItemEventData invoiceLineItemEventData = new InvoiceLineItemEventData.Builder() + .uid("uid4") + .title("title0") + .description("description4") + .quantity(190) + .quantityDelta(36) + .build(); ``` diff --git a/doc/models/invoice-line-item-pricing-detail.md b/doc/models/invoice-line-item-pricing-detail.md index 6bbedec5..99225b45 100644 --- a/doc/models/invoice-line-item-pricing-detail.md +++ b/doc/models/invoice-line-item-pricing-detail.md @@ -12,12 +12,14 @@ | `Label` | `String` | Optional | - | String getLabel() | setLabel(String label) | | `Amount` | `String` | Optional | - | String getAmount() | setAmount(String amount) | -## Example (as JSON) +## Example -```json -{ - "label": "label0", - "amount": "amount2" -} +```java +import com.maxio.advancedbilling.models.InvoiceLineItemPricingDetail; + +InvoiceLineItemPricingDetail invoiceLineItemPricingDetail = new InvoiceLineItemPricingDetail.Builder() + .label("label4") + .amount("amount6") + .build(); ``` diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index 95d220d7..8cbd324c 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -9,19 +9,19 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Uid` | `String` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | String getUid() | setUid(String uid) | +| `Uid` | `String` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | String getUid() | setUid(String uid) | | `Title` | `String` | Optional | A short descriptor for the charge or item represented by this line. | String getTitle() | setTitle(String title) | -| `Description` | `String` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | String getDescription() | setDescription(String description) | +| `Description` | `String` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | String getDescription() | setDescription(String description) | | `Quantity` | `String` | Optional | The quantity or count of units billed by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | String getQuantity() | setQuantity(String quantity) | -| `UnitPrice` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | String getUnitPrice() | setUnitPrice(String unitPrice) | +| `UnitPrice` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | String getUnitPrice() | setUnitPrice(String unitPrice) | | `SubtotalAmount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | String getSubtotalAmount() | setSubtotalAmount(String subtotalAmount) | | `DiscountAmount` | `String` | Optional | The approximate discount applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | String getDiscountAmount() | setDiscountAmount(String discountAmount) | | `TaxAmount` | `String` | Optional | The approximate tax applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | String getTaxAmount() | setTaxAmount(String taxAmount) | | `TaxIncluded` | `Boolean` | Optional | Whether the unit price for this line item is tax-inclusive.

When `true`, `unit_price` already includes tax and `tax_amount` represents the portion of the price attributable to tax. When `false`, any applicable tax is added on top of the price.

The value is inherited from the source price point's `tax_included` setting. Custom or ad-hoc line items (which have no associated price point) always return `false`. | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -| `TotalAmount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | String getTotalAmount() | setTotalAmount(String totalAmount) | +| `TotalAmount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | String getTotalAmount() | setTotalAmount(String totalAmount) | | `TieredUnitPrice` | `Boolean` | Optional | When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units. | Boolean getTieredUnitPrice() | setTieredUnitPrice(Boolean tieredUnitPrice) | -| `PeriodRangeStart` | `LocalDate` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | LocalDate getPeriodRangeStart() | setPeriodRangeStart(LocalDate periodRangeStart) | -| `PeriodRangeEnd` | `LocalDate` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | LocalDate getPeriodRangeEnd() | setPeriodRangeEnd(LocalDate periodRangeEnd) | +| `PeriodRangeStart` | `LocalDate` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | LocalDate getPeriodRangeStart() | setPeriodRangeStart(LocalDate periodRangeStart) | +| `PeriodRangeEnd` | `LocalDate` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | LocalDate getPeriodRangeEnd() | setPeriodRangeEnd(LocalDate periodRangeEnd) | | `TransactionId` | `Integer` | Optional | - | Integer getTransactionId() | setTransactionId(Integer transactionId) | | `ProductId` | `Integer` | Optional | The ID of the product subscribed when the charge was made.

This may be set even for component charges, so true product-only (non-component) charges will also have a nil `component_id`. | Integer getProductId() | setProductId(Integer productId) | | `ProductVersion` | `Integer` | Optional | The version of the product subscribed when the charge was made. | Integer getProductVersion() | setProductVersion(Integer productVersion) | @@ -35,15 +35,17 @@ | `Kind` | `String` | Optional | - | String getKind() | setKind(String kind) | | `PrepaidAllocationExpiresAt` | `LocalDate` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | LocalDate getPrepaidAllocationExpiresAt() | setPrepaidAllocationExpiresAt(LocalDate prepaidAllocationExpiresAt) | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description4", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```java +import com.maxio.advancedbilling.models.InvoiceLineItem; + +InvoiceLineItem invoiceLineItem = new InvoiceLineItem.Builder() + .uid("uid6") + .title("title2") + .description("description6") + .quantity("quantity2") + .unitPrice("unit_price4") + .build(); ``` diff --git a/doc/models/invoice-payer-change.md b/doc/models/invoice-payer-change.md index ae2e0b0c..8eb48fb3 100644 --- a/doc/models/invoice-payer-change.md +++ b/doc/models/invoice-payer-change.md @@ -14,14 +14,16 @@ | `Organization` | `String` | Optional | - | String getOrganization() | setOrganization(String organization) | | `Email` | `String` | Optional | - | String getEmail() | setEmail(String email) | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePayerChange; + +InvoicePayerChange invoicePayerChange = new InvoicePayerChange.Builder() + .firstName("first_name4") + .lastName("last_name2") + .organization("organization2") + .email("email2") + .build(); ``` diff --git a/doc/models/invoice-payer.md b/doc/models/invoice-payer.md index 0c8d8254..7e00834f 100644 --- a/doc/models/invoice-payer.md +++ b/doc/models/invoice-payer.md @@ -16,15 +16,17 @@ | `Email` | `String` | Optional | - | String getEmail() | setEmail(String email) | | `VatNumber` | `String` | Optional | - | String getVatNumber() | setVatNumber(String vatNumber) | -## Example (as JSON) - -```json -{ - "chargify_id": 46, - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization8", - "email": "email2" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePayer; + +InvoicePayer invoicePayer = new InvoicePayer.Builder() + .chargifyId(198) + .firstName("first_name2") + .lastName("last_name0") + .organization("organization4") + .email("email4") + .build(); ``` diff --git a/doc/models/invoice-payment-application.md b/doc/models/invoice-payment-application.md index 92ebe9c3..678281b0 100644 --- a/doc/models/invoice-payment-application.md +++ b/doc/models/invoice-payment-application.md @@ -13,13 +13,15 @@ | `ApplicationUid` | `String` | Optional | Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. | String getApplicationUid() | setApplicationUid(String applicationUid) | | `AppliedAmount` | `String` | Optional | Dollar amount of the paid invoice. | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid2", - "application_uid": "application_uid4", - "applied_amount": "applied_amount6" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePaymentApplication; + +InvoicePaymentApplication invoicePaymentApplication = new InvoicePaymentApplication.Builder() + .invoiceUid("invoice_uid8") + .applicationUid("application_uid8") + .appliedAmount("applied_amount0") + .build(); ``` diff --git a/doc/models/invoice-payment-method-type.md b/doc/models/invoice-payment-method-type.md index a920712d..9b6cc00a 100644 --- a/doc/models/invoice-payment-method-type.md +++ b/doc/models/invoice-payment-method-type.md @@ -18,3 +18,11 @@ The type of payment method used. Defaults to other. | `ACH` | | `OTHER` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; + +InvoicePaymentMethodType invoicePaymentMethodType = InvoicePaymentMethodType.CASH; +``` + diff --git a/doc/models/invoice-payment-method.md b/doc/models/invoice-payment-method.md index adc44c28..0989ab4b 100644 --- a/doc/models/invoice-payment-method.md +++ b/doc/models/invoice-payment-method.md @@ -18,15 +18,17 @@ | `LastFour` | `String` | Optional | - | String getLastFour() | setLastFour(String lastFour) | | `MaskedCardNumber` | `String` | Optional | - | String getMaskedCardNumber() | setMaskedCardNumber(String maskedCardNumber) | -## Example (as JSON) - -```json -{ - "details": "details8", - "kind": "kind6", - "memo": "memo2", - "type": "type8", - "card_brand": "card_brand8" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePaymentMethod; + +InvoicePaymentMethod invoicePaymentMethod = new InvoicePaymentMethod.Builder() + .details("details2") + .kind("kind0") + .memo("memo6") + .type("type8") + .cardBrand("card_brand4") + .build(); ``` diff --git a/doc/models/invoice-payment-type.md b/doc/models/invoice-payment-type.md index 8283fc2f..10dedb4d 100644 --- a/doc/models/invoice-payment-type.md +++ b/doc/models/invoice-payment-type.md @@ -16,3 +16,11 @@ The type of payment to be applied to an Invoice. Defaults to external. | `SERVICE_CREDIT` | | `PAYMENT` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePaymentType; + +InvoicePaymentType invoicePaymentType = InvoicePaymentType.EXTERNAL; +``` + diff --git a/doc/models/invoice-payment.md b/doc/models/invoice-payment.md index 0605f829..b1414b11 100644 --- a/doc/models/invoice-payment.md +++ b/doc/models/invoice-payment.md @@ -22,21 +22,25 @@ | `ReceivedOn` | `LocalDate` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | LocalDate getReceivedOn() | setReceivedOn(LocalDate receivedOn) | | `Uid` | `String` | Optional | - | String getUid() | setUid(String uid) | -## Example (as JSON) - -```json -{ - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "payment_method": { - "details": "details0", - "kind": "kind8", - "memo": "memo4", - "type": "type0", - "card_brand": "card_brand6" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.InvoicePayment; +import com.maxio.advancedbilling.models.InvoicePaymentMethod; + +InvoicePayment invoicePayment = new InvoicePayment.Builder() + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .memo("memo6") + .originalAmount("original_amount6") + .appliedAmount("applied_amount6") + .paymentMethod(new InvoicePaymentMethod.Builder() + .details("details0") + .kind("kind8") + .memo("memo4") + .type("type0") + .cardBrand("card_brand6") + .build()) + .build(); ``` diff --git a/doc/models/invoice-pre-payment.md b/doc/models/invoice-pre-payment.md index 7cea90f3..1f5a8252 100644 --- a/doc/models/invoice-pre-payment.md +++ b/doc/models/invoice-pre-payment.md @@ -13,13 +13,15 @@ | `AmountInCents` | `Long` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | Long getAmountInCents() | setAmountInCents(Long amountInCents) | | `EndingBalanceInCents` | `Long` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | Long getEndingBalanceInCents() | setEndingBalanceInCents(Long endingBalanceInCents) | -## Example (as JSON) - -```json -{ - "subscription_id": 180, - "amount_in_cents": 100, - "ending_balance_in_cents": 60 -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePrePayment; + +InvoicePrePayment invoicePrePayment = new InvoicePrePayment.Builder() + .subscriptionId(252) + .amountInCents(28L) + .endingBalanceInCents(244L) + .build(); ``` diff --git a/doc/models/invoice-previous-balance.md b/doc/models/invoice-previous-balance.md index c908a1ae..39c52cfd 100644 --- a/doc/models/invoice-previous-balance.md +++ b/doc/models/invoice-previous-balance.md @@ -12,18 +12,33 @@ | `CapturedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCapturedAt() | setCapturedAt(ZonedDateTime capturedAt) | | `Invoices` | [`List`](../../doc/models/invoice-balance-item.md) | Optional | - | List getInvoices() | setInvoices(List invoices) | -## Example (as JSON) - -```json -{ - "captured_at": "2016-03-13T12:52:32.123Z", - "invoices": [ - { - "uid": "uid6", - "number": "number6", - "outstanding_amount": "outstanding_amount8" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.InvoiceBalanceItem; +import com.maxio.advancedbilling.models.InvoicePreviousBalance; +import java.util.Arrays; + +InvoicePreviousBalance invoicePreviousBalance = new InvoicePreviousBalance.Builder() + .capturedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .invoices(Arrays.asList( + new InvoiceBalanceItem.Builder() + .uid("uid6") + .number("number6") + .outstandingAmount("outstanding_amount8") + .build(), + new InvoiceBalanceItem.Builder() + .uid("uid6") + .number("number6") + .outstandingAmount("outstanding_amount8") + .build(), + new InvoiceBalanceItem.Builder() + .uid("uid6") + .number("number6") + .outstandingAmount("outstanding_amount8") + .build() + )) + .build(); ``` diff --git a/doc/models/invoice-refund.md b/doc/models/invoice-refund.md index 67a38735..a0683bfb 100644 --- a/doc/models/invoice-refund.md +++ b/doc/models/invoice-refund.md @@ -19,15 +19,17 @@ | `GatewayHandle` | `String` | Optional | - | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | | `AchLateReject` | `Boolean` | Optional | - | Boolean getAchLateReject() | setAchLateReject(Boolean achLateReject) | -## Example (as JSON) - -```json -{ - "transaction_id": 172, - "payment_id": 42, - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceRefund; + +InvoiceRefund invoiceRefund = new InvoiceRefund.Builder() + .transactionId(166) + .paymentId(36) + .memo("memo6") + .originalAmount("original_amount6") + .appliedAmount("applied_amount6") + .build(); ``` diff --git a/doc/models/invoice-response.md b/doc/models/invoice-response.md index 5900be0e..1338a900 100644 --- a/doc/models/invoice-response.md +++ b/doc/models/invoice-response.md @@ -11,21 +11,26 @@ | --- | --- | --- | --- | --- | --- | | `Invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | Invoice getInvoice() | setInvoice(Invoice invoice) | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceResponse; + +InvoiceResponse invoiceResponse = new InvoiceResponse.Builder( + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build() +) +.build(); ``` diff --git a/doc/models/invoice-role.md b/doc/models/invoice-role.md index 2f75a786..094d38c8 100644 --- a/doc/models/invoice-role.md +++ b/doc/models/invoice-role.md @@ -20,3 +20,11 @@ | `BACKPORT` | | `BACKPORTBALANCERECONCILIATION` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceRole; + +InvoiceRole invoiceRole = InvoiceRole.RENEWAL; +``` + diff --git a/doc/models/invoice-seller.md b/doc/models/invoice-seller.md index b6311afb..0f3d854a 100644 --- a/doc/models/invoice-seller.md +++ b/doc/models/invoice-seller.md @@ -16,20 +16,23 @@ Information about the seller (merchant) listed on the masthead of the invoice. | `Phone` | `String` | Optional | - | String getPhone() | setPhone(String phone) | | `LogoUrl` | `String` | Optional | - | String getLogoUrl() | setLogoUrl(String logoUrl) | -## Example (as JSON) - -```json -{ - "name": "name0", - "address": { - "street": "street6", - "line2": "line20", - "city": "city6", - "state": "state2", - "zip": "zip0" - }, - "phone": "phone0", - "logo_url": "logo_url0" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceAddress; +import com.maxio.advancedbilling.models.InvoiceSeller; + +InvoiceSeller invoiceSeller = new InvoiceSeller.Builder() + .name("name4") + .address(new InvoiceAddress.Builder() + .street("street6") + .line2("line20") + .city("city6") + .state("state2") + .zip("zip0") + .build()) + .phone("phone6") + .logoUrl("logo_url6") + .build(); ``` diff --git a/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md index 83fcdee2..d2087bc6 100644 --- a/doc/models/invoice-sort-field.md +++ b/doc/models/invoice-sort-field.md @@ -20,7 +20,9 @@ ## Example -``` -total_amount +```java +import com.maxio.advancedbilling.models.InvoiceSortField; + +InvoiceSortField invoiceSortField = InvoiceSortField.UPDATED_AT; ``` diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index 87ba0765..d9012693 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -19,3 +19,11 @@ The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk. | `CANCELED` | | `PROCESSING` | +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceStatus; + +InvoiceStatus invoiceStatus = InvoiceStatus.PAID; +``` + diff --git a/doc/models/invoice-tax-breakout.md b/doc/models/invoice-tax-breakout.md index a98b81ab..907b6945 100644 --- a/doc/models/invoice-tax-breakout.md +++ b/doc/models/invoice-tax-breakout.md @@ -14,14 +14,16 @@ | `TaxAmount` | `String` | Optional | - | String getTaxAmount() | setTaxAmount(String taxAmount) | | `TaxExemptAmount` | `String` | Optional | - | String getTaxExemptAmount() | setTaxExemptAmount(String taxExemptAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "taxable_amount": "taxable_amount6", - "tax_amount": "tax_amount6", - "tax_exempt_amount": "tax_exempt_amount2" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceTaxBreakout; + +InvoiceTaxBreakout invoiceTaxBreakout = new InvoiceTaxBreakout.Builder() + .uid("uid4") + .taxableAmount("taxable_amount8") + .taxAmount("tax_amount2") + .taxExemptAmount("tax_exempt_amount4") + .build(); ``` diff --git a/doc/models/invoice-tax-component-breakout.md b/doc/models/invoice-tax-component-breakout.md index e7e36d37..61f55ebe 100644 --- a/doc/models/invoice-tax-component-breakout.md +++ b/doc/models/invoice-tax-component-breakout.md @@ -24,15 +24,17 @@ | `StateAssignedNo` | `String` | Optional | - | String getStateAssignedNo() | setStateAssignedNo(String stateAssignedNo) | | `TaxSubType` | `String` | Optional | - | String getTaxSubType() | setTaxSubType(String taxSubType) | -## Example (as JSON) - -```json -{ - "tax_rule_id": 226, - "percentage": "percentage0", - "country_code": "country_code8", - "subdivision_code": "subdivision_code6", - "tax_amount": "tax_amount4" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceTaxComponentBreakout; + +InvoiceTaxComponentBreakout invoiceTaxComponentBreakout = new InvoiceTaxComponentBreakout.Builder() + .taxRuleId(66) + .percentage("percentage0") + .countryCode("country_code2") + .subdivisionCode("subdivision_code6") + .taxAmount("tax_amount4") + .build(); ``` diff --git a/doc/models/invoice-tax.md b/doc/models/invoice-tax.md index a6a2bb8e..ff331709 100644 --- a/doc/models/invoice-tax.md +++ b/doc/models/invoice-tax.md @@ -24,15 +24,18 @@ | `Type` | `String` | Optional | - | String getType() | setType(String type) | | `TaxExemptAmount` | `String` | Optional | - | String getTaxExemptAmount() | setTaxExemptAmount(String taxExemptAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title6", - "description": "description2", - "source_type": "Tax", - "source_id": 164 -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceTax; +import com.maxio.advancedbilling.models.ProformaInvoiceTaxSourceType; + +InvoiceTax invoiceTax = new InvoiceTax.Builder() + .uid("uid2") + .title("title8") + .description("description2") + .sourceType(ProformaInvoiceTaxSourceType.TAX) + .sourceId(86) + .build(); ``` diff --git a/doc/models/invoice.md b/doc/models/invoice.md index 41ce26f6..f854204a 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -15,11 +15,11 @@ | `CustomerId` | `Integer` | Optional | ID of the customer to which the invoice belongs. | Integer getCustomerId() | setCustomerId(Integer customerId) | | `SubscriptionId` | `Integer` | Optional | ID of the subscription that generated the invoice. | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `Number` | `String` | Optional | A unique, identifying string that appears on the invoice and in places the invoice is referenced.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | String getNumber() | setNumber(String number) | -| `SequenceNumber` | `Integer` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | Integer getSequenceNumber() | setSequenceNumber(Integer sequenceNumber) | +| `SequenceNumber` | `Integer` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | Integer getSequenceNumber() | setSequenceNumber(Integer sequenceNumber) | | `TransactionTime` | `ZonedDateTime` | Optional | - | ZonedDateTime getTransactionTime() | setTransactionTime(ZonedDateTime transactionTime) | | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -| `IssueDate` | `LocalDate` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | LocalDate getIssueDate() | setIssueDate(LocalDate issueDate) | +| `IssueDate` | `LocalDate` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | LocalDate getIssueDate() | setIssueDate(LocalDate issueDate) | | `DueDate` | `LocalDate` | Optional | Date the invoice is due.

The format is `"YYYY-MM-DD"`. | LocalDate getDueDate() | setDueDate(LocalDate dueDate) | | `PaidDate` | `LocalDate` | Optional | Date the invoice became fully paid.

If partial payments are applied to the invoice, this date will not be present until payment has been made in full.

The format is `"YYYY-MM-DD"`. | LocalDate getPaidDate() | setPaidDate(LocalDate paidDate) | | `Status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | InvoiceStatus getStatus() | setStatus(InvoiceStatus status) | @@ -28,7 +28,7 @@ | `CollectionMethod` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | CollectionMethod getCollectionMethod() | setCollectionMethod(CollectionMethod collectionMethod) | | `PaymentInstructions` | `String` | Optional | A message that is printed on the invoice when it is marked for remittance collection. It is intended to describe to the customer how they may make payment, and is configured by the merchant. | String getPaymentInstructions() | setPaymentInstructions(String paymentInstructions) | | `Currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | String getCurrency() | setCurrency(String currency) | -| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | +| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | | `ParentInvoiceUid` | `String` | Optional | For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. | String getParentInvoiceUid() | setParentInvoiceUid(String parentInvoiceUid) | | `SubscriptionGroupId` | `Integer` | Optional | - | Integer getSubscriptionGroupId() | setSubscriptionGroupId(Integer subscriptionGroupId) | | `ParentInvoiceNumber` | `Integer` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | Integer getParentInvoiceNumber() | setParentInvoiceNumber(Integer parentInvoiceNumber) | @@ -36,17 +36,17 @@ | `ProductName` | `String` | Optional | The name of the product subscribed when the invoice was generated. | String getProductName() | setProductName(String productName) | | `ProductFamilyName` | `String` | Optional | The name of the product family subscribed when the invoice was generated. | String getProductFamilyName() | setProductFamilyName(String productFamilyName) | | `Seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | InvoiceSeller getSeller() | setSeller(InvoiceSeller seller) | -| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | +| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | | `Payer` | [`InvoicePayer`](../../doc/models/invoice-payer.md) | Optional | - | InvoicePayer getPayer() | setPayer(InvoicePayer payer) | | `RecipientEmails` | `List` | Optional | **Constraints**: *Maximum Items*: `5` | List getRecipientEmails() | setRecipientEmails(List recipientEmails) | | `NetTerms` | `Integer` | Optional | - | Integer getNetTerms() | setNetTerms(Integer netTerms) | -| `Memo` | `String` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | String getMemo() | setMemo(String memo) | +| `Memo` | `String` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | String getMemo() | setMemo(String memo) | | `BillingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice billing address. | InvoiceAddress getBillingAddress() | setBillingAddress(InvoiceAddress billingAddress) | | `ShippingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice shipping address. | InvoiceAddress getShippingAddress() | setShippingAddress(InvoiceAddress shippingAddress) | | `SubtotalAmount` | `String` | Optional | Subtotal of the invoice, which is the sum of all line items before discounts or taxes. | String getSubtotalAmount() | setSubtotalAmount(String subtotalAmount) | | `DiscountAmount` | `String` | Optional | Total discount applied to the invoice. | String getDiscountAmount() | setDiscountAmount(String discountAmount) | | `TaxAmount` | `String` | Optional | Total tax on the invoice. | String getTaxAmount() | setTaxAmount(String taxAmount) | -| `TotalAmount` | `String` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | String getTotalAmount() | setTotalAmount(String totalAmount) | +| `TotalAmount` | `String` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`. | String getTotalAmount() | setTotalAmount(String totalAmount) | | `CreditAmount` | `String` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | String getCreditAmount() | setCreditAmount(String creditAmount) | | `DebitAmount` | `String` | Optional | - | String getDebitAmount() | setDebitAmount(String debitAmount) | | `RefundAmount` | `String` | Optional | - | String getRefundAmount() | setRefundAmount(String refundAmount) | @@ -65,20 +65,24 @@ | `PublicUrl` | `String` | Optional | The public URL of the invoice | String getPublicUrl() | setPublicUrl(String publicUrl) | | `PreviousBalanceData` | [`InvoicePreviousBalance`](../../doc/models/invoice-previous-balance.md) | Optional | - | InvoicePreviousBalance getPreviousBalanceData() | setPreviousBalanceData(InvoicePreviousBalance previousBalanceData) | | `PublicUrlExpiresOn` | `LocalDate` | Optional | The format is `"YYYY-MM-DD"`. | LocalDate getPublicUrlExpiresOn() | setPublicUrlExpiresOn(LocalDate publicUrlExpiresOn) | +| `BrandingThemeId` | `Integer` | Optional | The ID of the Branding Theme associated with this invoice. This value represents the Branding Theme used for invoice theming, such as themed invoice rendering. Available only when Branding Themes are enabled for the site. | Integer getBrandingThemeId() | setBrandingThemeId(Integer brandingThemeId) | -## Example (as JSON) +## Example -```json -{ - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 252, - "uid": "uid0", - "site_id": 178, - "customer_id": 34, - "subscription_id": 106 -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Invoice; + +Invoice invoice = new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(); ``` diff --git a/doc/models/issue-advance-invoice-request.md b/doc/models/issue-advance-invoice-request.md index ff9f1116..b37ed995 100644 --- a/doc/models/issue-advance-invoice-request.md +++ b/doc/models/issue-advance-invoice-request.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `Force` | `Boolean` | Optional | - | Boolean getForce() | setForce(Boolean force) | -## Example (as JSON) +## Example -```json -{ - "force": false -} +```java +import com.maxio.advancedbilling.models.IssueAdvanceInvoiceRequest; + +IssueAdvanceInvoiceRequest issueAdvanceInvoiceRequest = new IssueAdvanceInvoiceRequest.Builder() + .force(false) + .build(); ``` diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index 1c02b240..31988442 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -11,21 +11,26 @@ Example schema for an `issue_invoice` event | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | +| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | | `FromStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice before event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | InvoiceStatus getFromStatus() | setFromStatus(InvoiceStatus fromStatus) | | `ToStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice after event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | InvoiceStatus getToStatus() | setToStatus(InvoiceStatus toStatus) | | `DueAmount` | `String` | Required | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | String getDueAmount() | setDueAmount(String dueAmount) | | `TotalAmount` | `String` | Required | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | String getTotalAmount() | setTotalAmount(String totalAmount) | -## Example (as JSON) - -```json -{ - "consolidation_level": "none", - "from_status": "voided", - "to_status": "draft", - "due_amount": "due_amount6", - "total_amount": "total_amount0" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.InvoiceStatus; +import com.maxio.advancedbilling.models.IssueInvoiceEventData; + +IssueInvoiceEventData issueInvoiceEventData = new IssueInvoiceEventData.Builder( + InvoiceConsolidationLevel.CHILD, + InvoiceStatus.DRAFT, + InvoiceStatus.VOIDED, + "due_amount6", + "total_amount0" +) +.build(); ``` diff --git a/doc/models/issue-invoice-event.md b/doc/models/issue-invoice-event.md index a5b4c0f5..f88db764 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -15,31 +15,41 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.ISSUE_INVOICE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`IssueInvoiceEventData`](../../doc/models/issue-invoice-event-data.md) | Required | Example schema for an `issue_invoice` event | IssueInvoiceEventData getEventData() | setEventData(IssueInvoiceEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 130, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "issue_invoice", - "event_data": { - "consolidation_level": "child", - "from_status": "open", - "to_status": "pending", - "due_amount": "due_amount8", - "total_amount": "total_amount2" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.InvoiceStatus; +import com.maxio.advancedbilling.models.IssueInvoiceEvent; +import com.maxio.advancedbilling.models.IssueInvoiceEventData; + +IssueInvoiceEvent issueInvoiceEvent = new IssueInvoiceEvent.Builder( + 144L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.ISSUE_INVOICE, + new IssueInvoiceEventData.Builder( + InvoiceConsolidationLevel.CHILD, + InvoiceStatus.OPEN, + InvoiceStatus.PENDING, + "due_amount8", + "total_amount2" + ) + .build() +) +.build(); ``` diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index 1e8c02f8..dccb2d49 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,13 +9,16 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `OnFailedPayment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `FailedPaymentAction.LEAVE_OPEN_INVOICE` | FailedPaymentAction getOnFailedPayment() | setOnFailedPayment(FailedPaymentAction onFailedPayment) | +| `OnFailedPayment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `FailedPaymentAction.LEAVE_OPEN_INVOICE` | FailedPaymentAction getOnFailedPayment() | setOnFailedPayment(FailedPaymentAction onFailedPayment) | -## Example (as JSON) +## Example -```json -{ - "on_failed_payment": "leave_open_invoice" -} +```java +import com.maxio.advancedbilling.models.FailedPaymentAction; +import com.maxio.advancedbilling.models.IssueInvoiceRequest; + +IssueInvoiceRequest issueInvoiceRequest = new IssueInvoiceRequest.Builder() + .onFailedPayment(FailedPaymentAction.LEAVE_OPEN_INVOICE) + .build(); ``` diff --git a/doc/models/issue-service-credit-request.md b/doc/models/issue-service-credit-request.md index de8d17d2..3794386b 100644 --- a/doc/models/issue-service-credit-request.md +++ b/doc/models/issue-service-credit-request.md @@ -11,14 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `ServiceCredit` | [`IssueServiceCredit`](../../doc/models/issue-service-credit.md) | Required | - | IssueServiceCredit getServiceCredit() | setServiceCredit(IssueServiceCredit serviceCredit) | -## Example (as JSON) - -```json -{ - "service_credit": { - "amount": 31.42, - "memo": "memo0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.IssueServiceCredit; +import com.maxio.advancedbilling.models.IssueServiceCreditRequest; +import com.maxio.advancedbilling.models.containers.IssueServiceCreditAmount; + +IssueServiceCreditRequest issueServiceCreditRequest = new IssueServiceCreditRequest.Builder( + new IssueServiceCredit.Builder( + IssueServiceCreditAmount.fromPrecision( + 31.42D + ) + ) + .memo("memo0") + .build() +) +.build(); ``` diff --git a/doc/models/issue-service-credit.md b/doc/models/issue-service-credit.md index b8d7da70..cd548551 100644 --- a/doc/models/issue-service-credit.md +++ b/doc/models/issue-service-credit.md @@ -12,12 +12,18 @@ | `Amount` | [`IssueServiceCreditAmount`](../../doc/models/containers/issue-service-credit-amount.md) | Required | This is a container for one-of cases. | IssueServiceCreditAmount getAmount() | setAmount(IssueServiceCreditAmount amount) | | `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | -## Example (as JSON) - -```json -{ - "amount": 5.82, - "memo": "memo4" -} +## Example + +```java +import com.maxio.advancedbilling.models.IssueServiceCredit; +import com.maxio.advancedbilling.models.containers.IssueServiceCreditAmount; + +IssueServiceCredit issueServiceCredit = new IssueServiceCredit.Builder( + IssueServiceCreditAmount.fromPrecision( + 44.88D + ) +) +.memo("memo6") +.build(); ``` diff --git a/doc/models/item-category.md b/doc/models/item-category.md index 8a73b8c3..a0e03c95 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -19,7 +19,9 @@ One of the following: Business Software, Consumer Software, Digital Services, Ph ## Example -``` -Business Software +```java +import com.maxio.advancedbilling.models.ItemCategory; + +ItemCategory itemCategory = ItemCategory.OTHER; ``` diff --git a/doc/models/item-price-point-changed.md b/doc/models/item-price-point-changed.md index 7ac82e05..db11dc23 100644 --- a/doc/models/item-price-point-changed.md +++ b/doc/models/item-price-point-changed.md @@ -16,24 +16,28 @@ | `PreviousPricePoint` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | ItemPricePointData getPreviousPricePoint() | setPreviousPricePoint(ItemPricePointData previousPricePoint) | | `CurrentPricePoint` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | ItemPricePointData getCurrentPricePoint() | setCurrentPricePoint(ItemPricePointData currentPricePoint) | -## Example (as JSON) - -```json -{ - "item_id": 66, - "item_type": "item_type6", - "item_handle": "item_handle4", - "item_name": "item_name8", - "previous_price_point": { - "id": 216, - "handle": "handle6", - "name": "name0" - }, - "current_price_point": { - "id": 218, - "handle": "handle6", - "name": "name0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ItemPricePointChanged; +import com.maxio.advancedbilling.models.ItemPricePointData; + +ItemPricePointChanged itemPricePointChanged = new ItemPricePointChanged.Builder( + 30, + "item_type6", + "item_handle4", + "item_name8", + new ItemPricePointData.Builder() + .id(216) + .handle("handle6") + .name("name0") + .build(), + new ItemPricePointData.Builder() + .id(218) + .handle("handle6") + .name("name0") + .build() +) +.build(); ``` diff --git a/doc/models/item-price-point-data.md b/doc/models/item-price-point-data.md index cbb09b3f..20de4d66 100644 --- a/doc/models/item-price-point-data.md +++ b/doc/models/item-price-point-data.md @@ -13,13 +13,15 @@ | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | | `Name` | `String` | Optional | - | String getName() | setName(String name) | -## Example (as JSON) - -```json -{ - "id": 192, - "handle": "handle6", - "name": "name0" -} +## Example + +```java +import com.maxio.advancedbilling.models.ItemPricePointData; + +ItemPricePointData itemPricePointData = new ItemPricePointData.Builder() + .id(80) + .handle("handle8") + .name("name2") + .build(); ``` diff --git a/doc/models/line-item-kind.md b/doc/models/line-item-kind.md index 380d29ea..586144c5 100644 --- a/doc/models/line-item-kind.md +++ b/doc/models/line-item-kind.md @@ -22,3 +22,11 @@ A handle for the line item kind | `COUPON` | | `TAX` | +## Example + +```java +import com.maxio.advancedbilling.models.LineItemKind; + +LineItemKind lineItemKind = LineItemKind.PREPAID_USAGE_COMPONENT; +``` + diff --git a/doc/models/line-item-transaction-type.md b/doc/models/line-item-transaction-type.md index f5847f6b..52b5f49f 100644 --- a/doc/models/line-item-transaction-type.md +++ b/doc/models/line-item-transaction-type.md @@ -19,3 +19,11 @@ A handle for the line item transaction type | `INFO_TRANSACTION` | | `PAYMENT_AUTHORIZATION` | +## Example + +```java +import com.maxio.advancedbilling.models.LineItemTransactionType; + +LineItemTransactionType lineItemTransactionType = LineItemTransactionType.PAYMENT; +``` + diff --git a/doc/models/list-component-price-points-input.md b/doc/models/list-component-price-points-input.md index cd5eb622..036f26b9 100644 --- a/doc/models/list-component-price-points-input.md +++ b/doc/models/list-component-price-points-input.md @@ -12,7 +12,7 @@ Input structure for the method ListComponentPricePoints | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `ComponentId` | `int` | Required | The Advanced Billing id of the component | int getComponentId() | setComponentId(int componentId) | -| `CurrencyPrices` | `Boolean` | Optional | Include an array of currency price data | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | +| `CurrencyPrices` | `Boolean` | Optional | Include an array of currency price data. | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | | `FilterType` | [`List`](../../doc/models/price-point-type.md) | Optional | Use in query: `filter[type]=catalog,default`. | List getFilterType() | setFilterType(List filterType) | diff --git a/doc/models/list-components-filter.md b/doc/models/list-components-filter.md index c8602989..e51acf79 100644 --- a/doc/models/list-components-filter.md +++ b/doc/models/list-components-filter.md @@ -12,16 +12,19 @@ | `Ids` | `List` | Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | List getIds() | setIds(List ids) | | `UseSiteExchangeRate` | `Boolean` | Optional | Allows fetching components with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | -## Example (as JSON) - -```json -{ - "ids": [ - 1, - 2, - 3 - ], - "use_site_exchange_rate": false -} +## Example + +```java +import com.maxio.advancedbilling.models.ListComponentsFilter; +import java.util.Arrays; + +ListComponentsFilter listComponentsFilter = new ListComponentsFilter.Builder() + .ids(Arrays.asList( + 1, + 2, + 3 + )) + .useSiteExchangeRate(false) + .build(); ``` diff --git a/doc/models/list-components-for-product-family-input.md b/doc/models/list-components-for-product-family-input.md index 8c3ff83e..f039ba2f 100644 --- a/doc/models/list-components-for-product-family-input.md +++ b/doc/models/list-components-for-product-family-input.md @@ -18,7 +18,7 @@ Input structure for the method ListComponentsForProductFamily | `Filter` | [`ListComponentsFilter`](../../doc/models/list-components-filter.md) | Optional | Filter to use for List Components operations | ListComponentsFilter getFilter() | setFilter(ListComponentsFilter filter) | | `DateField` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Optional | The type of filter you would like to apply to your search. Use in query `date_field=created_at`. | BasicDateField getDateField() | setDateField(BasicDateField dateField) | | `EndDate` | `String` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | String getEndDate() | setEndDate(String endDate) | -| `EndDatetime` | `String` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional. | String getEndDatetime() | setEndDatetime(String endDatetime) | +| `EndDatetime` | `String` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | String getEndDatetime() | setEndDatetime(String endDatetime) | | `StartDate` | `String` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | String getStartDate() | setStartDate(String startDate) | | `StartDatetime` | `String` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | String getStartDatetime() | setStartDatetime(String startDatetime) | diff --git a/doc/models/list-components-input.md b/doc/models/list-components-input.md index 44ea5f44..b4a9ba7e 100644 --- a/doc/models/list-components-input.md +++ b/doc/models/list-components-input.md @@ -15,8 +15,8 @@ Input structure for the method ListComponents | `StartDate` | `String` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | String getStartDate() | setStartDate(String startDate) | | `EndDate` | `String` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | String getEndDate() | setEndDate(String endDate) | | `StartDatetime` | `String` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | String getStartDatetime() | setStartDatetime(String startDatetime) | -| `EndDatetime` | `String` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | String getEndDatetime() | setEndDatetime(String endDatetime) | -| `IncludeArchived` | `Boolean` | Optional | Include archived items | Boolean getIncludeArchived() | setIncludeArchived(Boolean includeArchived) | +| `EndDatetime` | `String` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | String getEndDatetime() | setEndDatetime(String endDatetime) | +| `IncludeArchived` | `Boolean` | Optional | Include archived items. | Boolean getIncludeArchived() | setIncludeArchived(Boolean includeArchived) | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | | `Filter` | [`ListComponentsFilter`](../../doc/models/list-components-filter.md) | Optional | Filter to use for List Components operations | ListComponentsFilter getFilter() | setFilter(ListComponentsFilter filter) | diff --git a/doc/models/list-components-price-points-include.md b/doc/models/list-components-price-points-include.md index 31cc7ea7..75e0ffcf 100644 --- a/doc/models/list-components-price-points-include.md +++ b/doc/models/list-components-price-points-include.md @@ -13,7 +13,9 @@ ## Example -``` -currency_prices +```java +import com.maxio.advancedbilling.models.ListComponentsPricePointsInclude; + +ListComponentsPricePointsInclude listComponentsPricePointsInclude = ListComponentsPricePointsInclude.CURRENCY_PRICES; ``` diff --git a/doc/models/list-components-price-points-response.md b/doc/models/list-components-price-points-response.md index 9098560e..8f0c169c 100644 --- a/doc/models/list-components-price-points-response.md +++ b/doc/models/list-components-price-points-response.md @@ -11,19 +11,26 @@ | --- | --- | --- | --- | --- | --- | | `PricePoints` | [`List`](../../doc/models/component-price-point.md) | Required | - | List getPricePoints() | setPricePoints(List pricePoints) | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePoint; +import com.maxio.advancedbilling.models.ListComponentsPricePointsResponse; +import com.maxio.advancedbilling.models.PricePointType; +import com.maxio.advancedbilling.models.PricingScheme; +import java.util.Arrays; + +ListComponentsPricePointsResponse listComponentsPricePointsResponse = new ListComponentsPricePointsResponse.Builder( + Arrays.asList( + new ComponentPricePoint.Builder() + .id(40) + .type(PricePointType.ENUM_DEFAULT) + .mDefault(false) + .name("name2") + .pricingScheme(PricingScheme.PER_UNIT) + .build() + ) +) +.build(); ``` diff --git a/doc/models/list-coupons-filter.md b/doc/models/list-coupons-filter.md index 9d0e7089..31fc2617 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -19,24 +19,29 @@ | `UseSiteExchangeRate` | `Boolean` | Optional | If true, restricts the list to coupons whose pricing is recalculated from the site’s current exchange rates, so their currency_prices array contains on-the-fly conversions rather than stored price records. If false, restricts the list to coupons that have manually defined amounts for each currency, ensuring the response includes the saved currency_prices entries instead of exchange-rate-derived values. Use in query `filter[use_site_exchange_rate]=true`. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `IncludeArchived` | `Boolean` | Optional | Controls returning archived coupons. | Boolean getIncludeArchived() | setIncludeArchived(Boolean includeArchived) | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "ids": [ - 1, - 2, - 3 - ], - "codes": [ - "free", - "free_trial" - ], - "date_field": "updated_at" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BasicDateField; +import com.maxio.advancedbilling.models.ListCouponsFilter; +import java.util.Arrays; + +ListCouponsFilter listCouponsFilter = new ListCouponsFilter.Builder() + .dateField(BasicDateField.UPDATED_AT) + .startDate(DateTimeHelper.fromSimpleDate("2011-12-17")) + .endDate(DateTimeHelper.fromSimpleDate("2011-12-15")) + .startDatetime(DateTimeHelper.fromRfc8601DateTime("2011-12-19T09:15:30+00:00")) + .endDatetime(DateTimeHelper.fromRfc8601DateTime("2019-06-07T17:20:06Z")) + .ids(Arrays.asList( + 1, + 2, + 3 + )) + .codes(Arrays.asList( + "free", + "free_trial" + )) + .build(); ``` diff --git a/doc/models/list-coupons-for-product-family-input.md b/doc/models/list-coupons-for-product-family-input.md index e3314da7..d5507b26 100644 --- a/doc/models/list-coupons-for-product-family-input.md +++ b/doc/models/list-coupons-for-product-family-input.md @@ -15,7 +15,7 @@ Input structure for the method ListCouponsForProductFamily | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | | `Filter` | [`ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Optional | Filter to use for List Coupons operations | ListCouponsFilter getFilter() | setFilter(ListCouponsFilter filter) | -| `CurrencyPrices` | `Boolean` | Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | +| `CurrencyPrices` | `Boolean` | Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | ## Example diff --git a/doc/models/list-coupons-input.md b/doc/models/list-coupons-input.md index 9c398a19..30ff4655 100644 --- a/doc/models/list-coupons-input.md +++ b/doc/models/list-coupons-input.md @@ -14,7 +14,7 @@ Input structure for the method ListCoupons | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | | `Filter` | [`ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Optional | Filter to use for List Coupons operations | ListCouponsFilter getFilter() | setFilter(ListCouponsFilter filter) | -| `CurrencyPrices` | `Boolean` | Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | +| `CurrencyPrices` | `Boolean` | Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | ## Example diff --git a/doc/models/list-credit-notes-input.md b/doc/models/list-credit-notes-input.md index 2ea76a0d..8c9f1270 100644 --- a/doc/models/list-credit-notes-input.md +++ b/doc/models/list-credit-notes-input.md @@ -14,11 +14,11 @@ Input structure for the method ListCreditNotes | `SubscriptionId` | `Integer` | Optional | The subscription's Advanced Billing id | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | -| `LineItems` | `Boolean` | Optional | Include line items data

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | -| `Discounts` | `Boolean` | Optional | Include discounts data

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | -| `Taxes` | `Boolean` | Optional | Include taxes data

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | -| `Refunds` | `Boolean` | Optional | Include refunds data

**Default**: `false` | Boolean getRefunds() | setRefunds(Boolean refunds) | -| `Applications` | `Boolean` | Optional | Include applications data

**Default**: `false` | Boolean getApplications() | setApplications(Boolean applications) | +| `LineItems` | `Boolean` | Optional | Include line items data.

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | +| `Discounts` | `Boolean` | Optional | Include discounts data.

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | +| `Taxes` | `Boolean` | Optional | Include taxes data.

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | +| `Refunds` | `Boolean` | Optional | Include refunds data.

**Default**: `false` | Boolean getRefunds() | setRefunds(Boolean refunds) | +| `Applications` | `Boolean` | Optional | Include applications data.

**Default**: `false` | Boolean getApplications() | setApplications(Boolean applications) | ## Example diff --git a/doc/models/list-credit-notes-response.md b/doc/models/list-credit-notes-response.md index 2bcb08fb..fa302ef1 100644 --- a/doc/models/list-credit-notes-response.md +++ b/doc/models/list-credit-notes-response.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `CreditNotes` | [`List`](../../doc/models/credit-note.md) | Required | - | List getCreditNotes() | setCreditNotes(List creditNotes) | -## Example (as JSON) - -```json -{ - "credit_notes": [ - { - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": "number0" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.ListCreditNotesResponse; +import java.util.Arrays; + +ListCreditNotesResponse listCreditNotesResponse = new ListCreditNotesResponse.Builder( + Arrays.asList( + new CreditNote.Builder() + .uid("uid2") + .siteId(112) + .customerId(224) + .subscriptionId(40) + .number("number0") + .build() + ) +) +.build(); ``` diff --git a/doc/models/list-events-date-field.md b/doc/models/list-events-date-field.md index 7ac6c5f0..acb54ef0 100644 --- a/doc/models/list-events-date-field.md +++ b/doc/models/list-events-date-field.md @@ -13,7 +13,9 @@ ## Example -``` -created_at +```java +import com.maxio.advancedbilling.models.ListEventsDateField; + +ListEventsDateField listEventsDateField = ListEventsDateField.CREATED_AT; ``` diff --git a/doc/models/list-events-input.md b/doc/models/list-events-input.md index f153baf7..f037d2f7 100644 --- a/doc/models/list-events-input.md +++ b/doc/models/list-events-input.md @@ -13,8 +13,8 @@ Input structure for the method ListEvents | --- | --- | --- | --- | --- | --- | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | -| `SinceId` | `Long` | Optional | Returns events with an id greater than or equal to the one specified | Long getSinceId() | setSinceId(Long sinceId) | -| `MaxId` | `Long` | Optional | Returns events with an id less than or equal to the one specified | Long getMaxId() | setMaxId(Long maxId) | +| `SinceId` | `Long` | Optional | Returns events with an id greater than or equal to the one specified. | Long getSinceId() | setSinceId(Long sinceId) | +| `MaxId` | `Long` | Optional | Returns events with an id less than or equal to the one specified. | Long getMaxId() | setMaxId(Long maxId) | | `Direction` | [`Direction`](../../doc/models/direction.md) | Optional | The sort direction of the returned events.

**Default**: `Direction.DESC` | Direction getDirection() | setDirection(Direction direction) | | `Filter` | [`List`](../../doc/models/event-key.md) | Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | List getFilter() | setFilter(List filter) | | `DateField` | [`ListEventsDateField`](../../doc/models/list-events-date-field.md) | Optional | The type of filter you would like to apply to your search. | ListEventsDateField getDateField() | setDateField(ListEventsDateField dateField) | diff --git a/doc/models/list-invoice-events-response.md b/doc/models/list-invoice-events-response.md index 0825af22..cdb9b8aa 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -14,52 +14,148 @@ | `PerPage` | `Integer` | Optional | - | Integer getPerPage() | setPerPage(Integer perPage) | | `TotalPages` | `Integer` | Optional | - | Integer getTotalPages() | setTotalPages(Integer totalPages) | -## Example (as JSON) +## Example -```json -{ - "events": [ - { - "event_type": "apply_credit_note", - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } - ] - } - } - ], - "page": 184, - "per_page": 96, - "total_pages": 194 -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AppliedCreditNoteData; +import com.maxio.advancedbilling.models.ApplyCreditNoteEvent; +import com.maxio.advancedbilling.models.ApplyCreditNoteEventData; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.ListInvoiceEventsResponse; +import com.maxio.advancedbilling.models.containers.InvoiceEvent; +import java.util.Arrays; + +ListInvoiceEventsResponse listInvoiceEventsResponse = new ListInvoiceEventsResponse.Builder() + .events(Arrays.asList( + InvoiceEvent.fromApplyCreditNoteEvent( + new ApplyCreditNoteEvent.Builder( + 214L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .build(), + InvoiceEventType.APPLY_CREDIT_NOTE, + new ApplyCreditNoteEventData.Builder( + "uid6", + "credit_note_number0", + "credit_note_uid0", + "original_amount0", + "applied_amount2" + ) + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .memo("memo0") + .role("role0") + .consolidatedInvoice(false) + .appliedCreditNotes(Arrays.asList( + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build() + )) + .build() + ) + .build() + ), + InvoiceEvent.fromApplyCreditNoteEvent( + new ApplyCreditNoteEvent.Builder( + 214L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .build(), + InvoiceEventType.APPLY_CREDIT_NOTE, + new ApplyCreditNoteEventData.Builder( + "uid6", + "credit_note_number0", + "credit_note_uid0", + "original_amount0", + "applied_amount2" + ) + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .memo("memo0") + .role("role0") + .consolidatedInvoice(false) + .appliedCreditNotes(Arrays.asList( + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build() + )) + .build() + ) + .build() + ), + InvoiceEvent.fromApplyCreditNoteEvent( + new ApplyCreditNoteEvent.Builder( + 214L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .build(), + InvoiceEventType.APPLY_CREDIT_NOTE, + new ApplyCreditNoteEventData.Builder( + "uid6", + "credit_note_number0", + "credit_note_uid0", + "original_amount0", + "applied_amount2" + ) + .transactionTime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .memo("memo0") + .role("role0") + .consolidatedInvoice(false) + .appliedCreditNotes(Arrays.asList( + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build(), + new AppliedCreditNoteData.Builder() + .uid("uid4") + .number("number8") + .build() + )) + .build() + ) + .build() + ) + )) + .page(28) + .perPage(196) + .totalPages(94) + .build(); ``` diff --git a/doc/models/list-invoices-input.md b/doc/models/list-invoices-input.md index 9f56df85..6a94d52d 100644 --- a/doc/models/list-invoices-input.md +++ b/doc/models/list-invoices-input.md @@ -20,13 +20,13 @@ Input structure for the method ListInvoices | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | | `Direction` | [`Direction`](../../doc/models/direction.md) | Optional | The sort direction of the returned invoices.

**Default**: `Direction.DESC` | Direction getDirection() | setDirection(Direction direction) | -| `LineItems` | `Boolean` | Optional | Include line items data

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | -| `Discounts` | `Boolean` | Optional | Include discounts data

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | -| `Taxes` | `Boolean` | Optional | Include taxes data

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | -| `Credits` | `Boolean` | Optional | Include credits data

**Default**: `false` | Boolean getCredits() | setCredits(Boolean credits) | -| `Payments` | `Boolean` | Optional | Include payments data

**Default**: `false` | Boolean getPayments() | setPayments(Boolean payments) | -| `CustomFields` | `Boolean` | Optional | Include custom fields data

**Default**: `false` | Boolean getCustomFields() | setCustomFields(Boolean customFields) | -| `Refunds` | `Boolean` | Optional | Include refunds data

**Default**: `false` | Boolean getRefunds() | setRefunds(Boolean refunds) | +| `LineItems` | `Boolean` | Optional | Include line items data.

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | +| `Discounts` | `Boolean` | Optional | Include discounts data.

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | +| `Taxes` | `Boolean` | Optional | Include taxes data.

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | +| `Credits` | `Boolean` | Optional | Include credits data.

**Default**: `false` | Boolean getCredits() | setCredits(Boolean credits) | +| `Payments` | `Boolean` | Optional | Include payments data.

**Default**: `false` | Boolean getPayments() | setPayments(Boolean payments) | +| `CustomFields` | `Boolean` | Optional | Include custom fields data.

**Default**: `false` | Boolean getCustomFields() | setCustomFields(Boolean customFields) | +| `Refunds` | `Boolean` | Optional | Include refunds data.

**Default**: `false` | Boolean getRefunds() | setRefunds(Boolean refunds) | | `DateField` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.

**Default**: `InvoiceDateField.DUE_DATE` | InvoiceDateField getDateField() | setDateField(InvoiceDateField dateField) | | `StartDatetime` | `String` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | String getStartDatetime() | setStartDatetime(String startDatetime) | | `EndDatetime` | `String` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | String getEndDatetime() | setEndDatetime(String endDatetime) | diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index 0be76399..4cc63daf 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -11,23 +11,29 @@ | --- | --- | --- | --- | --- | --- | | `Invoices` | [`List`](../../doc/models/invoice.md) | Required | - | List getInvoices() | setInvoices(List invoices) | -## Example (as JSON) - -```json -{ - "invoices": [ - { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.ListInvoicesResponse; +import java.util.Arrays; + +ListInvoicesResponse listInvoicesResponse = new ListInvoicesResponse.Builder( + Arrays.asList( + new Invoice.Builder() + .id(196L) + .uid("uid6") + .siteId(122) + .customerId(234) + .subscriptionId(50) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build() + ) +) +.build(); ``` diff --git a/doc/models/list-metafields-response.md b/doc/models/list-metafields-response.md index 9dab2958..ecfd8815 100644 --- a/doc/models/list-metafields-response.md +++ b/doc/models/list-metafields-response.md @@ -15,29 +15,62 @@ | `PerPage` | `Integer` | Optional | - | Integer getPerPage() | setPerPage(Integer perPage) | | `Metafields` | [`List`](../../doc/models/metafield.md) | Optional | - | List getMetafields() | setMetafields(List metafields) | -## Example (as JSON) - -```json -{ - "total_count": 210, - "current_page": 186, - "total_pages": 198, - "per_page": 92, - "metafields": [ - { - "id": 22, - "name": "name2", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "data_count": 10, - "input_type": "balance_tracker" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.IncludeOption; +import com.maxio.advancedbilling.models.ListMetafieldsResponse; +import com.maxio.advancedbilling.models.Metafield; +import com.maxio.advancedbilling.models.MetafieldInput; +import com.maxio.advancedbilling.models.MetafieldScope; +import java.util.Arrays; + +ListMetafieldsResponse listMetafieldsResponse = new ListMetafieldsResponse.Builder() + .totalCount(228) + .currentPage(204) + .totalPages(216) + .perPage(74) + .metafields(Arrays.asList( + new Metafield.Builder() + .id(22) + .name("name2") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .build()) + .dataCount(10) + .inputType(MetafieldInput.BALANCE_TRACKER) + .build(), + new Metafield.Builder() + .id(22) + .name("name2") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .build()) + .dataCount(10) + .inputType(MetafieldInput.BALANCE_TRACKER) + .build(), + new Metafield.Builder() + .id(22) + .name("name2") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .build()) + .dataCount(10) + .inputType(MetafieldInput.BALANCE_TRACKER) + .build() + )) + .build(); ``` diff --git a/doc/models/list-mrr-filter.md b/doc/models/list-mrr-filter.md index fe2afd1b..64b09b27 100644 --- a/doc/models/list-mrr-filter.md +++ b/doc/models/list-mrr-filter.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionIds` | `List` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | List getSubscriptionIds() | setSubscriptionIds(List subscriptionIds) | -## Example (as JSON) - -```json -{ - "subscription_ids": [ - 1, - 2, - 3 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ListMrrFilter; +import java.util.Arrays; + +ListMrrFilter listMrrFilter = new ListMrrFilter.Builder() + .subscriptionIds(Arrays.asList( + 1, + 2, + 3 + )) + .build(); ``` diff --git a/doc/models/list-mrr-movements-input.md b/doc/models/list-mrr-movements-input.md index c265e623..622f0b9d 100644 --- a/doc/models/list-mrr-movements-input.md +++ b/doc/models/list-mrr-movements-input.md @@ -11,7 +11,7 @@ Input structure for the method ListMrrMovements | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `SubscriptionId` | `Integer` | Optional | optionally filter results by subscription | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | +| `SubscriptionId` | `Integer` | Optional | (Optional) Filter results by subscription. | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.

**Default**: `10`

**Constraints**: `<= 50` | Integer getPerPage() | setPerPage(Integer perPage) | | `Direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | SortingDirection getDirection() | setDirection(SortingDirection direction) | diff --git a/doc/models/list-mrr-response-result.md b/doc/models/list-mrr-response-result.md index 6af9e14e..c3a0c99b 100644 --- a/doc/models/list-mrr-response-result.md +++ b/doc/models/list-mrr-response-result.md @@ -17,15 +17,17 @@ | `CurrencySymbol` | `String` | Optional | - | String getCurrencySymbol() | setCurrencySymbol(String currencySymbol) | | `Movements` | [`List`](../../doc/models/movement.md) | Optional | - | List getMovements() | setMovements(List movements) | -## Example (as JSON) - -```json -{ - "page": 150, - "per_page": 238, - "total_pages": 16, - "total_entries": 112, - "currency": "currency8" -} +## Example + +```java +import com.maxio.advancedbilling.models.ListMRRResponseResult; + +ListMRRResponseResult listMRRResponseResult = new ListMRRResponseResult.Builder() + .page(40) + .perPage(208) + .totalPages(82) + .totalEntries(78) + .currency("currency6") + .build(); ``` diff --git a/doc/models/list-mrr-response.md b/doc/models/list-mrr-response.md index 18738e93..c3d8fd5e 100644 --- a/doc/models/list-mrr-response.md +++ b/doc/models/list-mrr-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Mrr` | [`ListMRRResponseResult`](../../doc/models/list-mrr-response-result.md) | Required | - | ListMRRResponseResult getMrr() | setMrr(ListMRRResponseResult mrr) | -## Example (as JSON) - -```json -{ - "mrr": { - "page": 30, - "per_page": 198, - "total_pages": 92, - "total_entries": 188, - "currency": "currency4" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ListMRRResponse; +import com.maxio.advancedbilling.models.ListMRRResponseResult; + +ListMRRResponse listMRRResponse = new ListMRRResponse.Builder( + new ListMRRResponseResult.Builder() + .page(30) + .perPage(198) + .totalPages(92) + .totalEntries(188) + .currency("currency4") + .build() +) +.build(); ``` diff --git a/doc/models/list-offers-response.md b/doc/models/list-offers-response.md index 6889f884..b5d9fa8a 100644 --- a/doc/models/list-offers-response.md +++ b/doc/models/list-offers-response.md @@ -11,33 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `Offers` | [`List`](../../doc/models/offer.md) | Optional | - | List getOffers() | setOffers(List offers) | -## Example (as JSON) - -```json -{ - "offers": [ - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ListOffersResponse; +import com.maxio.advancedbilling.models.Offer; +import java.util.Arrays; + +ListOffersResponse listOffersResponse = new ListOffersResponse.Builder() + .offers(Arrays.asList( + new Offer.Builder() + .id(12) + .siteId(194) + .productFamilyId(16) + .productId(210) + .productPricePointId(134) + .build() + )) + .build(); ``` diff --git a/doc/models/list-prepayment-date-field.md b/doc/models/list-prepayment-date-field.md index fb729cda..b1a14aa5 100644 --- a/doc/models/list-prepayment-date-field.md +++ b/doc/models/list-prepayment-date-field.md @@ -14,7 +14,9 @@ ## Example -``` -created_at +```java +import com.maxio.advancedbilling.models.ListPrepaymentDateField; + +ListPrepaymentDateField listPrepaymentDateField = ListPrepaymentDateField.CREATED_AT; ``` diff --git a/doc/models/list-prepayments-filter.md b/doc/models/list-prepayments-filter.md index 4dfef3f7..ccb54a94 100644 --- a/doc/models/list-prepayments-filter.md +++ b/doc/models/list-prepayments-filter.md @@ -13,13 +13,17 @@ | `StartDate` | `LocalDate` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp at or after midnight (12:00:00 AM) in your site's time zone on the date specified. Use in query: `filter[start_date]=2011-12-15`. | LocalDate getStartDate() | setStartDate(LocalDate startDate) | | `EndDate` | `LocalDate` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp up to and including 11:59:59PM in your site's time zone on the date specified. Use in query: `filter[end_date]=2011-12-15`. | LocalDate getEndDate() | setEndDate(LocalDate endDate) | -## Example (as JSON) - -```json -{ - "date_field": "created_at", - "start_date": "2024-01-01", - "end_date": "2024-01-31" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ListPrepaymentDateField; +import com.maxio.advancedbilling.models.ListPrepaymentsFilter; + +ListPrepaymentsFilter listPrepaymentsFilter = new ListPrepaymentsFilter.Builder() + .dateField(ListPrepaymentDateField.CREATED_AT) + .startDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .endDate(DateTimeHelper.fromSimpleDate("2024-01-31")) + .build(); ``` diff --git a/doc/models/list-price-points-filter.md b/doc/models/list-price-points-filter.md index b41ec00f..23bd2918 100644 --- a/doc/models/list-price-points-filter.md +++ b/doc/models/list-price-points-filter.md @@ -18,25 +18,31 @@ | `Ids` | `List` | Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | List getIds() | setIds(List ids) | | `ArchivedAt` | [`IncludeNullOrNotNull`](../../doc/models/include-null-or-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | IncludeNullOrNotNull getArchivedAt() | setArchivedAt(IncludeNullOrNotNull archivedAt) | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "type": [ - "catalog", - "default", - "custom" - ], - "ids": [ - 1, - 2, - 3 - ], - "date_field": "updated_at" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.BasicDateField; +import com.maxio.advancedbilling.models.ListPricePointsFilter; +import com.maxio.advancedbilling.models.PricePointType; +import java.util.Arrays; + +ListPricePointsFilter listPricePointsFilter = new ListPricePointsFilter.Builder() + .dateField(BasicDateField.UPDATED_AT) + .startDate(DateTimeHelper.fromSimpleDate("2011-12-17")) + .endDate(DateTimeHelper.fromSimpleDate("2011-12-15")) + .startDatetime(DateTimeHelper.fromRfc8601DateTime("2011-12-19T09:15:30+00:00")) + .endDatetime(DateTimeHelper.fromRfc8601DateTime("2019-06-07T17:20:06Z")) + .type(Arrays.asList( + PricePointType.CATALOG, + PricePointType.ENUM_DEFAULT, + PricePointType.CUSTOM + )) + .ids(Arrays.asList( + 1, + 2, + 3 + )) + .build(); ``` diff --git a/doc/models/list-product-price-points-input.md b/doc/models/list-product-price-points-input.md index 7bf2e19b..647fbdda 100644 --- a/doc/models/list-product-price-points-input.md +++ b/doc/models/list-product-price-points-input.md @@ -14,7 +14,7 @@ Input structure for the method ListProductPricePoints | `ProductId` | [`ListProductPricePointsInputProductId`](../../doc/models/containers/list-product-price-points-input-product-id.md) | Required | This is a container for one-of cases. | ListProductPricePointsInputProductId getProductId() | setProductId(ListProductPricePointsInputProductId productId) | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.

**Default**: `10`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | -| `CurrencyPrices` | `Boolean` | Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | +| `CurrencyPrices` | `Boolean` | Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | Boolean getCurrencyPrices() | setCurrencyPrices(Boolean currencyPrices) | | `FilterType` | [`List`](../../doc/models/price-point-type.md) | Optional | Use in query: `filter[type]=catalog,default`. | List getFilterType() | setFilterType(List filterType) | | `Archived` | `Boolean` | Optional | Set to include archived price points in the response. | Boolean getArchived() | setArchived(Boolean archived) | diff --git a/doc/models/list-product-price-points-response.md b/doc/models/list-product-price-points-response.md index b27a5943..9760c50a 100644 --- a/doc/models/list-product-price-points-response.md +++ b/doc/models/list-product-price-points-response.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `PricePoints` | [`List`](../../doc/models/product-price-point.md) | Required | - | List getPricePoints() | setPricePoints(List pricePoints) | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ListProductPricePointsResponse; +import com.maxio.advancedbilling.models.ProductPricePoint; +import java.util.Arrays; + +ListProductPricePointsResponse listProductPricePointsResponse = new ListProductPricePointsResponse.Builder( + Arrays.asList( + new ProductPricePoint.Builder() + .id(40) + .name("name2") + .handle("handle8") + .priceInCents(108L) + .interval(92) + .build() + ) +) +.build(); ``` diff --git a/doc/models/list-products-filter.md b/doc/models/list-products-filter.md index c9b3ab6e..066ce4c1 100644 --- a/doc/models/list-products-filter.md +++ b/doc/models/list-products-filter.md @@ -13,19 +13,24 @@ | `PrepaidProductPricePoint` | [`PrepaidProductPricePointFilter`](../../doc/models/prepaid-product-price-point-filter.md) | Optional | Allows fetching products only if a prepaid product price point is present or not. To use this filter you also have to include the following param in the request `include=prepaid_product_price_point`. Use in query `filter[prepaid_product_price_point][product_price_point_id]=not_null`. | PrepaidProductPricePointFilter getPrepaidProductPricePoint() | setPrepaidProductPricePoint(PrepaidProductPricePointFilter prepaidProductPricePoint) | | `UseSiteExchangeRate` | `Boolean` | Optional | Allows fetching products with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | -## Example (as JSON) - -```json -{ - "ids": [ - 1, - 2, - 3 - ], - "prepaid_product_price_point": { - "product_price_point_id": "product_price_point_id2" - }, - "use_site_exchange_rate": false -} +## Example + +```java +import com.maxio.advancedbilling.models.ListProductsFilter; +import com.maxio.advancedbilling.models.PrepaidProductPricePointFilter; +import java.util.Arrays; + +ListProductsFilter listProductsFilter = new ListProductsFilter.Builder() + .ids(Arrays.asList( + 1, + 2, + 3 + )) + .prepaidProductPricePoint(new PrepaidProductPricePointFilter.Builder( + "product_price_point_id2" + ) + .build()) + .useSiteExchangeRate(false) + .build(); ``` diff --git a/doc/models/list-products-for-product-family-input.md b/doc/models/list-products-for-product-family-input.md index 16148544..6ac8955e 100644 --- a/doc/models/list-products-for-product-family-input.md +++ b/doc/models/list-products-for-product-family-input.md @@ -20,7 +20,7 @@ Input structure for the method ListProductsForProductFamily | `EndDate` | `LocalDate` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | LocalDate getEndDate() | setEndDate(LocalDate endDate) | | `StartDatetime` | `ZonedDateTime` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | ZonedDateTime getStartDatetime() | setStartDatetime(ZonedDateTime startDatetime) | | `EndDatetime` | `ZonedDateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | ZonedDateTime getEndDatetime() | setEndDatetime(ZonedDateTime endDatetime) | -| `IncludeArchived` | `Boolean` | Optional | Include archived products | Boolean getIncludeArchived() | setIncludeArchived(Boolean includeArchived) | +| `IncludeArchived` | `Boolean` | Optional | Include archived products. | Boolean getIncludeArchived() | setIncludeArchived(Boolean includeArchived) | | `Include` | [`ListProductsInclude`](../../doc/models/list-products-include.md) | Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | ListProductsInclude getInclude() | setInclude(ListProductsInclude include) | ## Example diff --git a/doc/models/list-products-include.md b/doc/models/list-products-include.md index f2847330..f6400301 100644 --- a/doc/models/list-products-include.md +++ b/doc/models/list-products-include.md @@ -13,7 +13,9 @@ ## Example -``` -prepaid_product_price_point +```java +import com.maxio.advancedbilling.models.ListProductsInclude; + +ListProductsInclude listProductsInclude = ListProductsInclude.PREPAID_PRODUCT_PRICE_POINT; ``` diff --git a/doc/models/list-products-price-points-include.md b/doc/models/list-products-price-points-include.md index 99e40235..168711b5 100644 --- a/doc/models/list-products-price-points-include.md +++ b/doc/models/list-products-price-points-include.md @@ -13,7 +13,9 @@ ## Example -``` -currency_prices +```java +import com.maxio.advancedbilling.models.ListProductsPricePointsInclude; + +ListProductsPricePointsInclude listProductsPricePointsInclude = ListProductsPricePointsInclude.CURRENCY_PRICES; ``` diff --git a/doc/models/list-proforma-invoices-input.md b/doc/models/list-proforma-invoices-input.md index 3d7982a4..7cbdc440 100644 --- a/doc/models/list-proforma-invoices-input.md +++ b/doc/models/list-proforma-invoices-input.md @@ -18,12 +18,12 @@ Input structure for the method ListProformaInvoices | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | | `Direction` | [`Direction`](../../doc/models/direction.md) | Optional | The sort direction of the returned invoices.

**Default**: `Direction.DESC` | Direction getDirection() | setDirection(Direction direction) | -| `LineItems` | `Boolean` | Optional | Include line items data

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | -| `Discounts` | `Boolean` | Optional | Include discounts data

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | -| `Taxes` | `Boolean` | Optional | Include taxes data

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | -| `Credits` | `Boolean` | Optional | Include credits data

**Default**: `false` | Boolean getCredits() | setCredits(Boolean credits) | -| `Payments` | `Boolean` | Optional | Include payments data

**Default**: `false` | Boolean getPayments() | setPayments(Boolean payments) | -| `CustomFields` | `Boolean` | Optional | Include custom fields data

**Default**: `false` | Boolean getCustomFields() | setCustomFields(Boolean customFields) | +| `LineItems` | `Boolean` | Optional | Include line items data.

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | +| `Discounts` | `Boolean` | Optional | Include discounts data.

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | +| `Taxes` | `Boolean` | Optional | Include taxes data.

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | +| `Credits` | `Boolean` | Optional | Include credits data.

**Default**: `false` | Boolean getCredits() | setCredits(Boolean credits) | +| `Payments` | `Boolean` | Optional | Include payments data.

**Default**: `false` | Boolean getPayments() | setPayments(Boolean payments) | +| `CustomFields` | `Boolean` | Optional | Include custom fields data.

**Default**: `false` | Boolean getCustomFields() | setCustomFields(Boolean customFields) | ## Example diff --git a/doc/models/list-proforma-invoices-meta.md b/doc/models/list-proforma-invoices-meta.md index 69078d52..3336b691 100644 --- a/doc/models/list-proforma-invoices-meta.md +++ b/doc/models/list-proforma-invoices-meta.md @@ -14,14 +14,16 @@ | `TotalPages` | `Integer` | Optional | - | Integer getTotalPages() | setTotalPages(Integer totalPages) | | `StatusCode` | `Integer` | Optional | - | Integer getStatusCode() | setStatusCode(Integer statusCode) | -## Example (as JSON) - -```json -{ - "total_count": 226, - "current_page": 202, - "total_pages": 214, - "status_code": 244 -} +## Example + +```java +import com.maxio.advancedbilling.models.ListProformaInvoicesMeta; + +ListProformaInvoicesMeta listProformaInvoicesMeta = new ListProformaInvoicesMeta.Builder() + .totalCount(50) + .currentPage(26) + .totalPages(38) + .statusCode(68) + .build(); ``` diff --git a/doc/models/list-proforma-invoices-response.md b/doc/models/list-proforma-invoices-response.md index a0c469a6..be4e0d9c 100644 --- a/doc/models/list-proforma-invoices-response.md +++ b/doc/models/list-proforma-invoices-response.md @@ -12,39 +12,44 @@ | `ProformaInvoices` | [`List`](../../doc/models/proforma-invoice.md) | Optional | - | List getProformaInvoices() | setProformaInvoices(List proformaInvoices) | | `Meta` | [`ListProformaInvoicesMeta`](../../doc/models/list-proforma-invoices-meta.md) | Optional | - | ListProformaInvoicesMeta getMeta() | setMeta(ListProformaInvoicesMeta meta) | -## Example (as JSON) - -```json -{ - "proforma_invoices": [ - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - }, - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - }, - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - } - ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "status_code": 168 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ListProformaInvoicesMeta; +import com.maxio.advancedbilling.models.ListProformaInvoicesResponse; +import com.maxio.advancedbilling.models.ProformaInvoice; +import java.util.Arrays; + +ListProformaInvoicesResponse listProformaInvoicesResponse = new ListProformaInvoicesResponse.Builder() + .proformaInvoices(Arrays.asList( + new ProformaInvoice.Builder() + .uid("uid0") + .siteId(140) + .customerId(252) + .subscriptionId(68) + .number(56) + .build(), + new ProformaInvoice.Builder() + .uid("uid0") + .siteId(140) + .customerId(252) + .subscriptionId(68) + .number(56) + .build(), + new ProformaInvoice.Builder() + .uid("uid0") + .siteId(140) + .customerId(252) + .subscriptionId(68) + .number(56) + .build() + )) + .meta(new ListProformaInvoicesMeta.Builder() + .totalCount(150) + .currentPage(126) + .totalPages(138) + .statusCode(168) + .build()) + .build(); ``` diff --git a/doc/models/list-public-keys-meta.md b/doc/models/list-public-keys-meta.md index e617386f..38e5ba4c 100644 --- a/doc/models/list-public-keys-meta.md +++ b/doc/models/list-public-keys-meta.md @@ -14,14 +14,16 @@ | `TotalPages` | `Integer` | Optional | - | Integer getTotalPages() | setTotalPages(Integer totalPages) | | `PerPage` | `Integer` | Optional | - | Integer getPerPage() | setPerPage(Integer perPage) | -## Example (as JSON) - -```json -{ - "total_count": 22, - "current_page": 254, - "total_pages": 10, - "per_page": 24 -} +## Example + +```java +import com.maxio.advancedbilling.models.ListPublicKeysMeta; + +ListPublicKeysMeta listPublicKeysMeta = new ListPublicKeysMeta.Builder() + .totalCount(232) + .currentPage(208) + .totalPages(220) + .perPage(70) + .build(); ``` diff --git a/doc/models/list-public-keys-response.md b/doc/models/list-public-keys-response.md index a781438c..b717fe88 100644 --- a/doc/models/list-public-keys-response.md +++ b/doc/models/list-public-keys-response.md @@ -12,28 +12,29 @@ | `ChargifyJsKeys` | [`List`](../../doc/models/public-key.md) | Optional | - | List getChargifyJsKeys() | setChargifyJsKeys(List chargifyJsKeys) | | `Meta` | [`ListPublicKeysMeta`](../../doc/models/list-public-keys-meta.md) | Optional | - | ListPublicKeysMeta getMeta() | setMeta(ListPublicKeysMeta meta) | -## Example (as JSON) - -```json -{ - "chargify_js_keys": [ - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" - } - ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ListPublicKeysMeta; +import com.maxio.advancedbilling.models.ListPublicKeysResponse; +import com.maxio.advancedbilling.models.PublicKey; +import java.util.Arrays; + +ListPublicKeysResponse listPublicKeysResponse = new ListPublicKeysResponse.Builder() + .chargifyJsKeys(Arrays.asList( + new PublicKey.Builder() + .publicKey("public_key8") + .requiresSecurityToken(false) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() + )) + .meta(new ListPublicKeysMeta.Builder() + .totalCount(150) + .currentPage(126) + .totalPages(138) + .perPage(152) + .build()) + .build(); ``` diff --git a/doc/models/list-sale-rep-item.md b/doc/models/list-sale-rep-item.md index b80f0a34..ae722aec 100644 --- a/doc/models/list-sale-rep-item.md +++ b/doc/models/list-sale-rep-item.md @@ -15,31 +15,35 @@ | `MrrData` | [`Map`](../../doc/models/sale-rep-item-mrr.md) | Optional | - | Map getMrrData() | setMrrData(Map mrrData) | | `TestMode` | `Boolean` | Optional | - | Boolean getTestMode() | setTestMode(Boolean testMode) | -## Example (as JSON) - -```json -{ - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "january_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - } - }, - "id": 26, - "full_name": "full_name8", - "subscriptions_count": 154, - "test_mode": false -} +## Example + +```java +import com.maxio.advancedbilling.models.ListSaleRepItem; +import com.maxio.advancedbilling.models.SaleRepItemMrr; +import java.util.LinkedHashMap; + +ListSaleRepItem listSaleRepItem = new ListSaleRepItem.Builder() + .id(54) + .fullName("full_name2") + .subscriptionsCount(126) + .mrrData(new LinkedHashMap() {{ + put("november_2019", new SaleRepItemMrr.Builder() + .mrr("$0.00") + .usage("$0.00") + .recurring("$0.00") + .build()); + put("december_2019", new SaleRepItemMrr.Builder() + .mrr("$0.00") + .usage("$0.00") + .recurring("$0.00") + .build()); + put("january_2020", new SaleRepItemMrr.Builder() + .mrr("$400.00") + .usage("$0.00") + .recurring("$400.00") + .build()); + }}) + .testMode(false) + .build(); ``` diff --git a/doc/models/list-segments-filter.md b/doc/models/list-segments-filter.md index 6a211bf9..0b589496 100644 --- a/doc/models/list-segments-filter.md +++ b/doc/models/list-segments-filter.md @@ -14,14 +14,16 @@ | `SegmentProperty3Value` | `String` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_3` on attached Metric. If empty string is passed, this filter would be rejected. | String getSegmentProperty3Value() | setSegmentProperty3Value(String segmentProperty3Value) | | `SegmentProperty4Value` | `String` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_4` on attached Metric. If empty string is passed, this filter would be rejected. | String getSegmentProperty4Value() | setSegmentProperty4Value(String segmentProperty4Value) | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "EU", - "segment_property_2_value": "segment_property_2_value4", - "segment_property_3_value": "segment_property_3_value2", - "segment_property_4_value": "segment_property_4_value6" -} +## Example + +```java +import com.maxio.advancedbilling.models.ListSegmentsFilter; + +ListSegmentsFilter listSegmentsFilter = new ListSegmentsFilter.Builder() + .segmentProperty1Value("EU") + .segmentProperty2Value("segment_property_2_value6") + .segmentProperty3Value("segment_property_3_value6") + .segmentProperty4Value("segment_property_4_value8") + .build(); ``` diff --git a/doc/models/list-segments-response.md b/doc/models/list-segments-response.md index 83e0886f..f6922b0b 100644 --- a/doc/models/list-segments-response.md +++ b/doc/models/list-segments-response.md @@ -11,19 +11,31 @@ | --- | --- | --- | --- | --- | --- | | `Segments` | [`List`](../../doc/models/segment.md) | Optional | - | List getSegments() | setSegments(List segments) | -## Example (as JSON) - -```json -{ - "segments": [ - { - "id": 50, - "component_id": 160, - "price_point_id": 184, - "event_based_billing_metric_id": 244, - "pricing_scheme": "stairstep" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ListSegmentsResponse; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.Segment; +import java.util.Arrays; + +ListSegmentsResponse listSegmentsResponse = new ListSegmentsResponse.Builder() + .segments(Arrays.asList( + new Segment.Builder() + .id(50) + .componentId(160) + .pricePointId(184) + .eventBasedBillingMetricId(244) + .pricingScheme(PricingScheme.STAIRSTEP) + .build(), + new Segment.Builder() + .id(50) + .componentId(160) + .pricePointId(184) + .eventBasedBillingMetricId(244) + .pricingScheme(PricingScheme.STAIRSTEP) + .build() + )) + .build(); ``` diff --git a/doc/models/list-service-credits-response.md b/doc/models/list-service-credits-response.md index e82e6edb..0a359452 100644 --- a/doc/models/list-service-credits-response.md +++ b/doc/models/list-service-credits-response.md @@ -11,26 +11,38 @@ | --- | --- | --- | --- | --- | --- | | `ServiceCredits` | [`List`](../../doc/models/service-credit-1.md) | Optional | - | List getServiceCredits() | setServiceCredits(List serviceCredits) | -## Example (as JSON) - -```json -{ - "service_credits": [ - { - "id": 224, - "amount_in_cents": 54, - "ending_balance_in_cents": 94, - "entry_type": "Credit", - "memo": "memo2" - }, - { - "id": 224, - "amount_in_cents": 54, - "ending_balance_in_cents": 94, - "entry_type": "Credit", - "memo": "memo2" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ListServiceCreditsResponse; +import com.maxio.advancedbilling.models.ServiceCredit1; +import com.maxio.advancedbilling.models.ServiceCreditType; +import java.util.Arrays; + +ListServiceCreditsResponse listServiceCreditsResponse = new ListServiceCreditsResponse.Builder() + .serviceCredits(Arrays.asList( + new ServiceCredit1.Builder() + .id(224) + .amountInCents(54L) + .endingBalanceInCents(94L) + .entryType(ServiceCreditType.CREDIT) + .memo("memo2") + .build(), + new ServiceCredit1.Builder() + .id(224) + .amountInCents(54L) + .endingBalanceInCents(94L) + .entryType(ServiceCreditType.CREDIT) + .memo("memo2") + .build(), + new ServiceCredit1.Builder() + .id(224) + .amountInCents(54L) + .endingBalanceInCents(94L) + .entryType(ServiceCreditType.CREDIT) + .memo("memo2") + .build() + )) + .build(); ``` diff --git a/doc/models/list-subscription-components-filter.md b/doc/models/list-subscription-components-filter.md index b3d58c77..2b42ebaa 100644 --- a/doc/models/list-subscription-components-filter.md +++ b/doc/models/list-subscription-components-filter.md @@ -12,15 +12,18 @@ | `Currencies` | `List` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`.

**Constraints**: *Minimum Items*: `1` | List getCurrencies() | setCurrencies(List currencies) | | `UseSiteExchangeRate` | `Boolean` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | -## Example (as JSON) - -```json -{ - "currencies": [ - "EUR", - "USD" - ], - "use_site_exchange_rate": false -} +## Example + +```java +import com.maxio.advancedbilling.models.ListSubscriptionComponentsFilter; +import java.util.Arrays; + +ListSubscriptionComponentsFilter listSubscriptionComponentsFilter = new ListSubscriptionComponentsFilter.Builder() + .currencies(Arrays.asList( + "EUR", + "USD" + )) + .useSiteExchangeRate(false) + .build(); ``` diff --git a/doc/models/list-subscription-components-for-site-filter.md b/doc/models/list-subscription-components-for-site-filter.md index 8217d0fd..e805d1d7 100644 --- a/doc/models/list-subscription-components-for-site-filter.md +++ b/doc/models/list-subscription-components-for-site-filter.md @@ -13,26 +13,33 @@ | `UseSiteExchangeRate` | `Boolean` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `Subscription` | [`SubscriptionFilter`](../../doc/models/subscription-filter.md) | Optional | Nested filter used for List Subscription Components For Site Filter | SubscriptionFilter getSubscription() | setSubscription(SubscriptionFilter subscription) | -## Example (as JSON) - -```json -{ - "currencies": [ - "EUR", - "USD" - ], - "use_site_exchange_rate": false, - "subscription": { - "states": [ - "active", - "canceled", - "expired" - ], - "date_field": "updated_at", - "start_date": "2016-03-13", - "end_date": "2016-03-13", - "start_datetime": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ListSubscriptionComponentsForSiteFilter; +import com.maxio.advancedbilling.models.SubscriptionFilter; +import com.maxio.advancedbilling.models.SubscriptionListDateField; +import com.maxio.advancedbilling.models.SubscriptionStateFilter; +import java.util.Arrays; + +ListSubscriptionComponentsForSiteFilter listSubscriptionComponentsForSiteFilter = new ListSubscriptionComponentsForSiteFilter.Builder() + .currencies(Arrays.asList( + "EUR", + "USD" + )) + .useSiteExchangeRate(false) + .subscription(new SubscriptionFilter.Builder() + .states(Arrays.asList( + SubscriptionStateFilter.TRIALING, + SubscriptionStateFilter.UNPAID, + SubscriptionStateFilter.ACTIVE + )) + .dateField(SubscriptionListDateField.UPDATED_AT) + .startDate(DateTimeHelper.fromSimpleDate("2016-03-13")) + .endDate(DateTimeHelper.fromSimpleDate("2016-03-13")) + .startDatetime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build()) + .build(); ``` diff --git a/doc/models/list-subscription-components-for-site-input.md b/doc/models/list-subscription-components-for-site-input.md index f00f315b..36e6f0ee 100644 --- a/doc/models/list-subscription-components-for-site-input.md +++ b/doc/models/list-subscription-components-for-site-input.md @@ -54,9 +54,9 @@ ListSubscriptionComponentsForSiteInput listSubscriptionComponentsForSiteInput = .useSiteExchangeRate(false) .subscription(new SubscriptionFilter.Builder() .states(Arrays.asList( - SubscriptionStateFilter.ACTIVE, - SubscriptionStateFilter.CANCELED, - SubscriptionStateFilter.EXPIRED + SubscriptionStateFilter.TRIALING, + SubscriptionStateFilter.UNPAID, + SubscriptionStateFilter.ACTIVE )) .dateField(SubscriptionListDateField.UPDATED_AT) .startDate(DateTimeHelper.fromSimpleDate("2016-03-13")) diff --git a/doc/models/list-subscription-components-include.md b/doc/models/list-subscription-components-include.md index 4bb14dd1..f4a7b366 100644 --- a/doc/models/list-subscription-components-include.md +++ b/doc/models/list-subscription-components-include.md @@ -14,7 +14,9 @@ ## Example -``` -subscription +```java +import com.maxio.advancedbilling.models.ListSubscriptionComponentsInclude; + +ListSubscriptionComponentsInclude listSubscriptionComponentsInclude = ListSubscriptionComponentsInclude.SUBSCRIPTION; ``` diff --git a/doc/models/list-subscription-components-response.md b/doc/models/list-subscription-components-response.md index 541b2053..334218f0 100644 --- a/doc/models/list-subscription-components-response.md +++ b/doc/models/list-subscription-components-response.md @@ -11,19 +11,25 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionsComponents` | [`List`](../../doc/models/subscription-component.md) | Required | - | List getSubscriptionsComponents() | setSubscriptionsComponents(List subscriptionsComponents) | -## Example (as JSON) - -```json -{ - "subscriptions_components": [ - { - "id": 138, - "name": "name2", - "kind": "metered_component", - "unit_name": "unit_name4", - "enabled": false - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentKind; +import com.maxio.advancedbilling.models.ListSubscriptionComponentsResponse; +import com.maxio.advancedbilling.models.SubscriptionComponent; +import java.util.Arrays; + +ListSubscriptionComponentsResponse listSubscriptionComponentsResponse = new ListSubscriptionComponentsResponse.Builder( + Arrays.asList( + new SubscriptionComponent.Builder() + .id(138) + .name("name2") + .kind(ComponentKind.METERED_COMPONENT) + .unitName("unit_name4") + .enabled(false) + .build() + ) +) +.build(); ``` diff --git a/doc/models/list-subscription-components-sort.md b/doc/models/list-subscription-components-sort.md index 03af5d15..29991a72 100644 --- a/doc/models/list-subscription-components-sort.md +++ b/doc/models/list-subscription-components-sort.md @@ -14,7 +14,9 @@ ## Example -``` -updated_at +```java +import com.maxio.advancedbilling.models.ListSubscriptionComponentsSort; + +ListSubscriptionComponentsSort listSubscriptionComponentsSort = ListSubscriptionComponentsSort.ID; ``` diff --git a/doc/models/list-subscription-events-input.md b/doc/models/list-subscription-events-input.md index 2a269dff..1e3c5f93 100644 --- a/doc/models/list-subscription-events-input.md +++ b/doc/models/list-subscription-events-input.md @@ -14,8 +14,8 @@ Input structure for the method ListSubscriptionEvents | `SubscriptionId` | `int` | Required | The Chargify id of the subscription. | int getSubscriptionId() | setSubscriptionId(int subscriptionId) | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | -| `SinceId` | `Long` | Optional | Returns events with an id greater than or equal to the one specified | Long getSinceId() | setSinceId(Long sinceId) | -| `MaxId` | `Long` | Optional | Returns events with an id less than or equal to the one specified | Long getMaxId() | setMaxId(Long maxId) | +| `SinceId` | `Long` | Optional | Returns events with an id greater than or equal to the one specified. | Long getSinceId() | setSinceId(Long sinceId) | +| `MaxId` | `Long` | Optional | Returns events with an id less than or equal to the one specified. | Long getMaxId() | setMaxId(Long maxId) | | `Direction` | [`Direction`](../../doc/models/direction.md) | Optional | The sort direction of the returned events.

**Default**: `Direction.DESC` | Direction getDirection() | setDirection(Direction direction) | | `Filter` | [`List`](../../doc/models/event-key.md) | Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | List getFilter() | setFilter(List filter) | diff --git a/doc/models/list-subcription-group-prepayment-item.md b/doc/models/list-subscription-group-prepayment-item.md similarity index 71% rename from doc/models/list-subcription-group-prepayment-item.md rename to doc/models/list-subscription-group-prepayment-item.md index 8026bd72..ba05f445 100644 --- a/doc/models/list-subcription-group-prepayment-item.md +++ b/doc/models/list-subscription-group-prepayment-item.md @@ -1,9 +1,9 @@ -# List Subcription Group Prepayment Item +# List Subscription Group Prepayment Item ## Structure -`ListSubcriptionGroupPrepaymentItem` +`ListSubscriptionGroupPrepaymentItem` ## Fields @@ -19,15 +19,17 @@ | `PaymentType` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | - | PrepaymentMethod getPaymentType() | setPaymentType(PrepaymentMethod paymentType) | | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | -## Example (as JSON) +## Example -```json -{ - "id": 254, - "subscription_group_uid": "subscription_group_uid6", - "amount_in_cents": 172, - "remaining_amount_in_cents": 142, - "details": "details2" -} +```java +import com.maxio.advancedbilling.models.ListSubscriptionGroupPrepaymentItem; + +ListSubscriptionGroupPrepaymentItem listSubscriptionGroupPrepaymentItem = new ListSubscriptionGroupPrepaymentItem.Builder() + .id(72) + .subscriptionGroupUid("subscription_group_uid6") + .amountInCents(98L) + .remainingAmountInCents(216L) + .details("details2") + .build(); ``` diff --git a/doc/models/list-subscription-group-prepayment-response.md b/doc/models/list-subscription-group-prepayment-response.md index 2c4c337d..0d0603c0 100644 --- a/doc/models/list-subscription-group-prepayment-response.md +++ b/doc/models/list-subscription-group-prepayment-response.md @@ -11,21 +11,28 @@ | --- | --- | --- | --- | --- | --- | | `Prepayments` | [`List`](../../doc/models/list-subscription-group-prepayment.md) | Required | - | List getPrepayments() | setPrepayments(List prepayments) | -## Example (as JSON) - -```json -{ - "prepayments": [ - { - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ListSubscriptionGroupPrepayment; +import com.maxio.advancedbilling.models.ListSubscriptionGroupPrepaymentItem; +import com.maxio.advancedbilling.models.ListSubscriptionGroupPrepaymentResponse; +import java.util.Arrays; + +ListSubscriptionGroupPrepaymentResponse listSubscriptionGroupPrepaymentResponse = new ListSubscriptionGroupPrepaymentResponse.Builder( + Arrays.asList( + new ListSubscriptionGroupPrepayment.Builder( + new ListSubscriptionGroupPrepaymentItem.Builder() + .id(38) + .subscriptionGroupUid("subscription_group_uid2") + .amountInCents(124L) + .remainingAmountInCents(182L) + .details("details8") + .build() + ) + .build() + ) +) +.build(); ``` diff --git a/doc/models/list-subscription-group-prepayment.md b/doc/models/list-subscription-group-prepayment.md index dd640c1a..3b62e4b3 100644 --- a/doc/models/list-subscription-group-prepayment.md +++ b/doc/models/list-subscription-group-prepayment.md @@ -9,19 +9,23 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Prepayment` | [`ListSubcriptionGroupPrepaymentItem`](../../doc/models/list-subcription-group-prepayment-item.md) | Required | - | ListSubcriptionGroupPrepaymentItem getPrepayment() | setPrepayment(ListSubcriptionGroupPrepaymentItem prepayment) | - -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } -} +| `Prepayment` | [`ListSubscriptionGroupPrepaymentItem`](../../doc/models/list-subscription-group-prepayment-item.md) | Required | - | ListSubscriptionGroupPrepaymentItem getPrepayment() | setPrepayment(ListSubscriptionGroupPrepaymentItem prepayment) | + +## Example + +```java +import com.maxio.advancedbilling.models.ListSubscriptionGroupPrepayment; +import com.maxio.advancedbilling.models.ListSubscriptionGroupPrepaymentItem; + +ListSubscriptionGroupPrepayment listSubscriptionGroupPrepayment = new ListSubscriptionGroupPrepayment.Builder( + new ListSubscriptionGroupPrepaymentItem.Builder() + .id(38) + .subscriptionGroupUid("subscription_group_uid2") + .amountInCents(124L) + .remainingAmountInCents(182L) + .details("details8") + .build() +) +.build(); ``` diff --git a/doc/models/list-subscription-group-proforma-invoices-input.md b/doc/models/list-subscription-group-proforma-invoices-input.md index bd4e1b58..cda41d1f 100644 --- a/doc/models/list-subscription-group-proforma-invoices-input.md +++ b/doc/models/list-subscription-group-proforma-invoices-input.md @@ -12,12 +12,12 @@ Input structure for the method ListSubscriptionGroupProformaInvoices | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Uid` | `String` | Required | The uid of the subscription group | String getUid() | setUid(String uid) | -| `LineItems` | `Boolean` | Optional | Include line items data

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | -| `Discounts` | `Boolean` | Optional | Include discounts data

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | -| `Taxes` | `Boolean` | Optional | Include taxes data

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | -| `Credits` | `Boolean` | Optional | Include credits data

**Default**: `false` | Boolean getCredits() | setCredits(Boolean credits) | -| `Payments` | `Boolean` | Optional | Include payments data

**Default**: `false` | Boolean getPayments() | setPayments(Boolean payments) | -| `CustomFields` | `Boolean` | Optional | Include custom fields data

**Default**: `false` | Boolean getCustomFields() | setCustomFields(Boolean customFields) | +| `LineItems` | `Boolean` | Optional | Include line items data.

**Default**: `false` | Boolean getLineItems() | setLineItems(Boolean lineItems) | +| `Discounts` | `Boolean` | Optional | Include discounts data.

**Default**: `false` | Boolean getDiscounts() | setDiscounts(Boolean discounts) | +| `Taxes` | `Boolean` | Optional | Include taxes data.

**Default**: `false` | Boolean getTaxes() | setTaxes(Boolean taxes) | +| `Credits` | `Boolean` | Optional | Include credits data.

**Default**: `false` | Boolean getCredits() | setCredits(Boolean credits) | +| `Payments` | `Boolean` | Optional | Include payments data.

**Default**: `false` | Boolean getPayments() | setPayments(Boolean payments) | +| `CustomFields` | `Boolean` | Optional | Include custom fields data.

**Default**: `false` | Boolean getCustomFields() | setCustomFields(Boolean customFields) | ## Example diff --git a/doc/models/list-subscription-groups-item.md b/doc/models/list-subscription-groups-item.md index a30128e9..22f08901 100644 --- a/doc/models/list-subscription-groups-item.md +++ b/doc/models/list-subscription-groups-item.md @@ -21,17 +21,21 @@ | `AccountBalances` | [`SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | SubscriptionGroupBalances getAccountBalances() | setAccountBalances(SubscriptionGroupBalances accountBalances) | | `GroupType` | [`GroupType`](../../doc/models/group-type.md) | Optional | - | GroupType getGroupType() | setGroupType(GroupType groupType) | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "scheme": 124, - "customer_id": 144, - "payment_profile_id": 52, - "subscription_ids": [ - 254 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ListSubscriptionGroupsItem; +import java.util.Arrays; + +ListSubscriptionGroupsItem listSubscriptionGroupsItem = new ListSubscriptionGroupsItem.Builder() + .uid("uid0") + .scheme(228) + .customerId(248) + .paymentProfileId(100) + .subscriptionIds(Arrays.asList( + 102, + 103 + )) + .build(); ``` diff --git a/doc/models/list-subscription-groups-meta.md b/doc/models/list-subscription-groups-meta.md index 256771be..c7fdf700 100644 --- a/doc/models/list-subscription-groups-meta.md +++ b/doc/models/list-subscription-groups-meta.md @@ -12,12 +12,14 @@ | `CurrentPage` | `Integer` | Optional | - | Integer getCurrentPage() | setCurrentPage(Integer currentPage) | | `TotalCount` | `Integer` | Optional | - | Integer getTotalCount() | setTotalCount(Integer totalCount) | -## Example (as JSON) +## Example -```json -{ - "current_page": 14, - "total_count": 38 -} +```java +import com.maxio.advancedbilling.models.ListSubscriptionGroupsMeta; + +ListSubscriptionGroupsMeta listSubscriptionGroupsMeta = new ListSubscriptionGroupsMeta.Builder() + .currentPage(104) + .totalCount(128) + .build(); ``` diff --git a/doc/models/list-subscription-groups-response.md b/doc/models/list-subscription-groups-response.md index d8fccba6..77ac70f8 100644 --- a/doc/models/list-subscription-groups-response.md +++ b/doc/models/list-subscription-groups-response.md @@ -12,43 +12,30 @@ | `SubscriptionGroups` | [`List`](../../doc/models/list-subscription-groups-item.md) | Optional | - | List getSubscriptionGroups() | setSubscriptionGroups(List subscriptionGroups) | | `Meta` | [`ListSubscriptionGroupsMeta`](../../doc/models/list-subscription-groups-meta.md) | Optional | - | ListSubscriptionGroupsMeta getMeta() | setMeta(ListSubscriptionGroupsMeta meta) | -## Example (as JSON) - -```json -{ - "subscription_groups": [ - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ - 40 - ] - }, - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ - 40 - ] - }, - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ - 40 - ] - } - ], - "meta": { - "current_page": 126, - "total_count": 150 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ListSubscriptionGroupsItem; +import com.maxio.advancedbilling.models.ListSubscriptionGroupsMeta; +import com.maxio.advancedbilling.models.ListSubscriptionGroupsResponse; +import java.util.Arrays; + +ListSubscriptionGroupsResponse listSubscriptionGroupsResponse = new ListSubscriptionGroupsResponse.Builder() + .subscriptionGroups(Arrays.asList( + new ListSubscriptionGroupsItem.Builder() + .uid("uid2") + .scheme(166) + .customerId(186) + .paymentProfileId(162) + .subscriptionIds(Arrays.asList( + 40 + )) + .build() + )) + .meta(new ListSubscriptionGroupsMeta.Builder() + .currentPage(126) + .totalCount(150) + .build()) + .build(); ``` diff --git a/doc/models/list-subscriptions-input.md b/doc/models/list-subscriptions-input.md index ed7e697a..ce0d9ac1 100644 --- a/doc/models/list-subscriptions-input.md +++ b/doc/models/list-subscriptions-input.md @@ -13,54 +13,78 @@ Input structure for the method ListSubscriptions | --- | --- | --- | --- | --- | --- | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | +| `Sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Optional | The attribute by which to sort

**Default**: `SubscriptionSort.SIGNUP_DATE` | SubscriptionSort getSort() | setSort(SubscriptionSort sort) | +| `Direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | SortingDirection getDirection() | setDirection(SortingDirection direction) | | `State` | [`SubscriptionStateFilter`](../../doc/models/subscription-state-filter.md) | Optional | The current state of the subscription | SubscriptionStateFilter getState() | setState(SubscriptionStateFilter state) | -| `Product` | `Integer` | Optional | The product id of the subscription. (Note that the product handle cannot be used.) | Integer getProduct() | setProduct(Integer product) | -| `ProductPricePointId` | `Integer` | Optional | The ID of the product price point. If supplied, product is required | Integer getProductPricePointId() | setProductPricePointId(Integer productPricePointId) | +| `Product` | [`ListSubscriptionsInputProduct`](../../doc/models/containers/list-subscriptions-input-product.md) | Optional | This is a container for one-of cases. | ListSubscriptionsInputProduct getProduct() | setProduct(ListSubscriptionsInputProduct product) | +| `Q` | `String` | Optional | Search string. | String getQ() | setQ(String q) | +| `QScope` | [`QScope`](../../doc/models/q-scope.md) | Optional | Scope of fields used by the q search. | QScope getQScope() | setQScope(QScope qScope) | +| `CustomerId` | `Integer` | Optional | The Advanced Billing id of the customer. | Integer getCustomerId() | setCustomerId(Integer customerId) | +| `ProductPricePointId` | `Integer` | Optional | The ID of the product price point. If supplied, product is required. | Integer getProductPricePointId() | setProductPricePointId(Integer productPricePointId) | | `Coupon` | `Integer` | Optional | The numeric id of the coupon currently applied to the subscription. (This can be found in the URL when editing a coupon. Note that the coupon code cannot be used.) | Integer getCoupon() | setCoupon(Integer coupon) | | `CouponCode` | `String` | Optional | The coupon code currently applied to the subscription | String getCouponCode() | setCouponCode(String couponCode) | +| `CollectionMethod` | [`CollectionMethod1`](../../doc/models/collection-method-1.md) | Optional | The collection method for the subscription. | CollectionMethod1 getCollectionMethod() | setCollectionMethod(CollectionMethod1 collectionMethod) | +| `BrandingThemeId` | `Integer` | Optional | Filter subscriptions by the ID of an assigned Branding Theme. Branding Themes is a beta feature. See [Understand Branding Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand-Branding-Themes#understand-branding-themes-0-0) for more information. | Integer getBrandingThemeId() | setBrandingThemeId(Integer brandingThemeId) | | `DateField` | [`SubscriptionDateField`](../../doc/models/subscription-date-field.md) | Optional | The type of filter you'd like to apply to your search. Allowed Values: , current_period_ends_at, current_period_starts_at, created_at, activated_at, canceled_at, expires_at, trial_started_at, trial_ended_at, updated_at | SubscriptionDateField getDateField() | setDateField(SubscriptionDateField dateField) | | `StartDate` | `LocalDate` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `start_date=2022-07-01`. | LocalDate getStartDate() | setStartDate(LocalDate startDate) | | `EndDate` | `LocalDate` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2022-08-01`. | LocalDate getEndDate() | setEndDate(LocalDate endDate) | | `StartDatetime` | `ZonedDateTime` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | ZonedDateTime getStartDatetime() | setStartDatetime(ZonedDateTime startDatetime) | | `EndDatetime` | `ZonedDateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. | ZonedDateTime getEndDatetime() | setEndDatetime(ZonedDateTime endDatetime) | | `Metadata` | `Map` | Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | Map getMetadata() | setMetadata(Map metadata) | -| `Direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | SortingDirection getDirection() | setDirection(SortingDirection direction) | -| `Sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Optional | The attribute by which to sort

**Default**: `SubscriptionSort.SIGNUP_DATE` | SubscriptionSort getSort() | setSort(SubscriptionSort sort) | +| `GroupStatus` | [`GroupStatus`](../../doc/models/group-status.md) | Optional | Filter by whether a subscription is in a group. | GroupStatus getGroupStatus() | setGroupStatus(GroupStatus groupStatus) | +| `DunningExemption` | `Boolean` | Optional | Filter by dunning exemption status. | Boolean getDunningExemption() | setDunningExemption(Boolean dunningExemption) | +| `PaymentGateways` | `String` | Optional | Comma-separated payment gateway identifiers. | String getPaymentGateways() | setPaymentGateways(String paymentGateways) | +| `Currencies` | `String` | Optional | Comma-separated currency codes. | String getCurrencies() | setCurrencies(String currencies) | | `Include` | [`List`](../../doc/models/subscription-list-include.md) | Optional | Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. | List getInclude() | setInclude(List include) | ## Example ```java import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CollectionMethod1; +import com.maxio.advancedbilling.models.GroupStatus; import com.maxio.advancedbilling.models.ListSubscriptionsInput; +import com.maxio.advancedbilling.models.QScope; import com.maxio.advancedbilling.models.SortingDirection; import com.maxio.advancedbilling.models.SubscriptionDateField; import com.maxio.advancedbilling.models.SubscriptionListInclude; import com.maxio.advancedbilling.models.SubscriptionSort; import com.maxio.advancedbilling.models.SubscriptionStateFilter; +import com.maxio.advancedbilling.models.containers.ListSubscriptionsInputProduct; import java.util.Arrays; import java.util.LinkedHashMap; ListSubscriptionsInput listSubscriptionsInput = new ListSubscriptionsInput.Builder() .page(1) .perPage(50) - .state(SubscriptionStateFilter.SUSPENDED) - .product(22) + .sort(SubscriptionSort.SIGNUP_DATE) + .direction(SortingDirection.ASC) + .state(SubscriptionStateFilter.PREPAID_DUNNING) + .product(ListSubscriptionsInputProduct.fromNumber( + 200 + )) + .q("q0") + .qScope(QScope.LAST_NAME) + .customerId(150) .productPricePointId(234) .coupon(84) .couponCode("coupon_code4") + .collectionMethod(CollectionMethod1.AUTOMATIC) + .brandingThemeId(76) .dateField(SubscriptionDateField.TRIAL_STARTED_AT) - .startDate(DateTimeHelper.fromSimpleDate("2022-07-01")) - .endDate(DateTimeHelper.fromSimpleDate("2022-08-01")) - .startDatetime(DateTimeHelper.fromRfc8601DateTime("2022-07-01 09:00:05")) - .endDatetime(DateTimeHelper.fromRfc8601DateTime("2022-08-01 10:00:05")) + .startDate(DateTimeHelper.fromSimpleDate("2016-03-13")) + .endDate(DateTimeHelper.fromSimpleDate("2016-03-13")) + .startDatetime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endDatetime(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) .metadata(new LinkedHashMap() {{ put("key0", "metadata3"); put("key1", "metadata4"); put("key2", "metadata5"); }}) - .direction(SortingDirection.ASC) - .sort(SubscriptionSort.SIGNUP_DATE) + .groupStatus(GroupStatus.UNGROUPED) + .dunningExemption(false) + .paymentGateways("payment_gateways2") + .currencies("currencies6") .include(Arrays.asList( SubscriptionListInclude.SELF_SERVICE_PAGE_TOKEN )) diff --git a/doc/models/list-usages-input.md b/doc/models/list-usages-input.md index d1a5747f..c2170c11 100644 --- a/doc/models/list-usages-input.md +++ b/doc/models/list-usages-input.md @@ -13,8 +13,8 @@ Input structure for the method ListUsages | --- | --- | --- | --- | --- | --- | | `SubscriptionIdOrReference` | [`ListUsagesInputSubscriptionIdOrReference`](../../doc/models/containers/list-usages-input-subscription-id-or-reference.md) | Required | This is a container for one-of cases. | ListUsagesInputSubscriptionIdOrReference getSubscriptionIdOrReference() | setSubscriptionIdOrReference(ListUsagesInputSubscriptionIdOrReference subscriptionIdOrReference) | | `ComponentId` | [`ListUsagesInputComponentId`](../../doc/models/containers/list-usages-input-component-id.md) | Required | This is a container for one-of cases. | ListUsagesInputComponentId getComponentId() | setComponentId(ListUsagesInputComponentId componentId) | -| `SinceId` | `Long` | Optional | Returns usages with an id greater than or equal to the one specified | Long getSinceId() | setSinceId(Long sinceId) | -| `MaxId` | `Long` | Optional | Returns usages with an id less than or equal to the one specified | Long getMaxId() | setMaxId(Long maxId) | +| `SinceId` | `Long` | Optional | Returns usages with an id greater than or equal to the one specified. | Long getSinceId() | setSinceId(Long sinceId) | +| `MaxId` | `Long` | Optional | Returns usages with an id less than or equal to the one specified. | Long getMaxId() | setMaxId(Long maxId) | | `SinceDate` | `LocalDate` | Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | LocalDate getSinceDate() | setSinceDate(LocalDate sinceDate) | | `UntilDate` | `LocalDate` | Optional | Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified. | LocalDate getUntilDate() | setUntilDate(LocalDate untilDate) | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | diff --git a/doc/models/metadata.md b/doc/models/metadata.md index 89389942..52c71f66 100644 --- a/doc/models/metadata.md +++ b/doc/models/metadata.md @@ -16,15 +16,18 @@ | `DeletedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getDeletedAt() | setDeletedAt(ZonedDateTime deletedAt) | | `MetafieldId` | `Integer` | Optional | - | Integer getMetafieldId() | setMetafieldId(Integer metafieldId) | -## Example (as JSON) - -```json -{ - "id": 12, - "value": "value0", - "resource_id": 96, - "name": "name8", - "deleted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Metadata; + +Metadata metadata = new Metadata.Builder() + .id(50) + .value("value8") + .resourceId(134) + .name("name6") + .deletedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/metafield-input.md b/doc/models/metafield-input.md index 75443bd3..e142f4cb 100644 --- a/doc/models/metafield-input.md +++ b/doc/models/metafield-input.md @@ -1,7 +1,7 @@ # Metafield Input -Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. +Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. ## Enumeration @@ -16,3 +16,11 @@ Indicates the type of metafield. A text metafield allows any string value. Dropd | `RADIO` | | `DROPDOWN` | +## Example + +```java +import com.maxio.advancedbilling.models.MetafieldInput; + +MetafieldInput metafieldInput = MetafieldInput.BALANCE_TRACKER; +``` + diff --git a/doc/models/metafield-scope.md b/doc/models/metafield-scope.md index 8c6472fb..917ed404 100644 --- a/doc/models/metafield-scope.md +++ b/doc/models/metafield-scope.md @@ -19,15 +19,18 @@ Warning: When updating a metafield's scope attribute, all scope attributes must | `PublicEdit` | [`IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields used in [Embeddable Components](page:development-tools/embeddable-components/overview) from being editable by your ecosystem. | IncludeOption getPublicEdit() | setPublicEdit(IncludeOption publicEdit) | | `Hosted` | `List` | Optional | - | List getHosted() | setHosted(List hosted) | -## Example (as JSON) - -```json -{ - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" -} +## Example + +```java +import com.maxio.advancedbilling.models.IncludeOption; +import com.maxio.advancedbilling.models.MetafieldScope; + +MetafieldScope metafieldScope = new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .build(); ``` diff --git a/doc/models/metafield.md b/doc/models/metafield.md index 07fb4f3f..ffde5404 100644 --- a/doc/models/metafield.md +++ b/doc/models/metafield.md @@ -13,24 +13,29 @@ | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | MetafieldScope getScope() | setScope(MetafieldScope scope) | | `DataCount` | `Integer` | Optional | The amount of subscriptions this metafield has been applied to in Advanced Billing. | Integer getDataCount() | setDataCount(Integer dataCount) | -| `InputType` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | MetafieldInput getInputType() | setInputType(MetafieldInput inputType) | +| `InputType` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | MetafieldInput getInputType() | setInputType(MetafieldInput inputType) | | `Enum` | [`MetafieldEnum`](../../doc/models/containers/metafield-enum.md) | Optional | This is a container for one-of cases. | MetafieldEnum getEnum() | setEnum(MetafieldEnum mEnum) | -## Example (as JSON) - -```json -{ - "id": 52, - "name": "name8", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "data_count": 216, - "input_type": "radio" -} +## Example + +```java +import com.maxio.advancedbilling.models.IncludeOption; +import com.maxio.advancedbilling.models.Metafield; +import com.maxio.advancedbilling.models.MetafieldInput; +import com.maxio.advancedbilling.models.MetafieldScope; + +Metafield metafield = new Metafield.Builder() + .id(242) + .name("name4") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .build()) + .dataCount(26) + .inputType(MetafieldInput.BALANCE_TRACKER) + .build(); ``` diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index 6ee6178a..0d4a7fe4 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | String getName() | setName(String name) | -| `UnitName` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | String getUnitName() | setUnitName(String unitName) | +| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | String getName() | setName(String name) | +| `UnitName` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item | String getUnitName() | setUnitName(String unitName) | | `Description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | String getDescription() | setDescription(String description) | -| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | +| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | @@ -23,35 +23,85 @@ | `DisplayOnHostedPage` | `Boolean` | Optional | - | Boolean getDisplayOnHostedPage() | setDisplayOnHostedPage(Boolean displayOnHostedPage) | | `AllowFractionalQuantities` | `Boolean` | Optional | - | Boolean getAllowFractionalQuantities() | setAllowFractionalQuantities(Boolean allowFractionalQuantities) | | `PublicSignupPageIds` | `List` | Optional | - | List getPublicSignupPageIds() | setPublicSignupPageIds(List publicSignupPageIds) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | -## Example (as JSON) - -```json -{ - "name": "name4", - "unit_name": "unit_name6", - "description": "description6", - "handle": "handle0", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentPricePointItem; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.MeteredComponent; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +MeteredComponent meteredComponent = new MeteredComponent.Builder( + "name6", + "unit_name8", + PricingScheme.STAIRSTEP +) +.description("description4") +.handle("handle2") +.taxable(false) +.prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) +.pricePoints(Arrays.asList( + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build(), + new ComponentPricePointItem.Builder() + .name("name2") + .handle("handle8") + .pricingScheme(PricingScheme.PER_UNIT) + .interval(92) + .intervalUnit(IntervalUnit.DAY) + .build() + )) +.build(); ``` diff --git a/doc/models/metered-usage.md b/doc/models/metered-usage.md index 91dd69f7..db7b88e8 100644 --- a/doc/models/metered-usage.md +++ b/doc/models/metered-usage.md @@ -10,22 +10,28 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `PreviousUnitBalance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getPreviousUnitBalance() | setPreviousUnitBalance(String previousUnitBalance) | -| `NewUnitBalance` | `int` | Required | - | int getNewUnitBalance() | setNewUnitBalance(int newUnitBalance) | +| `NewUnitBalance` | [`MeteredUsageNewUnitBalance`](../../doc/models/containers/metered-usage-new-unit-balance.md) | Required | This is a container for one-of cases. | MeteredUsageNewUnitBalance getNewUnitBalance() | setNewUnitBalance(MeteredUsageNewUnitBalance newUnitBalance) | | `UsageQuantity` | `int` | Required | - | int getUsageQuantity() | setUsageQuantity(int usageQuantity) | | `ComponentId` | `int` | Required | - | int getComponentId() | setComponentId(int componentId) | | `ComponentHandle` | `String` | Required | - | String getComponentHandle() | setComponentHandle(String componentHandle) | | `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance6", - "new_unit_balance": 80, - "usage_quantity": 42, - "component_id": 4, - "component_handle": "component_handle8", - "memo": "memo2" -} +## Example + +```java +import com.maxio.advancedbilling.models.MeteredUsage; +import com.maxio.advancedbilling.models.containers.MeteredUsageNewUnitBalance; + +MeteredUsage meteredUsage = new MeteredUsage.Builder( + "previous_unit_balance6", + MeteredUsageNewUnitBalance.fromNumber( + 66 + ), + 106, + 68, + "component_handle0", + "memo4" +) +.build(); ``` diff --git a/doc/models/movement-line-item.md b/doc/models/movement-line-item.md index 9ae0dd49..c5c5bd77 100644 --- a/doc/models/movement-line-item.md +++ b/doc/models/movement-line-item.md @@ -19,15 +19,17 @@ | `PrevQuantity` | `Integer` | Optional | - | Integer getPrevQuantity() | setPrevQuantity(Integer prevQuantity) | | `Recurring` | `Boolean` | Optional | When `true`, the line item's MRR value will contribute to the `plan` breakout. When `false`, the line item contributes to the `usage` breakout. | Boolean getRecurring() | setRecurring(Boolean recurring) | -## Example (as JSON) - -```json -{ - "product_id": 156, - "component_id": 68, - "price_point_id": 164, - "name": "name6", - "mrr": 154 -} +## Example + +```java +import com.maxio.advancedbilling.models.MovementLineItem; + +MovementLineItem movementLineItem = new MovementLineItem.Builder() + .productId(146) + .componentId(58) + .pricePointId(82) + .name("name8") + .mrr(92) + .build(); ``` diff --git a/doc/models/movement.md b/doc/models/movement.md index ece7acce..4c261b66 100644 --- a/doc/models/movement.md +++ b/doc/models/movement.md @@ -19,15 +19,18 @@ | `SubscriptionId` | `Integer` | Optional | - | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `SubscriberName` | `String` | Optional | - | String getSubscriberName() | setSubscriberName(String subscriberName) | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "amount_in_cents": 174, - "amount_formatted": "amount_formatted4", - "description": "description2", - "category": "category0" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Movement; + +Movement movement = new Movement.Builder() + .timestamp(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .amountInCents(34L) + .amountFormatted("amount_formatted6") + .description("description4") + .category("category2") + .build(); ``` diff --git a/doc/models/mrr-movement.md b/doc/models/mrr-movement.md index 470b17b2..5ef2ee2b 100644 --- a/doc/models/mrr-movement.md +++ b/doc/models/mrr-movement.md @@ -14,14 +14,16 @@ | `SubscriberDelta` | `Integer` | Optional | - | Integer getSubscriberDelta() | setSubscriberDelta(Integer subscriberDelta) | | `LeadDelta` | `Integer` | Optional | - | Integer getLeadDelta() | setLeadDelta(Integer leadDelta) | -## Example (as JSON) - -```json -{ - "amount": 210, - "category": "category0", - "subscriber_delta": 170, - "lead_delta": 198 -} +## Example + +```java +import com.maxio.advancedbilling.models.MRRMovement; + +MRRMovement mRRMovement = new MRRMovement.Builder() + .amount(116) + .category("category4") + .subscriberDelta(100) + .leadDelta(128) + .build(); ``` diff --git a/doc/models/mrr-response.md b/doc/models/mrr-response.md index 7f356ee4..77f6aed1 100644 --- a/doc/models/mrr-response.md +++ b/doc/models/mrr-response.md @@ -11,22 +11,27 @@ | --- | --- | --- | --- | --- | --- | | `Mrr` | [`MRR`](../../doc/models/mrr.md) | Required | - | MRR getMrr() | setMrr(MRR mrr) | -## Example (as JSON) - -```json -{ - "mrr": { - "amount_in_cents": 198, - "amount_formatted": "amount_formatted6", - "currency": "currency4", - "currency_symbol": "currency_symbol2", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Breakouts; +import com.maxio.advancedbilling.models.MRR; +import com.maxio.advancedbilling.models.MRRResponse; + +MRRResponse mRRResponse = new MRRResponse.Builder( + new MRR.Builder() + .amountInCents(198L) + .amountFormatted("amount_formatted6") + .currency("currency4") + .currencySymbol("currency_symbol2") + .breakouts(new Breakouts.Builder() + .planAmountInCents(254L) + .planAmountFormatted("plan_amount_formatted0") + .usageAmountInCents(106L) + .usageAmountFormatted("usage_amount_formatted8") + .build()) + .build() +) +.build(); ``` diff --git a/doc/models/mrr.md b/doc/models/mrr.md index b308a5a0..e6a15cf5 100644 --- a/doc/models/mrr.md +++ b/doc/models/mrr.md @@ -16,20 +16,23 @@ | `Breakouts` | [`Breakouts`](../../doc/models/breakouts.md) | Optional | - | Breakouts getBreakouts() | setBreakouts(Breakouts breakouts) | | `AtTime` | `ZonedDateTime` | Optional | ISO8601 timestamp | ZonedDateTime getAtTime() | setAtTime(ZonedDateTime atTime) | -## Example (as JSON) - -```json -{ - "amount_in_cents": 208, - "amount_formatted": "amount_formatted2", - "currency": "currency0", - "currency_symbol": "currency_symbol8", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Breakouts; +import com.maxio.advancedbilling.models.MRR; + +MRR mRR = new MRR.Builder() + .amountInCents(122L) + .amountFormatted("amount_formatted4") + .currency("currency2") + .currencySymbol("currency_symbol0") + .breakouts(new Breakouts.Builder() + .planAmountInCents(254L) + .planAmountFormatted("plan_amount_formatted0") + .usageAmountInCents(106L) + .usageAmountFormatted("usage_amount_formatted8") + .build()) + .build(); ``` diff --git a/doc/models/multi-invoice-payment-response.md b/doc/models/multi-invoice-payment-response.md index 70b57684..aad7a1e6 100644 --- a/doc/models/multi-invoice-payment-response.md +++ b/doc/models/multi-invoice-payment-response.md @@ -11,32 +11,38 @@ | --- | --- | --- | --- | --- | --- | | `Payment` | [`MultiInvoicePayment`](../../doc/models/multi-invoice-payment.md) | Required | - | MultiInvoicePayment getPayment() | setPayment(MultiInvoicePayment payment) | -## Example (as JSON) - -```json -{ - "payment": { - "transaction_id": 224, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - }, - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - }, - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePaymentApplication; +import com.maxio.advancedbilling.models.MultiInvoicePayment; +import com.maxio.advancedbilling.models.MultiInvoicePaymentResponse; +import java.util.Arrays; + +MultiInvoicePaymentResponse multiInvoicePaymentResponse = new MultiInvoicePaymentResponse.Builder( + new MultiInvoicePayment.Builder() + .transactionId(224) + .totalAmount("total_amount2") + .currencyCode("currency_code2") + .applications(Arrays.asList( + new InvoicePaymentApplication.Builder() + .invoiceUid("invoice_uid8") + .applicationUid("application_uid8") + .appliedAmount("applied_amount0") + .build(), + new InvoicePaymentApplication.Builder() + .invoiceUid("invoice_uid8") + .applicationUid("application_uid8") + .appliedAmount("applied_amount0") + .build(), + new InvoicePaymentApplication.Builder() + .invoiceUid("invoice_uid8") + .applicationUid("application_uid8") + .appliedAmount("applied_amount0") + .build() + )) + .build() +) +.build(); ``` diff --git a/doc/models/multi-invoice-payment.md b/doc/models/multi-invoice-payment.md index d9b6b3d7..0d2cda87 100644 --- a/doc/models/multi-invoice-payment.md +++ b/doc/models/multi-invoice-payment.md @@ -14,20 +14,29 @@ | `CurrencyCode` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | String getCurrencyCode() | setCurrencyCode(String currencyCode) | | `Applications` | [`List`](../../doc/models/invoice-payment-application.md) | Optional | - | List getApplications() | setApplications(List applications) | -## Example (as JSON) - -```json -{ - "transaction_id": 144, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePaymentApplication; +import com.maxio.advancedbilling.models.MultiInvoicePayment; +import java.util.Arrays; + +MultiInvoicePayment multiInvoicePayment = new MultiInvoicePayment.Builder() + .transactionId(246) + .totalAmount("total_amount0") + .currencyCode("currency_code0") + .applications(Arrays.asList( + new InvoicePaymentApplication.Builder() + .invoiceUid("invoice_uid8") + .applicationUid("application_uid8") + .appliedAmount("applied_amount0") + .build(), + new InvoicePaymentApplication.Builder() + .invoiceUid("invoice_uid8") + .applicationUid("application_uid8") + .appliedAmount("applied_amount0") + .build() + )) + .build(); ``` diff --git a/doc/models/nested-subscription-group.md b/doc/models/nested-subscription-group.md index 099d742d..cadba2cb 100644 --- a/doc/models/nested-subscription-group.md +++ b/doc/models/nested-subscription-group.md @@ -14,14 +14,16 @@ | `PrimarySubscriptionId` | `Integer` | Optional | The subscription ID of the primary within the group. Applicable to scheme 1. | Integer getPrimarySubscriptionId() | setPrimarySubscriptionId(Integer primarySubscriptionId) | | `Primary` | `Boolean` | Optional | A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1. | Boolean getPrimary() | setPrimary(Boolean primary) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "scheme": 62, - "primary_subscription_id": 10, - "primary": false -} +## Example + +```java +import com.maxio.advancedbilling.models.NestedSubscriptionGroup; + +NestedSubscriptionGroup nestedSubscriptionGroup = new NestedSubscriptionGroup.Builder() + .uid("uid6") + .scheme(106) + .primarySubscriptionId(54) + .primary(false) + .build(); ``` diff --git a/doc/models/net-terms.md b/doc/models/net-terms.md index b4641a51..f21ecc9a 100644 --- a/doc/models/net-terms.md +++ b/doc/models/net-terms.md @@ -15,15 +15,17 @@ | `NetTermsOnRemittanceSignupsEnabled` | `Boolean` | Optional | **Default**: `false` | Boolean getNetTermsOnRemittanceSignupsEnabled() | setNetTermsOnRemittanceSignupsEnabled(Boolean netTermsOnRemittanceSignupsEnabled) | | `CustomNetTermsEnabled` | `Boolean` | Optional | **Default**: `false` | Boolean getCustomNetTermsEnabled() | setCustomNetTermsEnabled(Boolean customNetTermsEnabled) | -## Example (as JSON) - -```json -{ - "default_net_terms": 0, - "automatic_net_terms": 0, - "remittance_net_terms": 0, - "net_terms_on_remittance_signups_enabled": false, - "custom_net_terms_enabled": false -} +## Example + +```java +import com.maxio.advancedbilling.models.NetTerms; + +NetTerms netTerms = new NetTerms.Builder() + .defaultNetTerms(0) + .automaticNetTerms(0) + .remittanceNetTerms(0) + .netTermsOnRemittanceSignupsEnabled(false) + .customNetTermsEnabled(false) + .build(); ``` diff --git a/doc/models/offer-discount.md b/doc/models/offer-discount.md index 1f6ded1a..4dd37157 100644 --- a/doc/models/offer-discount.md +++ b/doc/models/offer-discount.md @@ -13,13 +13,15 @@ | `CouponId` | `Integer` | Optional | - | Integer getCouponId() | setCouponId(Integer couponId) | | `CouponName` | `String` | Optional | - | String getCouponName() | setCouponName(String couponName) | -## Example (as JSON) - -```json -{ - "coupon_code": "coupon_code8", - "coupon_id": 86, - "coupon_name": "coupon_name4" -} +## Example + +```java +import com.maxio.advancedbilling.models.OfferDiscount; + +OfferDiscount offerDiscount = new OfferDiscount.Builder() + .couponCode("coupon_code6") + .couponId(202) + .couponName("coupon_name6") + .build(); ``` diff --git a/doc/models/offer-item.md b/doc/models/offer-item.md index 92e1f5dc..12ff548c 100644 --- a/doc/models/offer-item.md +++ b/doc/models/offer-item.md @@ -17,18 +17,20 @@ | `ComponentName` | `String` | Optional | - | String getComponentName() | setComponentName(String componentName) | | `PricePointName` | `String` | Optional | - | String getPricePointName() | setPricePointName(String pricePointName) | | `CurrencyPrices` | [`List`](../../doc/models/currency-price.md) | Optional | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | -## Example (as JSON) +## Example -```json -{ - "component_id": 216, - "price_point_id": 16, - "starting_quantity": "starting_quantity0", - "editable": false, - "component_unit_price": "component_unit_price8" -} +```java +import com.maxio.advancedbilling.models.OfferItem; + +OfferItem offerItem = new OfferItem.Builder() + .componentId(234) + .pricePointId(254) + .startingQuantity("starting_quantity6") + .editable(false) + .componentUnitPrice("component_unit_price2") + .build(); ``` diff --git a/doc/models/offer-response.md b/doc/models/offer-response.md index b0568125..d25feb16 100644 --- a/doc/models/offer-response.md +++ b/doc/models/offer-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `Offer` | [`Offer`](../../doc/models/offer.md) | Optional | - | Offer getOffer() | setOffer(Offer offer) | -## Example (as JSON) - -```json -{ - "offer": { - "id": 28, - "site_id": 210, - "product_family_id": 224, - "product_id": 30, - "product_price_point_id": 150 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Offer; +import com.maxio.advancedbilling.models.OfferResponse; + +OfferResponse offerResponse = new OfferResponse.Builder() + .offer(new Offer.Builder() + .id(28) + .siteId(210) + .productFamilyId(224) + .productId(30) + .productPricePointId(150) + .build()) + .build(); ``` diff --git a/doc/models/offer-signup-page.md b/doc/models/offer-signup-page.md index 10a4f1ef..4c9a0c04 100644 --- a/doc/models/offer-signup-page.md +++ b/doc/models/offer-signup-page.md @@ -16,15 +16,17 @@ | `ReturnParams` | `String` | Optional | - | String getReturnParams() | setReturnParams(String returnParams) | | `Url` | `String` | Optional | - | String getUrl() | setUrl(String url) | -## Example (as JSON) - -```json -{ - "id": 50, - "nickname": "nickname8", - "enabled": false, - "return_url": "return_url2", - "return_params": "return_params0" -} +## Example + +```java +import com.maxio.advancedbilling.models.OfferSignupPage; + +OfferSignupPage offerSignupPage = new OfferSignupPage.Builder() + .id(102) + .nickname("nickname6") + .enabled(false) + .returnUrl("return_url6") + .returnParams("return_params8") + .build(); ``` diff --git a/doc/models/offer.md b/doc/models/offer.md index 2d5b54d6..3a4fce91 100644 --- a/doc/models/offer.md +++ b/doc/models/offer.md @@ -29,15 +29,17 @@ | `ProductPriceInCents` | `Long` | Optional | - | Long getProductPriceInCents() | setProductPriceInCents(Long productPriceInCents) | | `OfferSignupPages` | [`List`](../../doc/models/offer-signup-page.md) | Optional | - | List getOfferSignupPages() | setOfferSignupPages(List offerSignupPages) | -## Example (as JSON) - -```json -{ - "id": 154, - "site_id": 80, - "product_family_id": 158, - "product_id": 96, - "product_price_point_id": 20 -} +## Example + +```java +import com.maxio.advancedbilling.models.Offer; + +Offer offer = new Offer.Builder() + .id(28) + .siteId(210) + .productFamilyId(224) + .productId(30) + .productPricePointId(150) + .build(); ``` diff --git a/doc/models/ok-response.md b/doc/models/ok-response.md index 9fc26e6f..325f981c 100644 --- a/doc/models/ok-response.md +++ b/doc/models/ok-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `Ok` | `String` | Optional | - | String getOk() | setOk(String ok) | -## Example (as JSON) +## Example -```json -{ - "ok": "ok4" -} +```java +import com.maxio.advancedbilling.models.OkResponse; + +OkResponse okResponse = new OkResponse.Builder() + .ok("ok8") + .build(); ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index 35e2c5dc..c13a5d46 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -9,9 +9,9 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | String getName() | setName(String name) | +| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | String getName() | setName(String name) | | `Description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | String getDescription() | setDescription(String description) | -| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | +| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | | `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | @@ -22,20 +22,28 @@ | `DisplayOnHostedPage` | `Boolean` | Optional | - | Boolean getDisplayOnHostedPage() | setDisplayOnHostedPage(Boolean displayOnHostedPage) | | `AllowFractionalQuantities` | `Boolean` | Optional | - | Boolean getAllowFractionalQuantities() | setAllowFractionalQuantities(Boolean allowFractionalQuantities) | | `PublicSignupPageIds` | `List` | Optional | - | List getPublicSignupPageIds() | setPublicSignupPageIds(List publicSignupPageIds) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | - -## Example (as JSON) - -```json -{ - "name": "name2", - "description": "description2", - "handle": "handle8", - "taxable": false, - "upgrade_charge": "prorated", - "downgrade_credit": "prorated", - "unit_price": "String1" -} +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | + +## Example + +```java +import com.maxio.advancedbilling.models.CreditType; +import com.maxio.advancedbilling.models.OnOffComponent; +import com.maxio.advancedbilling.models.containers.OnOffComponentUnitPrice; + +OnOffComponent onOffComponent = new OnOffComponent.Builder( + "name0", + OnOffComponentUnitPrice.fromString( + "String9" + ) +) +.description("description0") +.handle("handle6") +.taxable(false) +.upgradeCharge(CreditType.FULL) +.downgradeCredit(CreditType.FULL) +.build(); ``` diff --git a/doc/models/organization-address.md b/doc/models/organization-address.md index 41e0db0a..532bd088 100644 --- a/doc/models/organization-address.md +++ b/doc/models/organization-address.md @@ -18,15 +18,17 @@ | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Phone` | `String` | Optional | - | String getPhone() | setPhone(String phone) | -## Example (as JSON) - -```json -{ - "street": "street4", - "line2": "line28", - "city": "city4", - "state": "state0", - "zip": "zip2" -} +## Example + +```java +import com.maxio.advancedbilling.models.OrganizationAddress; + +OrganizationAddress organizationAddress = new OrganizationAddress.Builder() + .street("street2") + .line2("line26") + .city("city2") + .state("state8") + .zip("zip6") + .build(); ``` diff --git a/doc/models/origin-invoice.md b/doc/models/origin-invoice.md index cd634a8a..330a6946 100644 --- a/doc/models/origin-invoice.md +++ b/doc/models/origin-invoice.md @@ -12,12 +12,14 @@ | `Uid` | `String` | Optional | The UID of the invoice serving as an origin invoice. | String getUid() | setUid(String uid) | | `Number` | `String` | Optional | The number of the invoice serving as an origin invoice. | String getNumber() | setNumber(String number) | -## Example (as JSON) +## Example -```json -{ - "uid": "uid0", - "number": "number8" -} +```java +import com.maxio.advancedbilling.models.OriginInvoice; + +OriginInvoice originInvoice = new OriginInvoice.Builder() + .uid("uid8") + .number("number4") + .build(); ``` diff --git a/doc/models/overage-pricing.md b/doc/models/overage-pricing.md index 7a02b0aa..12431aaf 100644 --- a/doc/models/overage-pricing.md +++ b/doc/models/overage-pricing.md @@ -12,28 +12,46 @@ | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | - | List getPrices() | setPrices(List prices) | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.OveragePricing; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +OveragePricing overagePricing = new OveragePricing.Builder( + PricingScheme.PER_UNIT +) +.prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) +.build(); ``` diff --git a/doc/models/override-subscription-request.md b/doc/models/override-subscription-request.md index 16068989..06897896 100644 --- a/doc/models/override-subscription-request.md +++ b/doc/models/override-subscription-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | [`OverrideSubscription`](../../doc/models/override-subscription.md) | Required | - | OverrideSubscription getSubscription() | setSubscription(OverrideSubscription subscription) | -## Example (as JSON) - -```json -{ - "subscription": { - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message2", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.OverrideSubscription; +import com.maxio.advancedbilling.models.OverrideSubscriptionRequest; + +OverrideSubscriptionRequest overrideSubscriptionRequest = new OverrideSubscriptionRequest.Builder( + new OverrideSubscription.Builder() + .activatedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .canceledAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .cancellationMessage("cancellation_message2") + .expiresAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .currentPeriodStartsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() +) +.build(); ``` diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index 56240e2f..1567f96a 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -15,15 +15,18 @@ | `ExpiresAt` | `ZonedDateTime` | Optional | Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported. This field is not supported when Multi-frequency is enabled for the Site. To change the Term End of a Subscription, use the Update Subscription endpoint. | ZonedDateTime getExpiresAt() | setExpiresAt(ZonedDateTime expiresAt) | | `CurrentPeriodStartsAt` | `ZonedDateTime` | Optional | Can only be used when a subscription is unbilled, which happens when a future initial billing date is passed at subscription creation. The value passed must be before the current date and time. Allows you to set when the period started so mid period component allocations have the correct proration. Only ISO8601 format is supported. | ZonedDateTime getCurrentPeriodStartsAt() | setCurrentPeriodStartsAt(ZonedDateTime currentPeriodStartsAt) | -## Example (as JSON) - -```json -{ - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message4", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.OverrideSubscription; + +OverrideSubscription overrideSubscription = new OverrideSubscription.Builder() + .activatedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .canceledAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .cancellationMessage("cancellation_message8") + .expiresAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .currentPeriodStartsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/paginated-metadata.md b/doc/models/paginated-metadata.md index 746e44fa..70c8eb44 100644 --- a/doc/models/paginated-metadata.md +++ b/doc/models/paginated-metadata.md @@ -15,30 +15,28 @@ | `PerPage` | `Integer` | Optional | - | Integer getPerPage() | setPerPage(Integer perPage) | | `Metadata` | [`List`](../../doc/models/metadata.md) | Optional | - | List getMetadata() | setMetadata(List metadata) | -## Example (as JSON) - -```json -{ - "total_count": 26, - "current_page": 2, - "total_pages": 14, - "per_page": 20, - "metadata": [ - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Metadata; +import com.maxio.advancedbilling.models.PaginatedMetadata; +import java.util.Arrays; + +PaginatedMetadata paginatedMetadata = new PaginatedMetadata.Builder() + .totalCount(166) + .currentPage(142) + .totalPages(154) + .perPage(136) + .metadata(Arrays.asList( + new Metadata.Builder() + .id(50) + .value("value8") + .resourceId(134) + .name("name6") + .deletedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() + )) + .build(); ``` diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index aad5fcde..1b8710da 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -14,14 +14,17 @@ | `DueAmount` | `String` | Optional | The remaining due amount on the invoice | String getDueAmount() | setDueAmount(String dueAmount) | | `PaidAmount` | `String` | Optional | The total amount paid on this invoice (including any prior payments) | String getPaidAmount() | setPaidAmount(String paidAmount) | -## Example (as JSON) - -```json -{ - "invoice_id": "invoice_id6", - "status": "open", - "due_amount": "due_amount8", - "paid_amount": "paid_amount8" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceStatus; +import com.maxio.advancedbilling.models.PaidInvoice; + +PaidInvoice paidInvoice = new PaidInvoice.Builder() + .invoiceId("invoice_id2") + .status(InvoiceStatus.CANCELED) + .dueAmount("due_amount4") + .paidAmount("paid_amount6") + .build(); ``` diff --git a/doc/models/pause-request.md b/doc/models/pause-request.md index 92ba2451..3c30bd4b 100644 --- a/doc/models/pause-request.md +++ b/doc/models/pause-request.md @@ -1,7 +1,7 @@ # Pause Request -Allows to pause a Subscription +Allows you to pause a Subscription. ## Structure @@ -13,13 +13,17 @@ Allows to pause a Subscription | --- | --- | --- | --- | --- | --- | | `Hold` | [`AutoResume`](../../doc/models/auto-resume.md) | Optional | - | AutoResume getHold() | setHold(AutoResume hold) | -## Example (as JSON) +## Example -```json -{ - "hold": { - "automatically_resume_at": "2016-03-13T12:52:32.123Z" - } -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AutoResume; +import com.maxio.advancedbilling.models.PauseRequest; + +PauseRequest pauseRequest = new PauseRequest.Builder() + .hold(new AutoResume.Builder() + .automaticallyResumeAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build()) + .build(); ``` diff --git a/doc/models/pay-pal-vault.md b/doc/models/pay-pal-vault.md index 00445c6c..1ea8e1a2 100644 --- a/doc/models/pay-pal-vault.md +++ b/doc/models/pay-pal-vault.md @@ -16,3 +16,11 @@ The vault that stores the payment profile with the provided vault_token. | `MODUSLINK` | | `PAYPAL_COMPLETE` | +## Example + +```java +import com.maxio.advancedbilling.models.PayPalVault; + +PayPalVault payPalVault = PayPalVault.MODUSLINK; +``` + diff --git a/doc/models/payer-attributes.md b/doc/models/payer-attributes.md index 9505c434..52ceaf74 100644 --- a/doc/models/payer-attributes.md +++ b/doc/models/payer-attributes.md @@ -28,19 +28,22 @@ | `TaxExemptReason` | `String` | Optional | - | String getTaxExemptReason() | setTaxExemptReason(String taxExemptReason) | | `Metafields` | `Map` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | Map getMetafields() | setMetafields(Map metafields) | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails4", - "organization": "organization8" -} +## Example + +```java +import com.maxio.advancedbilling.models.PayerAttributes; +import java.util.LinkedHashMap; + +PayerAttributes payerAttributes = new PayerAttributes.Builder() + .firstName("first_name2") + .lastName("last_name0") + .email("email4") + .ccEmails("cc_emails8") + .organization("organization4") + .metafields(new LinkedHashMap() {{ + put("custom_field_name_1", "custom_field_value_1"); + put("custom_field_name_2", "custom_field_value_2"); + }}) + .build(); ``` diff --git a/doc/models/payer-error.md b/doc/models/payer-error.md index 85fde519..1a1daa8e 100644 --- a/doc/models/payer-error.md +++ b/doc/models/payer-error.md @@ -13,22 +13,26 @@ | `FirstName` | `List` | Optional | - | List getFirstName() | setFirstName(List firstName) | | `Email` | `List` | Optional | - | List getEmail() | setEmail(List email) | -## Example (as JSON) - -```json -{ - "last_name": [ - "last_name1", - "last_name2", - "last_name3" - ], - "first_name": [ - "first_name4", - "first_name5" - ], - "email": [ - "email4" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.PayerError; +import java.util.Arrays; + +PayerError payerError = new PayerError.Builder() + .lastName(Arrays.asList( + "last_name9" + )) + .firstName(Arrays.asList( + "first_name2", + "first_name3", + "first_name4" + )) + .email(Arrays.asList( + "email6", + "email7", + "email8" + )) + .build(); ``` diff --git a/doc/models/payment-collection-method-changed.md b/doc/models/payment-collection-method-changed.md index bdb829a7..1ee76dba 100644 --- a/doc/models/payment-collection-method-changed.md +++ b/doc/models/payment-collection-method-changed.md @@ -12,12 +12,15 @@ | `PreviousValue` | `String` | Required | - | String getPreviousValue() | setPreviousValue(String previousValue) | | `CurrentValue` | `String` | Required | - | String getCurrentValue() | setCurrentValue(String currentValue) | -## Example (as JSON) +## Example -```json -{ - "previous_value": "previous_value4", - "current_value": "current_value2" -} +```java +import com.maxio.advancedbilling.models.PaymentCollectionMethodChanged; + +PaymentCollectionMethodChanged paymentCollectionMethodChanged = new PaymentCollectionMethodChanged.Builder( + "previous_value4", + "current_value2" +) +.build(); ``` diff --git a/doc/models/payment-for-allocation.md b/doc/models/payment-for-allocation.md index 52e7dda0..98760f60 100644 --- a/doc/models/payment-for-allocation.md +++ b/doc/models/payment-for-allocation.md @@ -16,14 +16,16 @@ Information for captured payment, if applicable | `Success` | `Boolean` | Optional | - | Boolean getSuccess() | setSuccess(Boolean success) | | `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | -## Example (as JSON) - -```json -{ - "id": 72, - "amount_in_cents": 158, - "success": false, - "memo": "memo6" -} +## Example + +```java +import com.maxio.advancedbilling.models.PaymentForAllocation; + +PaymentForAllocation paymentForAllocation = new PaymentForAllocation.Builder() + .id(68) + .amountInCents(102L) + .success(false) + .memo("memo6") + .build(); ``` diff --git a/doc/models/payment-method-apple-pay.md b/doc/models/payment-method-apple-pay.md index cfac3cb7..db2a723a 100644 --- a/doc/models/payment-method-apple-pay.md +++ b/doc/models/payment-method-apple-pay.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | InvoiceEventPaymentMethod getType() | setType(InvoiceEventPaymentMethod type) | -## Example (as JSON) +## Example -```json -{ - "type": "apple_pay" -} +```java +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.PaymentMethodApplePay; + +PaymentMethodApplePay paymentMethodApplePay = new PaymentMethodApplePay.Builder( + InvoiceEventPaymentMethod.APPLE_PAY +) +.build(); ``` diff --git a/doc/models/payment-method-bank-account.md b/doc/models/payment-method-bank-account.md index 7833c56a..2d986791 100644 --- a/doc/models/payment-method-bank-account.md +++ b/doc/models/payment-method-bank-account.md @@ -13,13 +13,17 @@ | `MaskedRoutingNumber` | `String` | Required | - | String getMaskedRoutingNumber() | setMaskedRoutingNumber(String maskedRoutingNumber) | | `Type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | InvoiceEventPaymentMethod getType() | setType(InvoiceEventPaymentMethod type) | -## Example (as JSON) - -```json -{ - "masked_account_number": "masked_account_number2", - "masked_routing_number": "masked_routing_number2", - "type": "bank_account" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.PaymentMethodBankAccount; + +PaymentMethodBankAccount paymentMethodBankAccount = new PaymentMethodBankAccount.Builder( + "masked_account_number4", + "masked_routing_number4", + InvoiceEventPaymentMethod.BANK_ACCOUNT +) +.build(); ``` diff --git a/doc/models/payment-method-credit-card.md b/doc/models/payment-method-credit-card.md index 19debe46..cce93d39 100644 --- a/doc/models/payment-method-credit-card.md +++ b/doc/models/payment-method-credit-card.md @@ -15,15 +15,19 @@ | `MaskedCardNumber` | `String` | Required | - | String getMaskedCardNumber() | setMaskedCardNumber(String maskedCardNumber) | | `Type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | InvoiceEventPaymentMethod getType() | setType(InvoiceEventPaymentMethod type) | -## Example (as JSON) - -```json -{ - "card_brand": "card_brand4", - "masked_card_number": "masked_card_number0", - "type": "credit_card", - "card_expiration": "card_expiration2", - "last_four": "last_four4" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.PaymentMethodCreditCard; + +PaymentMethodCreditCard paymentMethodCreditCard = new PaymentMethodCreditCard.Builder( + "card_brand4", + "masked_card_number0", + InvoiceEventPaymentMethod.CREDIT_CARD +) +.cardExpiration("card_expiration2") +.lastFour("last_four6") +.build(); ``` diff --git a/doc/models/payment-method-external.md b/doc/models/payment-method-external.md index cc134902..7d3b5ae8 100644 --- a/doc/models/payment-method-external.md +++ b/doc/models/payment-method-external.md @@ -14,14 +14,18 @@ | `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | | `Type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | InvoiceEventPaymentMethod getType() | setType(InvoiceEventPaymentMethod type) | -## Example (as JSON) - -```json -{ - "details": "details4", - "kind": "kind2", - "memo": "memo8", - "type": "external" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.PaymentMethodExternal; + +PaymentMethodExternal paymentMethodExternal = new PaymentMethodExternal.Builder( + "details0", + "kind8", + "memo4", + InvoiceEventPaymentMethod.EXTERNAL +) +.build(); ``` diff --git a/doc/models/payment-method-paypal.md b/doc/models/payment-method-paypal.md index 2b30179e..b6d2597c 100644 --- a/doc/models/payment-method-paypal.md +++ b/doc/models/payment-method-paypal.md @@ -12,12 +12,16 @@ | `Email` | `String` | Required | - | String getEmail() | setEmail(String email) | | `Type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | InvoiceEventPaymentMethod getType() | setType(InvoiceEventPaymentMethod type) | -## Example (as JSON) +## Example -```json -{ - "email": "email2", - "type": "paypal_account" -} +```java +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.PaymentMethodPaypal; + +PaymentMethodPaypal paymentMethodPaypal = new PaymentMethodPaypal.Builder( + "email8", + InvoiceEventPaymentMethod.PAYPAL_ACCOUNT +) +.build(); ``` diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index d4ea04e0..0989d7af 100644 --- a/doc/models/payment-profile-attributes.md +++ b/doc/models/payment-profile-attributes.md @@ -11,22 +11,22 @@ alias to credit_card_attributes | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `ChargifyToken` | `String` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | String getChargifyToken() | setChargifyToken(String chargifyToken) | +| `ChargifyToken` | `String` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). | String getChargifyToken() | setChargifyToken(String chargifyToken) | | `Id` | `Integer` | Optional | - | Integer getId() | setId(Integer id) | | `PaymentType` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | PaymentType getPaymentType() | setPaymentType(PaymentType paymentType) | | `FirstName` | `String` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | String getFirstName() | setFirstName(String firstName) | | `LastName` | `String` | Optional | (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | String getLastName() | setLastName(String lastName) | | `MaskedCardNumber` | `String` | Optional | - | String getMaskedCardNumber() | setMaskedCardNumber(String maskedCardNumber) | -| `FullNumber` | `String` | Optional | The full credit card number (string representation, i.e. 5424000000000015) | String getFullNumber() | setFullNumber(String fullNumber) | -| `CardType` | [`CardType`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) you may supply it here so that we may display the card type in the UI. | CardType getCardType() | setCardType(CardType cardType) | +| `FullNumber` | `String` | Optional | The full credit card number (string representation, e.g., 5424000000000015) | String getFullNumber() | setFullNumber(String fullNumber) | +| `CardType` | [`CardType`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (e.g., Visa, MC, etc.) you may supply it here so that we may display the card type in the UI. | CardType getCardType() | setCardType(CardType cardType) | | `ExpirationMonth` | [`PaymentProfileAttributesExpirationMonth`](../../doc/models/containers/payment-profile-attributes-expiration-month.md) | Optional | This is a container for one-of cases. | PaymentProfileAttributesExpirationMonth getExpirationMonth() | setExpirationMonth(PaymentProfileAttributesExpirationMonth expirationMonth) | | `ExpirationYear` | [`PaymentProfileAttributesExpirationYear`](../../doc/models/containers/payment-profile-attributes-expiration-year.md) | Optional | This is a container for one-of cases. | PaymentProfileAttributesExpirationYear getExpirationYear() | setExpirationYear(PaymentProfileAttributesExpirationYear expirationYear) | -| `BillingAddress` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | String getBillingAddress() | setBillingAddress(String billingAddress) | -| `BillingAddress2` | `String` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | -| `BillingCity` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | String getBillingCity() | setBillingCity(String billingCity) | -| `BillingState` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | String getBillingState() | setBillingState(String billingState) | -| `BillingCountry` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | String getBillingCountry() | setBillingCountry(String billingCountry) | -| `BillingZip` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | String getBillingZip() | setBillingZip(String billingZip) | +| `BillingAddress` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | String getBillingAddress() | setBillingAddress(String billingAddress) | +| `BillingAddress2` | `String` | Optional | (Optional) Second line of the customer’s billing address, e.g., Apt. 100 | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | +| `BillingCity` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | String getBillingCity() | setBillingCity(String billingCity) | +| `BillingState` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | String getBillingState() | setBillingState(String billingState) | +| `BillingCountry` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | String getBillingCountry() | setBillingCountry(String billingCountry) | +| `BillingZip` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | String getBillingZip() | setBillingZip(String billingZip) | | `CurrentVault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. | AllVaults getCurrentVault() | setCurrentVault(AllVaults currentVault) | | `VaultToken` | `String` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | String getVaultToken() | setVaultToken(String vaultToken) | | `CustomerVaultToken` | `String` | Optional | (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | String getCustomerVaultToken() | setCustomerVaultToken(String customerVaultToken) | @@ -35,17 +35,20 @@ alias to credit_card_attributes | `PaymentMethodNonce` | `String` | Optional | (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) | String getPaymentMethodNonce() | setPaymentMethodNonce(String paymentMethodNonce) | | `GatewayHandle` | `String` | Optional | (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | | `Cvv` | `String` | Optional | (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | String getCvv() | setCvv(String cvv) | -| `LastFour` | `String` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | String getLastFour() | setLastFour(String lastFour) | - -## Example (as JSON) - -```json -{ - "chargify_token": "chargify_token8", - "id": 80, - "payment_type": "credit_card", - "first_name": "first_name0", - "last_name": "last_name8" -} +| `LastFour` | `String` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (e.g., XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | String getLastFour() | setLastFour(String lastFour) | + +## Example + +```java +import com.maxio.advancedbilling.models.PaymentProfileAttributes; +import com.maxio.advancedbilling.models.PaymentType; + +PaymentProfileAttributes paymentProfileAttributes = new PaymentProfileAttributes.Builder() + .chargifyToken("chargify_token8") + .id(14) + .paymentType(PaymentType.PAYPAL_ACCOUNT) + .firstName("first_name0") + .lastName("last_name8") + .build(); ``` diff --git a/doc/models/payment-profile-params.md b/doc/models/payment-profile-params.md index 9e00621e..a8308f2c 100644 --- a/doc/models/payment-profile-params.md +++ b/doc/models/payment-profile-params.md @@ -15,13 +15,15 @@ PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are | `LastName` | `String` | Optional | - | String getLastName() | setLastName(String lastName) | | `CardType` | `String` | Optional | - | String getCardType() | setCardType(String cardType) | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type8" -} +## Example + +```java +import com.maxio.advancedbilling.models.PaymentProfileParams; + +PaymentProfileParams paymentProfileParams = new PaymentProfileParams.Builder() + .firstName("first_name2") + .lastName("last_name0") + .cardType("card_type2") + .build(); ``` diff --git a/doc/models/payment-profile-response.md b/doc/models/payment-profile-response.md index 088c5ed5..027b027a 100644 --- a/doc/models/payment-profile-response.md +++ b/doc/models/payment-profile-response.md @@ -11,18 +11,28 @@ | --- | --- | --- | --- | --- | --- | | `PaymentProfile` | [`PaymentProfile`](../../doc/models/containers/payment-profile.md) | Required | - | PaymentProfile getPaymentProfile() | setPaymentProfile(PaymentProfile paymentProfile) | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ApplePayPaymentProfile; +import com.maxio.advancedbilling.models.ApplePayVault; +import com.maxio.advancedbilling.models.PaymentProfileResponse; +import com.maxio.advancedbilling.models.PaymentType; +import com.maxio.advancedbilling.models.containers.PaymentProfile; + +PaymentProfileResponse paymentProfileResponse = new PaymentProfileResponse.Builder( + PaymentProfile.fromApplePayPaymentProfile( + new ApplePayPaymentProfile.Builder( + PaymentType.APPLE_PAY + ) + .id(60) + .firstName("first_name2") + .lastName("last_name0") + .customerId(98) + .currentVault(ApplePayVault.BRAINTREE_BLUE) + .build() + ) +) +.build(); ``` diff --git a/doc/models/payment-related-events.md b/doc/models/payment-related-events.md index 36fbc6aa..49b9ca9c 100644 --- a/doc/models/payment-related-events.md +++ b/doc/models/payment-related-events.md @@ -12,12 +12,15 @@ | `ProductId` | `int` | Required | - | int getProductId() | setProductId(int productId) | | `AccountTransactionId` | `int` | Required | - | int getAccountTransactionId() | setAccountTransactionId(int accountTransactionId) | -## Example (as JSON) +## Example -```json -{ - "product_id": 42, - "account_transaction_id": 58 -} +```java +import com.maxio.advancedbilling.models.PaymentRelatedEvents; + +PaymentRelatedEvents paymentRelatedEvents = new PaymentRelatedEvents.Builder( + 186, + 170 +) +.build(); ``` diff --git a/doc/models/payment-type.md b/doc/models/payment-type.md index 44b7cba6..09774036 100644 --- a/doc/models/payment-type.md +++ b/doc/models/payment-type.md @@ -14,3 +14,11 @@ | `PAYPAL_ACCOUNT` | | `APPLE_PAY` | +## Example + +```java +import com.maxio.advancedbilling.models.PaymentType; + +PaymentType paymentType = PaymentType.CREDIT_CARD; +``` + diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index f717e886..e37cbe90 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -29,16 +29,21 @@ | `CreatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | A timestamp indicating when this payment profile was last updated | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -## Example (as JSON) - -```json -{ - "payment_type": "paypal_account", - "id": 10, - "first_name": "first_name0", - "last_name": "last_name8", - "customer_id": 48, - "current_vault": "moduslink" -} +## Example + +```java +import com.maxio.advancedbilling.models.PayPalVault; +import com.maxio.advancedbilling.models.PaymentType; +import com.maxio.advancedbilling.models.PaypalPaymentProfile; + +PaypalPaymentProfile paypalPaymentProfile = new PaypalPaymentProfile.Builder( + PaymentType.PAYPAL_ACCOUNT +) +.id(214) +.firstName("first_name0") +.lastName("last_name8") +.customerId(252) +.currentVault(PayPalVault.MODUSLINK) +.build(); ``` diff --git a/doc/models/pending-cancellation-change.md b/doc/models/pending-cancellation-change.md index 5c7b1a2b..fd0b47dc 100644 --- a/doc/models/pending-cancellation-change.md +++ b/doc/models/pending-cancellation-change.md @@ -12,12 +12,16 @@ | `CancellationState` | `String` | Required | - | String getCancellationState() | setCancellationState(String cancellationState) | | `CancelsAt` | `ZonedDateTime` | Required | - | ZonedDateTime getCancelsAt() | setCancelsAt(ZonedDateTime cancelsAt) | -## Example (as JSON) +## Example -```json -{ - "cancellation_state": "cancellation_state8", - "cancels_at": "2016-03-13T12:52:32.123Z" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.PendingCancellationChange; + +PendingCancellationChange pendingCancellationChange = new PendingCancellationChange.Builder( + "cancellation_state0", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") +) +.build(); ``` diff --git a/doc/models/portal-management-link.md b/doc/models/portal-management-link.md index 02546f22..f4cab710 100644 --- a/doc/models/portal-management-link.md +++ b/doc/models/portal-management-link.md @@ -16,15 +16,18 @@ | `ExpiresAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getExpiresAt() | setExpiresAt(ZonedDateTime expiresAt) | | `LastInviteSentAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getLastInviteSentAt() | setLastInviteSentAt(ZonedDateTime lastInviteSentAt) | -## Example (as JSON) - -```json -{ - "url": "url0", - "fetch_count": 222, - "created_at": "2016-03-13T12:52:32.123Z", - "new_link_available_at": "2016-03-13T12:52:32.123Z", - "expires_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.PortalManagementLink; + +PortalManagementLink portalManagementLink = new PortalManagementLink.Builder() + .url("url8") + .fetchCount(88) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .newLinkAvailableAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .expiresAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/prepaid-configuration-response.md b/doc/models/prepaid-configuration-response.md index ff2dc983..ab15c741 100644 --- a/doc/models/prepaid-configuration-response.md +++ b/doc/models/prepaid-configuration-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `PrepaidConfiguration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Required | - | PrepaidConfiguration getPrepaidConfiguration() | setPrepaidConfiguration(PrepaidConfiguration prepaidConfiguration) | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "id": 142, - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.PrepaidConfiguration; +import com.maxio.advancedbilling.models.PrepaidConfigurationResponse; + +PrepaidConfigurationResponse prepaidConfigurationResponse = new PrepaidConfigurationResponse.Builder( + new PrepaidConfiguration.Builder() + .id(142) + .initialFundingAmountInCents(74L) + .replenishToAmountInCents(76L) + .autoReplenish(false) + .replenishThresholdAmountInCents(20L) + .build() +) +.build(); ``` diff --git a/doc/models/prepaid-configuration.md b/doc/models/prepaid-configuration.md index 627fdf7e..46d1dcb1 100644 --- a/doc/models/prepaid-configuration.md +++ b/doc/models/prepaid-configuration.md @@ -15,15 +15,17 @@ | `AutoReplenish` | `Boolean` | Optional | - | Boolean getAutoReplenish() | setAutoReplenish(Boolean autoReplenish) | | `ReplenishThresholdAmountInCents` | `Long` | Optional | - | Long getReplenishThresholdAmountInCents() | setReplenishThresholdAmountInCents(Long replenishThresholdAmountInCents) | -## Example (as JSON) - -```json -{ - "id": 156, - "initial_funding_amount_in_cents": 88, - "replenish_to_amount_in_cents": 166, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 222 -} +## Example + +```java +import com.maxio.advancedbilling.models.PrepaidConfiguration; + +PrepaidConfiguration prepaidConfiguration = new PrepaidConfiguration.Builder() + .id(146) + .initialFundingAmountInCents(78L) + .replenishToAmountInCents(80L) + .autoReplenish(false) + .replenishThresholdAmountInCents(232L) + .build(); ``` diff --git a/doc/models/prepaid-product-price-point-filter.md b/doc/models/prepaid-product-price-point-filter.md index 186c0378..d471b3be 100644 --- a/doc/models/prepaid-product-price-point-filter.md +++ b/doc/models/prepaid-product-price-point-filter.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | --- | --- | | `ProductPricePointId` | `String` | Required, Constant | Passed as a parameter to list methods to return only non null values.

**Value**: `"not_null"` | String getProductPricePointId() | setProductPricePointId(String productPricePointId) | -## Example (as JSON) +## Example -```json -{ - "product_price_point_id": "not_null" -} +```java +import com.maxio.advancedbilling.models.PrepaidProductPricePointFilter; + +PrepaidProductPricePointFilter prepaidProductPricePointFilter = new PrepaidProductPricePointFilter.Builder( + "not_null" +) +.build(); ``` diff --git a/doc/models/prepaid-subscription-balance-changed.md b/doc/models/prepaid-subscription-balance-changed.md index e675941e..9311fb9e 100644 --- a/doc/models/prepaid-subscription-balance-changed.md +++ b/doc/models/prepaid-subscription-balance-changed.md @@ -14,14 +14,17 @@ | `PrepaymentAccountBalanceInCents` | `long` | Required | - | long getPrepaymentAccountBalanceInCents() | setPrepaymentAccountBalanceInCents(long prepaymentAccountBalanceInCents) | | `CurrentUsageAmountInCents` | `long` | Required | - | long getCurrentUsageAmountInCents() | setCurrentUsageAmountInCents(long currentUsageAmountInCents) | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "current_account_balance_in_cents": 250, - "prepayment_account_balance_in_cents": 44, - "current_usage_amount_in_cents": 242 -} +## Example + +```java +import com.maxio.advancedbilling.models.PrepaidSubscriptionBalanceChanged; + +PrepaidSubscriptionBalanceChanged prepaidSubscriptionBalanceChanged = new PrepaidSubscriptionBalanceChanged.Builder( + "reason6", + 194L, + 100L, + 186L +) +.build(); ``` diff --git a/doc/models/prepaid-usage-allocation-detail.md b/doc/models/prepaid-usage-allocation-detail.md index e9575123..6f002b19 100644 --- a/doc/models/prepaid-usage-allocation-detail.md +++ b/doc/models/prepaid-usage-allocation-detail.md @@ -13,13 +13,15 @@ | `ChargeId` | `Integer` | Optional | - | Integer getChargeId() | setChargeId(Integer chargeId) | | `UsageQuantity` | `Integer` | Optional | - | Integer getUsageQuantity() | setUsageQuantity(Integer usageQuantity) | -## Example (as JSON) - -```json -{ - "allocation_id": 72, - "charge_id": 30, - "usage_quantity": 212 -} +## Example + +```java +import com.maxio.advancedbilling.models.PrepaidUsageAllocationDetail; + +PrepaidUsageAllocationDetail prepaidUsageAllocationDetail = new PrepaidUsageAllocationDetail.Builder() + .allocationId(144) + .chargeId(214) + .usageQuantity(140) + .build(); ``` diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 242985d2..8566658c 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | String getName() | setName(String name) | -| `UnitName` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | String getUnitName() | setUnitName(String unitName) | +| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | String getName() | setName(String name) | +| `UnitName` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item | String getUnitName() | setUnitName(String unitName) | | `Description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | String getDescription() | setDescription(String description) | -| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | +| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | @@ -23,47 +23,93 @@ | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | String getTaxCode() | setTaxCode(String taxCode) | | `HideDateRangeOnInvoice` | `Boolean` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | Boolean getHideDateRangeOnInvoice() | setHideDateRangeOnInvoice(Boolean hideDateRangeOnInvoice) | | `OveragePricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | OveragePricing getOveragePricing() | setOveragePricing(OveragePricing overagePricing) | -| `RolloverPrepaidRemainder` | `Boolean` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | Boolean getRolloverPrepaidRemainder() | setRolloverPrepaidRemainder(Boolean rolloverPrepaidRemainder) | -| `RenewPrepaidAllocation` | `Boolean` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | Boolean getRenewPrepaidAllocation() | setRenewPrepaidAllocation(Boolean renewPrepaidAllocation) | +| `RolloverPrepaidRemainder` | `Boolean` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period. | Boolean getRolloverPrepaidRemainder() | setRolloverPrepaidRemainder(Boolean rolloverPrepaidRemainder) | +| `RenewPrepaidAllocation` | `Boolean` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period. | Boolean getRenewPrepaidAllocation() | setRenewPrepaidAllocation(Boolean renewPrepaidAllocation) | | `ExpirationInterval` | `Double` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | Double getExpirationInterval() | setExpirationInterval(Double expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | - | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | | `DisplayOnHostedPage` | `Boolean` | Optional | - | Boolean getDisplayOnHostedPage() | setDisplayOnHostedPage(Boolean displayOnHostedPage) | | `AllowFractionalQuantities` | `Boolean` | Optional | - | Boolean getAllowFractionalQuantities() | setAllowFractionalQuantities(Boolean allowFractionalQuantities) | | `PublicSignupPageIds` | `List` | Optional | - | List getPublicSignupPageIds() | setPublicSignupPageIds(List publicSignupPageIds) | +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "unit_name": "unit_name4", - "description": "description8", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "prorated", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +```java +import com.maxio.advancedbilling.models.CreditType; +import com.maxio.advancedbilling.models.OveragePricing; +import com.maxio.advancedbilling.models.PrepaidUsageComponent; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +PrepaidUsageComponent prepaidUsageComponent = new PrepaidUsageComponent.Builder( + "name2", + "unit_name4", + PricingScheme.PER_UNIT, + new OveragePricing.Builder( + PricingScheme.STAIRSTEP + ) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .build() +) +.description("description8") +.handle("handle8") +.taxable(false) +.prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) +.upgradeCharge(CreditType.NONE) +.build(); ``` diff --git a/doc/models/prepaid-usage.md b/doc/models/prepaid-usage.md index 39b993bf..f3d76bf7 100644 --- a/doc/models/prepaid-usage.md +++ b/doc/models/prepaid-usage.md @@ -11,8 +11,8 @@ | --- | --- | --- | --- | --- | --- | | `PreviousUnitBalance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getPreviousUnitBalance() | setPreviousUnitBalance(String previousUnitBalance) | | `PreviousOverageUnitBalance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getPreviousOverageUnitBalance() | setPreviousOverageUnitBalance(String previousOverageUnitBalance) | -| `NewUnitBalance` | `int` | Required | - | int getNewUnitBalance() | setNewUnitBalance(int newUnitBalance) | -| `NewOverageUnitBalance` | `int` | Required | - | int getNewOverageUnitBalance() | setNewOverageUnitBalance(int newOverageUnitBalance) | +| `NewUnitBalance` | [`PrepaidUsageNewUnitBalance`](../../doc/models/containers/prepaid-usage-new-unit-balance.md) | Required | This is a container for one-of cases. | PrepaidUsageNewUnitBalance getNewUnitBalance() | setNewUnitBalance(PrepaidUsageNewUnitBalance newUnitBalance) | +| `NewOverageUnitBalance` | [`PrepaidUsageNewOverageUnitBalance`](../../doc/models/containers/prepaid-usage-new-overage-unit-balance.md) | Required | This is a container for one-of cases. | PrepaidUsageNewOverageUnitBalance getNewOverageUnitBalance() | setNewOverageUnitBalance(PrepaidUsageNewOverageUnitBalance newOverageUnitBalance) | | `UsageQuantity` | `int` | Required | - | int getUsageQuantity() | setUsageQuantity(int usageQuantity) | | `OverageUsageQuantity` | `int` | Required | - | int getOverageUsageQuantity() | setOverageUsageQuantity(int overageUsageQuantity) | | `ComponentId` | `int` | Required | - | int getComponentId() | setComponentId(int componentId) | @@ -20,26 +20,37 @@ | `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | | `AllocationDetails` | [`List`](../../doc/models/prepaid-usage-allocation-detail.md) | Required | - | List getAllocationDetails() | setAllocationDetails(List allocationDetails) | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance0", - "previous_overage_unit_balance": "previous_overage_unit_balance4", - "new_unit_balance": 252, - "new_overage_unit_balance": 224, - "usage_quantity": 214, - "overage_usage_quantity": 106, - "component_id": 176, - "component_handle": "component_handle4", - "memo": "memo8", - "allocation_details": [ - { - "allocation_id": 18, - "charge_id": 84, - "usage_quantity": 10 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.PrepaidUsage; +import com.maxio.advancedbilling.models.PrepaidUsageAllocationDetail; +import com.maxio.advancedbilling.models.containers.PrepaidUsageNewOverageUnitBalance; +import com.maxio.advancedbilling.models.containers.PrepaidUsageNewUnitBalance; +import java.util.Arrays; + +PrepaidUsage prepaidUsage = new PrepaidUsage.Builder( + "previous_unit_balance4", + "previous_overage_unit_balance0", + PrepaidUsageNewUnitBalance.fromNumber( + 206 + ), + PrepaidUsageNewOverageUnitBalance.fromNumber( + 78 + ), + 246, + 138, + 208, + "component_handle0", + "memo4", + Arrays.asList( + new PrepaidUsageAllocationDetail.Builder() + .allocationId(18) + .chargeId(84) + .usageQuantity(10) + .build() + ) +) +.build(); ``` diff --git a/doc/models/prepayment-account-balance-changed.md b/doc/models/prepayment-account-balance-changed.md index 187b836a..668367fa 100644 --- a/doc/models/prepayment-account-balance-changed.md +++ b/doc/models/prepayment-account-balance-changed.md @@ -14,14 +14,17 @@ | `PrepaymentBalanceChangeInCents` | `long` | Required | - | long getPrepaymentBalanceChangeInCents() | setPrepaymentBalanceChangeInCents(long prepaymentBalanceChangeInCents) | | `CurrencyCode` | `String` | Required | - | String getCurrencyCode() | setCurrencyCode(String currencyCode) | -## Example (as JSON) - -```json -{ - "reason": "reason4", - "prepayment_account_balance_in_cents": 182, - "prepayment_balance_change_in_cents": 206, - "currency_code": "currency_code4" -} +## Example + +```java +import com.maxio.advancedbilling.models.PrepaymentAccountBalanceChanged; + +PrepaymentAccountBalanceChanged prepaymentAccountBalanceChanged = new PrepaymentAccountBalanceChanged.Builder( + "reason8", + 134L, + 158L, + "currency_code8" +) +.build(); ``` diff --git a/doc/models/prepayment-method.md b/doc/models/prepayment-method.md index adbddd85..4e7ea565 100644 --- a/doc/models/prepayment-method.md +++ b/doc/models/prepayment-method.md @@ -17,3 +17,11 @@ | `CREDIT_CARD` | | `OTHER` | +## Example + +```java +import com.maxio.advancedbilling.models.PrepaymentMethod; + +PrepaymentMethod prepaymentMethod = PrepaymentMethod.OTHER; +``` + diff --git a/doc/models/prepayment-response.md b/doc/models/prepayment-response.md index 7a245b15..530de32e 100644 --- a/doc/models/prepayment-response.md +++ b/doc/models/prepayment-response.md @@ -11,22 +11,29 @@ | --- | --- | --- | --- | --- | --- | | `Prepayment` | [`Prepayment`](../../doc/models/prepayment.md) | Required | - | Prepayment getPrepayment() | setPrepayment(Prepayment prepayment) | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "refunded_amount_in_cents": 132, - "details": "details8", - "external": false, - "memo": "memo2", - "payment_type": "credit_card", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Prepayment; +import com.maxio.advancedbilling.models.PrepaymentMethod; +import com.maxio.advancedbilling.models.PrepaymentResponse; + +PrepaymentResponse prepaymentResponse = new PrepaymentResponse.Builder( + new Prepayment.Builder( + 38, + 148, + 124L, + 182L, + false, + "memo2", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") + ) + .refundedAmountInCents(132L) + .details("details8") + .paymentType(PrepaymentMethod.CREDIT_CARD) + .build() +) +.build(); ``` diff --git a/doc/models/prepayment.md b/doc/models/prepayment.md index d6104f6c..a7bd0b87 100644 --- a/doc/models/prepayment.md +++ b/doc/models/prepayment.md @@ -20,20 +20,25 @@ | `PaymentType` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | The payment type of the prepayment. | PrepaymentMethod getPaymentType() | setPaymentType(PrepaymentMethod paymentType) | | `CreatedAt` | `ZonedDateTime` | Required | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | -## Example (as JSON) - -```json -{ - "id": 50, - "subscription_id": 160, - "amount_in_cents": 120, - "remaining_amount_in_cents": 194, - "refunded_amount_in_cents": 144, - "details": "details4", - "external": false, - "memo": "memo8", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Prepayment; +import com.maxio.advancedbilling.models.PrepaymentMethod; + +Prepayment prepayment = new Prepayment.Builder( + 38, + 148, + 124L, + 182L, + false, + "memo2", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") +) +.refundedAmountInCents(132L) +.details("details8") +.paymentType(PrepaymentMethod.CREDIT_CARD) +.build(); ``` diff --git a/doc/models/prepayments-response.md b/doc/models/prepayments-response.md index 6c819d03..45909c34 100644 --- a/doc/models/prepayments-response.md +++ b/doc/models/prepayments-response.md @@ -11,36 +11,31 @@ | --- | --- | --- | --- | --- | --- | | `Prepayments` | [`List`](../../doc/models/prepayment.md) | Optional | **Constraints**: *Unique Items Required* | List getPrepayments() | setPrepayments(List prepayments) | -## Example (as JSON) - -```json -{ - "prepayments": [ - { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Prepayment; +import com.maxio.advancedbilling.models.PrepaymentMethod; +import com.maxio.advancedbilling.models.PrepaymentsResponse; +import java.util.Arrays; + +PrepaymentsResponse prepaymentsResponse = new PrepaymentsResponse.Builder() + .prepayments(Arrays.asList( + new Prepayment.Builder( + 76, + 186, + 94L, + 220L, + false, + "memo0", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") + ) + .refundedAmountInCents(170L) + .details("details6") + .paymentType(PrepaymentMethod.CASH) + .build() + )) + .build(); ``` diff --git a/doc/models/preview-allocations-request.md b/doc/models/preview-allocations-request.md index eec318e6..5c7f486e 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -14,23 +14,31 @@ | `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | | `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | -## Example (as JSON) - -```json -{ - "allocations": [ - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - } - ], - "effective_proration_date": "2023-12-01", - "upgrade_charge": "none", - "downgrade_credit": "prorated" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreateAllocation; +import com.maxio.advancedbilling.models.CreditType; +import com.maxio.advancedbilling.models.PreviewAllocationsRequest; +import java.util.Arrays; + +PreviewAllocationsRequest previewAllocationsRequest = new PreviewAllocationsRequest.Builder( + Arrays.asList( + new CreateAllocation.Builder( + 26.48D + ) + .decimalQuantity("decimal_quantity8") + .previousQuantity(55.5D) + .decimalPreviousQuantity("decimal_previous_quantity2") + .componentId(242) + .memo("memo6") + .build() + ) +) +.effectiveProrationDate(DateTimeHelper.fromSimpleDate("2023-12-01")) +.upgradeCharge(CreditType.NONE) +.downgradeCredit(CreditType.NONE) +.build(); ``` diff --git a/doc/models/price-point-type.md b/doc/models/price-point-type.md index f62e2acb..a16de53b 100644 --- a/doc/models/price-point-type.md +++ b/doc/models/price-point-type.md @@ -19,3 +19,11 @@ Price point type. We expose the following types: | `ENUM_DEFAULT` | | `CUSTOM` | +## Example + +```java +import com.maxio.advancedbilling.models.PricePointType; + +PricePointType pricePointType = PricePointType.ENUM_DEFAULT; +``` + diff --git a/doc/models/price.md b/doc/models/price.md index f75efc1d..3a06b98c 100644 --- a/doc/models/price.md +++ b/doc/models/price.md @@ -13,13 +13,25 @@ | `EndingQuantity` | [`PriceEndingQuantity`](../../doc/models/containers/price-ending-quantity.md) | Optional | This is a container for one-of cases. | PriceEndingQuantity getEndingQuantity() | setEndingQuantity(PriceEndingQuantity endingQuantity) | | `UnitPrice` | [`PriceUnitPrice`](../../doc/models/containers/price-unit-price.md) | Required | This is a container for one-of cases. | PriceUnitPrice getUnitPrice() | setUnitPrice(PriceUnitPrice unitPrice) | -## Example (as JSON) - -```json -{ - "starting_quantity": 40, - "ending_quantity": 14, - "unit_price": 125.12 -} +## Example + +```java +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; + +Price price = new Price.Builder( + PriceStartingQuantity.fromNumber( + 132 + ), + PriceUnitPrice.fromPrecision( + 70.44D + ) +) +.endingQuantity(PriceEndingQuantity.fromNumber( + 6 + )) +.build(); ``` diff --git a/doc/models/pricing-scheme.md b/doc/models/pricing-scheme.md index 6be09a7a..6f20f9e8 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -16,3 +16,11 @@ The identifier for the pricing scheme. See [Product Components](https://help.cha | `PER_UNIT` | | `TIERED` | +## Example + +```java +import com.maxio.advancedbilling.models.PricingScheme; + +PricingScheme pricingScheme = PricingScheme.STAIRSTEP; +``` + diff --git a/doc/models/product-family-response.md b/doc/models/product-family-response.md index d71ed020..ed61a2ee 100644 --- a/doc/models/product-family-response.md +++ b/doc/models/product-family-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `ProductFamily` | [`ProductFamily`](../../doc/models/product-family.md) | Optional | - | ProductFamily getProductFamily() | setProductFamily(ProductFamily productFamily) | -## Example (as JSON) - -```json -{ - "product_family": { - "id": 14, - "name": "name0", - "handle": "handle6", - "accounting_code": "accounting_code6", - "description": "description0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ProductFamily; +import com.maxio.advancedbilling.models.ProductFamilyResponse; + +ProductFamilyResponse productFamilyResponse = new ProductFamilyResponse.Builder() + .productFamily(new ProductFamily.Builder() + .id(14) + .name("name0") + .handle("handle6") + .accountingCode("accounting_code6") + .description("description0") + .build()) + .build(); ``` diff --git a/doc/models/product-family.md b/doc/models/product-family.md index 5d76a243..dfc0e30e 100644 --- a/doc/models/product-family.md +++ b/doc/models/product-family.md @@ -14,19 +14,22 @@ | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | | `AccountingCode` | `String` | Optional | - | String getAccountingCode() | setAccountingCode(String accountingCode) | | `Description` | `String` | Optional | - | String getDescription() | setDescription(String description) | +| `Surcharging` | `Boolean` | Optional | Whether surcharging applies to this product family. Only included on sites where surcharging is enabled. | Boolean getSurcharging() | setSurcharging(Boolean surcharging) | | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | | `ArchivedAt` | `ZonedDateTime` | Optional | Timestamp indicating when this product family was archived. `null` if the product family is not archived. | ZonedDateTime getArchivedAt() | setArchivedAt(ZonedDateTime archivedAt) | -## Example (as JSON) +## Example -```json -{ - "id": 194, - "name": "name2", - "handle": "handle8", - "accounting_code": "accounting_code8", - "description": "description8" -} +```java +import com.maxio.advancedbilling.models.ProductFamily; + +ProductFamily productFamily = new ProductFamily.Builder() + .id(134) + .name("name4") + .handle("handle0") + .accountingCode("accounting_code0") + .description("description4") + .build(); ``` diff --git a/doc/models/product-price-point-error-response-exception.md b/doc/models/product-price-point-error-response-exception.md index d7e68290..988f23db 100644 --- a/doc/models/product-price-point-error-response-exception.md +++ b/doc/models/product-price-point-error-response-exception.md @@ -11,31 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`ProductPricePointErrors`](../../doc/models/product-price-point-errors.md) | Required | - | ProductPricePointErrors getErrors() | setErrors(ProductPricePointErrors errors) | -## Example (as JSON) - -```json -{ - "errors": { - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." - ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." - ], - "name": [ - "Name: cannot be blank." - ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." - ], - "price_in_cents": [ - "Price in cents: cannot be blank." - ] - } +## Example + +```java +try { + // make the API call +} catch (ProductPricePointErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/product-price-point-errors.md b/doc/models/product-price-point-errors.md index 489c731c..f11ccfc1 100644 --- a/doc/models/product-price-point-errors.md +++ b/doc/models/product-price-point-errors.md @@ -16,29 +16,32 @@ | `Price` | `List` | Optional | - | List getPrice() | setPrice(List price) | | `PriceInCents` | `List` | Optional | - | List getPriceInCents() | setPriceInCents(List priceInCents) | -## Example (as JSON) - -```json -{ - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." - ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." - ], - "name": [ - "Name: cannot be blank." - ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." - ], - "price_in_cents": [ - "Price in cents: cannot be blank." - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ProductPricePointErrors; +import java.util.Arrays; + +ProductPricePointErrors productPricePointErrors = new ProductPricePointErrors.Builder() + .pricePoint("can't be blank") + .interval(Arrays.asList( + "Recurring Interval: cannot be blank.", + "Recurring Interval: must be greater than or equal to 1." + )) + .intervalUnit(Arrays.asList( + "Interval unit: cannot be blank.", + "Interval unit: must be 'month' or 'day'." + )) + .name(Arrays.asList( + "Name: cannot be blank." + )) + .price(Arrays.asList( + "Price: is not a number.", + "Price: must be greater than or equal to 0." + )) + .priceInCents(Arrays.asList( + "Price in cents: cannot be blank." + )) + .build(); ``` diff --git a/doc/models/product-price-point-response.md b/doc/models/product-price-point-response.md index 5caa0c53..b54ab2f0 100644 --- a/doc/models/product-price-point-response.md +++ b/doc/models/product-price-point-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`ProductPricePoint`](../../doc/models/product-price-point.md) | Required | - | ProductPricePoint getPricePoint() | setPricePoint(ProductPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "name": "name0", - "handle": "handle6", - "price_in_cents": 196, - "interval": 44 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ProductPricePoint; +import com.maxio.advancedbilling.models.ProductPricePointResponse; + +ProductPricePointResponse productPricePointResponse = new ProductPricePointResponse.Builder( + new ProductPricePoint.Builder() + .id(248) + .name("name0") + .handle("handle6") + .priceInCents(196L) + .interval(44) + .build() +) +.build(); ``` diff --git a/doc/models/product-price-point.md b/doc/models/product-price-point.md index 4f4b3e50..a00adbaf 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -13,16 +13,16 @@ | `Name` | `String` | Optional | The product price point name | String getName() | setName(String name) | | `Handle` | `String` | Optional | The product price point API handle | String getHandle() | setHandle(String handle) | | `PriceInCents` | `Long` | Optional | The product price point price, in integer cents | Long getPriceInCents() | setPriceInCents(Long priceInCents) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product price point, either month or day | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `TrialPriceInCents` | `Long` | Optional | The product price point trial price, in integer cents | Long getTrialPriceInCents() | setTrialPriceInCents(Long trialPriceInCents) | -| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | +| `TrialInterval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | | `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | -| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | +| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | | `IntroductoryOffer` | `Boolean` | Optional | reserved for future use | Boolean getIntroductoryOffer() | setIntroductoryOffer(Boolean introductoryOffer) | | `InitialChargeInCents` | `Long` | Optional | The product price point initial charge, in integer cents | Long getInitialChargeInCents() | setInitialChargeInCents(Long initialChargeInCents) | | `InitialChargeAfterTrial` | `Boolean` | Optional | - | Boolean getInitialChargeAfterTrial() | setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) | -| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | | `ProductId` | `Integer` | Optional | The product id this price point belongs to | Integer getProductId() | setProductId(Integer productId) | | `ArchivedAt` | `ZonedDateTime` | Optional | Timestamp indicating when this price point was archived | ZonedDateTime getArchivedAt() | setArchivedAt(ZonedDateTime archivedAt) | @@ -34,15 +34,17 @@ | `SubscriptionId` | `Integer` | Optional | The subscription id this price point belongs to | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `CurrencyPrices` | [`List`](../../doc/models/currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) +## Example -```json -{ - "id": 196, - "name": "name6", - "handle": "handle2", - "price_in_cents": 248, - "interval": 8 -} +```java +import com.maxio.advancedbilling.models.ProductPricePoint; + +ProductPricePoint productPricePoint = new ProductPricePoint.Builder() + .id(10) + .name("name0") + .handle("handle6") + .priceInCents(178L) + .interval(194) + .build(); ``` diff --git a/doc/models/product-response.md b/doc/models/product-response.md index 31b235ac..f44da9f1 100644 --- a/doc/models/product-response.md +++ b/doc/models/product-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Product` | [`Product`](../../doc/models/product.md) | Required | - | Product getProduct() | setProduct(Product product) | -## Example (as JSON) - -```json -{ - "product": { - "id": 134, - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Product; +import com.maxio.advancedbilling.models.ProductResponse; + +ProductResponse productResponse = new ProductResponse.Builder( + new Product.Builder() + .id(134) + .name("name0") + .handle("handle6") + .description("description0") + .accountingCode("accounting_code6") + .build() +) +.build(); ``` diff --git a/doc/models/product.md b/doc/models/product.md index 85ed023f..85ddf070 100644 --- a/doc/models/product.md +++ b/doc/models/product.md @@ -13,18 +13,18 @@ | `Name` | `String` | Optional | The product name | String getName() | setName(String name) | | `Handle` | `String` | Optional | The product API handle | String getHandle() | setHandle(String handle) | | `Description` | `String` | Optional | The product description | String getDescription() | setDescription(String description) | -| `AccountingCode` | `String` | Optional | E.g. Internal ID or SKU Number | String getAccountingCode() | setAccountingCode(String accountingCode) | +| `AccountingCode` | `String` | Optional | E.g., Internal ID or SKU Number | String getAccountingCode() | setAccountingCode(String accountingCode) | | `RequestCreditCard` | `Boolean` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | Boolean getRequestCreditCard() | setRequestCreditCard(Boolean requestCreditCard) | -| `ExpirationInterval` | `Integer` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `ExpirationInterval` | `Integer` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | | `CreatedAt` | `ZonedDateTime` | Optional | Timestamp indicating when this product was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | Timestamp indicating when this product was last updated | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | | `PriceInCents` | `Long` | Optional | The product price, in integer cents | Long getPriceInCents() | setPriceInCents(Long priceInCents) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product, either month or day | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `InitialChargeInCents` | `Long` | Optional | The up front charge you have specified. | Long getInitialChargeInCents() | setInitialChargeInCents(Long initialChargeInCents) | | `TrialPriceInCents` | `Long` | Optional | The price of the trial period for a subscription to this product, in integer cents. | Long getTrialPriceInCents() | setTrialPriceInCents(Long trialPriceInCents) | -| `TrialInterval` | `Integer` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | +| `TrialInterval` | `Integer` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | | `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | | `ArchivedAt` | `ZonedDateTime` | Optional | Timestamp indicating when this product was archived | ZonedDateTime getArchivedAt() | setArchivedAt(ZonedDateTime archivedAt) | | `RequireCreditCard` | `Boolean` | Optional | Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. | Boolean getRequireCreditCard() | setRequireCreditCard(Boolean requireCreditCard) | @@ -33,7 +33,7 @@ | `UpdateReturnUrl` | `String` | Optional | The url to which a customer will be returned after a successful account update | String getUpdateReturnUrl() | setUpdateReturnUrl(String updateReturnUrl) | | `InitialChargeAfterTrial` | `Boolean` | Optional | - | Boolean getInitialChargeAfterTrial() | setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) | | `VersionNumber` | `Integer` | Optional | The version of the product | Integer getVersionNumber() | setVersionNumber(Integer versionNumber) | -| `UpdateReturnParams` | `String` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) | String getUpdateReturnParams() | setUpdateReturnParams(String updateReturnParams) | +| `UpdateReturnParams` | `String` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). | String getUpdateReturnParams() | setUpdateReturnParams(String updateReturnParams) | | `ProductFamily` | [`ProductFamily`](../../doc/models/product-family.md) | Optional | - | ProductFamily getProductFamily() | setProductFamily(ProductFamily productFamily) | | `PublicSignupPages` | [`List`](../../doc/models/public-signup-page.md) | Optional | - | List getPublicSignupPages() | setPublicSignupPages(List publicSignupPages) | | `ProductPricePointName` | `String` | Optional | - | String getProductPricePointName() | setProductPricePointName(String productPricePointName) | @@ -46,16 +46,19 @@ | `ItemCategory` | `String` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | String getItemCategory() | setItemCategory(String itemCategory) | | `ProductPricePointId` | `Integer` | Optional | - | Integer getProductPricePointId() | setProductPricePointId(Integer productPricePointId) | | `ProductPricePointHandle` | `String` | Optional | - | String getProductPricePointHandle() | setProductPricePointHandle(String productPricePointHandle) | +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | -## Example (as JSON) +## Example -```json -{ - "id": 180, - "name": "name4", - "handle": "handle0", - "description": "description4", - "accounting_code": "accounting_code0" -} +```java +import com.maxio.advancedbilling.models.Product; + +Product product = new Product.Builder() + .id(134) + .name("name0") + .handle("handle6") + .description("description0") + .accountingCode("accounting_code6") + .build(); ``` diff --git a/doc/models/proforma-bad-request-error-response-exception.md b/doc/models/proforma-bad-request-error-response-exception.md index dc5fb273..1ce251cc 100644 --- a/doc/models/proforma-bad-request-error-response-exception.md +++ b/doc/models/proforma-bad-request-error-response-exception.md @@ -11,18 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`ProformaError`](../../doc/models/proforma-error.md) | Optional | - | ProformaError getErrors() | setErrors(ProformaError errors) | -## Example (as JSON) - -```json -{ - "errors": { - "subscription": { - "base": [ - "base3", - "base4" - ] - } - } +## Example + +```java +try { + // make the API call +} catch (ProformaBadRequestErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/proforma-error.md b/doc/models/proforma-error.md index c7489d2e..5f4d46f4 100644 --- a/doc/models/proforma-error.md +++ b/doc/models/proforma-error.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | [`BaseStringError`](../../doc/models/base-string-error.md) | Optional | The error is base if it is not directly associated with a single attribute. | BaseStringError getSubscription() | setSubscription(BaseStringError subscription) | -## Example (as JSON) - -```json -{ - "subscription": { - "base": [ - "base3", - "base4" - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.BaseStringError; +import com.maxio.advancedbilling.models.ProformaError; +import java.util.Arrays; + +ProformaError proformaError = new ProformaError.Builder() + .subscription(new BaseStringError.Builder() + .base(Arrays.asList( + "base3", + "base4" + )) + .build()) + .build(); ``` diff --git a/doc/models/proforma-invoice-credit.md b/doc/models/proforma-invoice-credit.md index d56a559c..70942441 100644 --- a/doc/models/proforma-invoice-credit.md +++ b/doc/models/proforma-invoice-credit.md @@ -14,14 +14,16 @@ | `OriginalAmount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | String getOriginalAmount() | setOriginalAmount(String originalAmount) | | `AppliedAmount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "memo": "memo2", - "original_amount": "original_amount2", - "applied_amount": "applied_amount0" -} +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoiceCredit; + +ProformaInvoiceCredit proformaInvoiceCredit = new ProformaInvoiceCredit.Builder() + .uid("uid4") + .memo("memo8") + .originalAmount("original_amount8") + .appliedAmount("applied_amount4") + .build(); ``` diff --git a/doc/models/proforma-invoice-discount-source-type.md b/doc/models/proforma-invoice-discount-source-type.md index 9ca7d08f..6e04c9a7 100644 --- a/doc/models/proforma-invoice-discount-source-type.md +++ b/doc/models/proforma-invoice-discount-source-type.md @@ -12,3 +12,11 @@ | `COUPON` | | `REFERRAL` | +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoiceDiscountSourceType; + +ProformaInvoiceDiscountSourceType proformaInvoiceDiscountSourceType = ProformaInvoiceDiscountSourceType.COUPON; +``` + diff --git a/doc/models/proforma-invoice-discount.md b/doc/models/proforma-invoice-discount.md index 34778da0..d9b3cf63 100644 --- a/doc/models/proforma-invoice-discount.md +++ b/doc/models/proforma-invoice-discount.md @@ -18,15 +18,19 @@ | `DiscountAmount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | String getDiscountAmount() | setDiscountAmount(String discountAmount) | | `LineItemBreakouts` | [`List`](../../doc/models/invoice-discount-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | List getLineItemBreakouts() | setLineItemBreakouts(List lineItemBreakouts) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "title": "title8", - "code": "code0", - "source_type": "Coupon", - "discount_type": "percentage" -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoiceDiscountType; +import com.maxio.advancedbilling.models.ProformaInvoiceDiscount; +import com.maxio.advancedbilling.models.ProformaInvoiceDiscountSourceType; + +ProformaInvoiceDiscount proformaInvoiceDiscount = new ProformaInvoiceDiscount.Builder() + .uid("uid2") + .title("title8") + .code("code0") + .sourceType(ProformaInvoiceDiscountSourceType.COUPON) + .discountType(InvoiceDiscountType.PERCENTAGE) + .build(); ``` diff --git a/doc/models/proforma-invoice-issued.md b/doc/models/proforma-invoice-issued.md index 9dd9e326..fa954ac4 100644 --- a/doc/models/proforma-invoice-issued.md +++ b/doc/models/proforma-invoice-issued.md @@ -21,29 +21,35 @@ | `ProductName` | `String` | Required | - | String getProductName() | setProductName(String productName) | | `LineItems` | [`List`](../../doc/models/invoice-line-item-event-data.md) | Required | - | List getLineItems() | setLineItems(List lineItems) | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "number": "number2", - "role": "role6", - "delivery_date": "2016-03-13", - "created_at": "2016-03-13T12:52:32.123Z", - "due_amount": "due_amount2", - "paid_amount": "paid_amount8", - "tax_amount": "tax_amount6", - "total_amount": "total_amount6", - "product_name": "product_name6", - "line_items": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.InvoiceLineItemEventData; +import com.maxio.advancedbilling.models.ProformaInvoiceIssued; +import java.util.Arrays; + +ProformaInvoiceIssued proformaInvoiceIssued = new ProformaInvoiceIssued.Builder( + "uid6", + "number4", + "role0", + DateTimeHelper.fromSimpleDate("2016-03-13"), + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + "due_amount8", + "paid_amount8", + "tax_amount0", + "total_amount2", + "product_name2", + Arrays.asList( + new InvoiceLineItemEventData.Builder() + .uid("uid8") + .title("title4") + .description("description8") + .quantity(102) + .quantityDelta(204) + .build() + ) +) +.build(); ``` diff --git a/doc/models/proforma-invoice-payment.md b/doc/models/proforma-invoice-payment.md index 55a626b3..8158e6eb 100644 --- a/doc/models/proforma-invoice-payment.md +++ b/doc/models/proforma-invoice-payment.md @@ -14,14 +14,16 @@ | `AppliedAmount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | | `Prepayment` | `Boolean` | Optional | - | Boolean getPrepayment() | setPrepayment(Boolean prepayment) | -## Example (as JSON) - -```json -{ - "memo": "memo4", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "prepayment": false -} +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoicePayment; + +ProformaInvoicePayment proformaInvoicePayment = new ProformaInvoicePayment.Builder() + .memo("memo2") + .originalAmount("original_amount2") + .appliedAmount("applied_amount0") + .prepayment(false) + .build(); ``` diff --git a/doc/models/proforma-invoice-role.md b/doc/models/proforma-invoice-role.md index 1ccf553b..757cdf6e 100644 --- a/doc/models/proforma-invoice-role.md +++ b/doc/models/proforma-invoice-role.md @@ -1,7 +1,7 @@ # Proforma Invoice Role -'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic +'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. ## Enumeration @@ -16,3 +16,11 @@ | `PROFORMA_ADHOC` | | `PROFORMA_AUTOMATIC` | +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoiceRole; + +ProformaInvoiceRole proformaInvoiceRole = ProformaInvoiceRole.UNSET; +``` + diff --git a/doc/models/proforma-invoice-status.md b/doc/models/proforma-invoice-status.md index 73e3ddef..80ef6583 100644 --- a/doc/models/proforma-invoice-status.md +++ b/doc/models/proforma-invoice-status.md @@ -13,3 +13,11 @@ | `VOIDED` | | `ARCHIVED` | +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoiceStatus; + +ProformaInvoiceStatus proformaInvoiceStatus = ProformaInvoiceStatus.DRAFT; +``` + diff --git a/doc/models/proforma-invoice-tax-source-type.md b/doc/models/proforma-invoice-tax-source-type.md index fab176de..5f0496b2 100644 --- a/doc/models/proforma-invoice-tax-source-type.md +++ b/doc/models/proforma-invoice-tax-source-type.md @@ -12,3 +12,11 @@ | `TAX` | | `AVALARA` | +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoiceTaxSourceType; + +ProformaInvoiceTaxSourceType proformaInvoiceTaxSourceType = ProformaInvoiceTaxSourceType.TAX; +``` + diff --git a/doc/models/proforma-invoice-tax.md b/doc/models/proforma-invoice-tax.md index 4c8c8445..c9772033 100644 --- a/doc/models/proforma-invoice-tax.md +++ b/doc/models/proforma-invoice-tax.md @@ -17,15 +17,18 @@ | `TaxAmount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | String getTaxAmount() | setTaxAmount(String taxAmount) | | `LineItemBreakouts` | [`List`](../../doc/models/invoice-tax-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | List getLineItemBreakouts() | setLineItemBreakouts(List lineItemBreakouts) | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title4", - "source_type": "Tax", - "percentage": "percentage6", - "taxable_amount": "taxable_amount2" -} +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoiceTax; +import com.maxio.advancedbilling.models.ProformaInvoiceTaxSourceType; + +ProformaInvoiceTax proformaInvoiceTax = new ProformaInvoiceTax.Builder() + .uid("uid4") + .title("title0") + .sourceType(ProformaInvoiceTaxSourceType.TAX) + .percentage("percentage2") + .taxableAmount("taxable_amount8") + .build(); ``` diff --git a/doc/models/proforma-invoice.md b/doc/models/proforma-invoice.md index 67b096f1..8a417db9 100644 --- a/doc/models/proforma-invoice.md +++ b/doc/models/proforma-invoice.md @@ -21,12 +21,12 @@ | `CollectionMethod` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | CollectionMethod getCollectionMethod() | setCollectionMethod(CollectionMethod collectionMethod) | | `PaymentInstructions` | `String` | Optional | - | String getPaymentInstructions() | setPaymentInstructions(String paymentInstructions) | | `Currency` | `String` | Optional | - | String getCurrency() | setCurrency(String currency) | -| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | +| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | | `ProductName` | `String` | Optional | - | String getProductName() | setProductName(String productName) | | `ProductFamilyName` | `String` | Optional | - | String getProductFamilyName() | setProductFamilyName(String productFamilyName) | -| `Role` | [`ProformaInvoiceRole`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic | ProformaInvoiceRole getRole() | setRole(ProformaInvoiceRole role) | +| `Role` | [`ProformaInvoiceRole`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. | ProformaInvoiceRole getRole() | setRole(ProformaInvoiceRole role) | | `Seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | InvoiceSeller getSeller() | setSeller(InvoiceSeller seller) | -| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | +| `Customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | InvoiceCustomer getCustomer() | setCustomer(InvoiceCustomer customer) | | `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | | `BillingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | InvoiceAddress getBillingAddress() | setBillingAddress(InvoiceAddress billingAddress) | | `ShippingAddress` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | InvoiceAddress getShippingAddress() | setShippingAddress(InvoiceAddress shippingAddress) | @@ -47,15 +47,17 @@ | `PublicUrl` | `String` | Optional | - | String getPublicUrl() | setPublicUrl(String publicUrl) | | `AvailableActions` | [`AvailableActions`](../../doc/models/available-actions.md) | Optional | - | AvailableActions getAvailableActions() | setAvailableActions(AvailableActions availableActions) | -## Example (as JSON) +## Example -```json -{ - "uid": "uid6", - "site_id": 196, - "customer_id": 52, - "subscription_id": 124, - "number": 0 -} +```java +import com.maxio.advancedbilling.models.ProformaInvoice; + +ProformaInvoice proformaInvoice = new ProformaInvoice.Builder() + .uid("uid8") + .siteId(94) + .customerId(206) + .subscriptionId(22) + .number(102) + .build(); ``` diff --git a/doc/models/proration.md b/doc/models/proration.md index 395a7a15..66efda59 100644 --- a/doc/models/proration.md +++ b/doc/models/proration.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `PreservePeriod` | `Boolean` | Optional | The alternative to sending preserve_period as a direct attribute to migration | Boolean getPreservePeriod() | setPreservePeriod(Boolean preservePeriod) | -## Example (as JSON) +## Example -```json -{ - "preserve_period": false -} +```java +import com.maxio.advancedbilling.models.Proration; + +Proration proration = new Proration.Builder() + .preservePeriod(false) + .build(); ``` diff --git a/doc/models/public-key.md b/doc/models/public-key.md index 94122275..078c4f14 100644 --- a/doc/models/public-key.md +++ b/doc/models/public-key.md @@ -13,13 +13,16 @@ | `RequiresSecurityToken` | `Boolean` | Optional | - | Boolean getRequiresSecurityToken() | setRequiresSecurityToken(Boolean requiresSecurityToken) | | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | -## Example (as JSON) - -```json -{ - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.PublicKey; + +PublicKey publicKey = new PublicKey.Builder() + .publicKey("public_key2") + .requiresSecurityToken(false) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/public-signup-page.md b/doc/models/public-signup-page.md index 3c742bec..6c3b40ff 100644 --- a/doc/models/public-signup-page.md +++ b/doc/models/public-signup-page.md @@ -10,18 +10,20 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Id` | `Integer` | Optional | The id of the signup page (public_signup_pages only) | Integer getId() | setId(Integer id) | -| `ReturnUrl` | `String` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only) | String getReturnUrl() | setReturnUrl(String returnUrl) | +| `ReturnUrl` | `String` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only). | String getReturnUrl() | setReturnUrl(String returnUrl) | | `ReturnParams` | `String` | Optional | The params to be appended to the return_url (public_signup_pages only) | String getReturnParams() | setReturnParams(String returnParams) | -| `Url` | `String` | Optional | The url where the signup page can be viewed (public_signup_pages only) | String getUrl() | setUrl(String url) | +| `Url` | `String` | Optional | The url where the signup page can be viewed (public_signup_pages only). | String getUrl() | setUrl(String url) | -## Example (as JSON) +## Example -```json -{ - "id": 6, - "return_url": "return_url0", - "return_params": "return_params2", - "url": "url8" -} +```java +import com.maxio.advancedbilling.models.PublicSignupPage; + +PublicSignupPage publicSignupPage = new PublicSignupPage.Builder() + .id(20) + .returnUrl("return_url0") + .returnParams("return_params2") + .url("url8") + .build(); ``` diff --git a/doc/models/q-scope.md b/doc/models/q-scope.md new file mode 100644 index 00000000..1a7c1481 --- /dev/null +++ b/doc/models/q-scope.md @@ -0,0 +1,26 @@ + +# Q Scope + +## Enumeration + +`QScope` + +## Fields + +| Name | +| --- | +| `FULL_NAME` | +| `FIRST_NAME` | +| `LAST_NAME` | +| `ORGANIZATION` | +| `CUSTOMER_REFERENCE` | +| `SUBSCRIPTION_REFERENCE` | + +## Example + +```java +import com.maxio.advancedbilling.models.QScope; + +QScope qScope = QScope.LAST_NAME; +``` + diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index f4adb89e..e9bee742 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | String getName() | setName(String name) | -| `UnitName` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | String getUnitName() | setUnitName(String unitName) | +| `Name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | String getName() | setName(String name) | +| `UnitName` | `String` | Required | “The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item.” | String getUnitName() | setUnitName(String unitName) | | `Description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | String getDescription() | setDescription(String description) | -| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | +| `Handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | String getHandle() | setHandle(String handle) | | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | @@ -26,27 +26,45 @@ | `DisplayOnHostedPage` | `Boolean` | Optional | - | Boolean getDisplayOnHostedPage() | setDisplayOnHostedPage(Boolean displayOnHostedPage) | | `AllowFractionalQuantities` | `Boolean` | Optional | - | Boolean getAllowFractionalQuantities() | setAllowFractionalQuantities(Boolean allowFractionalQuantities) | | `PublicSignupPageIds` | `List` | Optional | - | List getPublicSignupPageIds() | setPublicSignupPageIds(List publicSignupPageIds) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component’s default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | -## Example (as JSON) - -```json -{ - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "full" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreditType; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.QuantityBasedComponent; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +QuantityBasedComponent quantityBasedComponent = new QuantityBasedComponent.Builder( + "name0", + "unit_name2", + PricingScheme.PER_UNIT +) +.description("description0") +.handle("handle6") +.taxable(false) +.prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) +.upgradeCharge(CreditType.FULL) +.build(); ``` diff --git a/doc/models/reactivate-subscription-group-request.md b/doc/models/reactivate-subscription-group-request.md index a8db84db..47eda494 100644 --- a/doc/models/reactivate-subscription-group-request.md +++ b/doc/models/reactivate-subscription-group-request.md @@ -12,12 +12,14 @@ | `Resume` | `Boolean` | Optional | - | Boolean getResume() | setResume(Boolean resume) | | `ResumeMembers` | `Boolean` | Optional | - | Boolean getResumeMembers() | setResumeMembers(Boolean resumeMembers) | -## Example (as JSON) +## Example -```json -{ - "resume": false, - "resume_members": false -} +```java +import com.maxio.advancedbilling.models.ReactivateSubscriptionGroupRequest; + +ReactivateSubscriptionGroupRequest reactivateSubscriptionGroupRequest = new ReactivateSubscriptionGroupRequest.Builder() + .resume(false) + .resumeMembers(false) + .build(); ``` diff --git a/doc/models/reactivate-subscription-group-response.md b/doc/models/reactivate-subscription-group-response.md index 1866f0ea..01cac57d 100644 --- a/doc/models/reactivate-subscription-group-response.md +++ b/doc/models/reactivate-subscription-group-response.md @@ -19,18 +19,22 @@ | `State` | `String` | Optional | - | String getState() | setState(String state) | | `CancelAtEndOfPeriod` | `Boolean` | Optional | - | Boolean getCancelAtEndOfPeriod() | setCancelAtEndOfPeriod(Boolean cancelAtEndOfPeriod) | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "scheme": 66, - "customer_id": 86, - "payment_profile_id": 250, - "subscription_ids": [ - 196, - 197 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ReactivateSubscriptionGroupResponse; +import java.util.Arrays; + +ReactivateSubscriptionGroupResponse reactivateSubscriptionGroupResponse = new ReactivateSubscriptionGroupResponse.Builder() + .uid("uid0") + .scheme(10) + .customerId(30) + .paymentProfileId(62) + .subscriptionIds(Arrays.asList( + 140, + 141, + 142 + )) + .build(); ``` diff --git a/doc/models/reactivate-subscription-request.md b/doc/models/reactivate-subscription-request.md index e6e3bdd2..bed17b9a 100644 --- a/doc/models/reactivate-subscription-request.md +++ b/doc/models/reactivate-subscription-request.md @@ -9,24 +9,28 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `CalendarBilling` | [`ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing | ReactivationBilling getCalendarBilling() | setCalendarBilling(ReactivationBilling calendarBilling) | +| `CalendarBilling` | [`ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing. | ReactivationBilling getCalendarBilling() | setCalendarBilling(ReactivationBilling calendarBilling) | | `IncludeTrial` | `Boolean` | Optional | If `true` is sent, the reactivated Subscription will include a trial if one is available. If `false` is sent, the trial period will be ignored. | Boolean getIncludeTrial() | setIncludeTrial(Boolean includeTrial) | | `PreserveBalance` | `Boolean` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | Boolean getPreserveBalance() | setPreserveBalance(Boolean preserveBalance) | | `CouponCode` | `String` | Optional | The coupon code to be applied during reactivation. | String getCouponCode() | setCouponCode(String couponCode) | | `UseCreditsAndPrepayments` | `Boolean` | Optional | If true is sent, Advanced Billing will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | Boolean getUseCreditsAndPrepayments() | setUseCreditsAndPrepayments(Boolean useCreditsAndPrepayments) | | `Resume` | [`ReactivateSubscriptionRequestResume`](../../doc/models/containers/reactivate-subscription-request-resume.md) | Optional | This is a container for one-of cases. | ReactivateSubscriptionRequestResume getResume() | setResume(ReactivateSubscriptionRequestResume resume) | -## Example (as JSON) - -```json -{ - "calendar_billing": { - "reactivation_charge": "prorated" - }, - "include_trial": false, - "preserve_balance": false, - "coupon_code": "coupon_code6", - "use_credits_and_prepayments": false -} +## Example + +```java +import com.maxio.advancedbilling.models.ReactivateSubscriptionRequest; +import com.maxio.advancedbilling.models.ReactivationBilling; +import com.maxio.advancedbilling.models.ReactivationCharge; + +ReactivateSubscriptionRequest reactivateSubscriptionRequest = new ReactivateSubscriptionRequest.Builder() + .calendarBilling(new ReactivationBilling.Builder() + .reactivationCharge(ReactivationCharge.PRORATED) + .build()) + .includeTrial(false) + .preserveBalance(false) + .couponCode("coupon_code2") + .useCreditsAndPrepayments(false) + .build(); ``` diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index e5855c4c..d1e132f0 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -1,7 +1,7 @@ # Reactivation Billing -These values are only applicable to subscriptions using calendar billing +These values are only applicable to subscriptions using calendar billing. ## Structure @@ -11,13 +11,16 @@ These values are only applicable to subscriptions using calendar billing | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `ReactivationCharge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

**Default**: `ReactivationCharge.PRORATED` | ReactivationCharge getReactivationCharge() | setReactivationCharge(ReactivationCharge reactivationCharge) | +| `ReactivationCharge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal.

**Default**: `ReactivationCharge.PRORATED` | ReactivationCharge getReactivationCharge() | setReactivationCharge(ReactivationCharge reactivationCharge) | -## Example (as JSON) +## Example -```json -{ - "reactivation_charge": "prorated" -} +```java +import com.maxio.advancedbilling.models.ReactivationBilling; +import com.maxio.advancedbilling.models.ReactivationCharge; + +ReactivationBilling reactivationBilling = new ReactivationBilling.Builder() + .reactivationCharge(ReactivationCharge.PRORATED) + .build(); ``` diff --git a/doc/models/reactivation-charge.md b/doc/models/reactivation-charge.md index dbe0bc6e..b9653d5d 100644 --- a/doc/models/reactivation-charge.md +++ b/doc/models/reactivation-charge.md @@ -1,7 +1,7 @@ # Reactivation Charge -You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal +You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal. ## Enumeration @@ -15,3 +15,11 @@ You may choose how to handle the reactivation charge for that subscription: 1) ` | `IMMEDIATE` | | `DELAYED` | +## Example + +```java +import com.maxio.advancedbilling.models.ReactivationCharge; + +ReactivationCharge reactivationCharge = ReactivationCharge.IMMEDIATE; +``` + diff --git a/doc/models/read-events-count-input.md b/doc/models/read-events-count-input.md index 96c967c9..7d1b0bc3 100644 --- a/doc/models/read-events-count-input.md +++ b/doc/models/read-events-count-input.md @@ -13,8 +13,8 @@ Input structure for the method ReadEventsCount | --- | --- | --- | --- | --- | --- | | `Page` | `Integer` | Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | Integer getPage() | setPage(Integer page) | | `PerPage` | `Integer` | Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | Integer getPerPage() | setPerPage(Integer perPage) | -| `SinceId` | `Long` | Optional | Returns events with an id greater than or equal to the one specified | Long getSinceId() | setSinceId(Long sinceId) | -| `MaxId` | `Long` | Optional | Returns events with an id less than or equal to the one specified | Long getMaxId() | setMaxId(Long maxId) | +| `SinceId` | `Long` | Optional | Returns events with an id greater than or equal to the one specified. | Long getSinceId() | setSinceId(Long sinceId) | +| `MaxId` | `Long` | Optional | Returns events with an id less than or equal to the one specified. | Long getMaxId() | setMaxId(Long maxId) | | `Direction` | [`Direction`](../../doc/models/direction.md) | Optional | The sort direction of the returned events.

**Default**: `Direction.DESC` | Direction getDirection() | setDirection(Direction direction) | | `Filter` | [`List`](../../doc/models/event-key.md) | Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | List getFilter() | setFilter(List filter) | diff --git a/doc/models/reason-code-response.md b/doc/models/reason-code-response.md index 0635b534..cb0badba 100644 --- a/doc/models/reason-code-response.md +++ b/doc/models/reason-code-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `ReasonCode` | [`ReasonCode`](../../doc/models/reason-code.md) | Required | - | ReasonCode getReasonCode() | setReasonCode(ReasonCode reasonCode) | -## Example (as JSON) - -```json -{ - "reason_code": { - "id": 240, - "site_id": 166, - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ReasonCode; +import com.maxio.advancedbilling.models.ReasonCodeResponse; + +ReasonCodeResponse reasonCodeResponse = new ReasonCodeResponse.Builder( + new ReasonCode.Builder() + .id(240) + .siteId(166) + .code("code4") + .description("description6") + .position(14) + .build() +) +.build(); ``` diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md index 29960a11..d8f88106 100644 --- a/doc/models/reason-code.md +++ b/doc/models/reason-code.md @@ -17,15 +17,17 @@ | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -## Example (as JSON) - -```json -{ - "id": 164, - "site_id": 90, - "code": "code0", - "description": "description2", - "position": 194 -} +## Example + +```java +import com.maxio.advancedbilling.models.ReasonCode; + +ReasonCode reasonCode = new ReasonCode.Builder() + .id(174) + .siteId(100) + .code("code4") + .description("description6") + .position(204) + .build(); ``` diff --git a/doc/models/record-payment-request.md b/doc/models/record-payment-request.md index c61de6fb..39f466d2 100644 --- a/doc/models/record-payment-request.md +++ b/doc/models/record-payment-request.md @@ -11,16 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Payment` | [`CreatePayment`](../../doc/models/create-payment.md) | Required | - | CreatePayment getPayment() | setPayment(CreatePayment payment) | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "amount8", - "memo": "memo0", - "payment_details": "payment_details6", - "payment_method": "cash" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreatePayment; +import com.maxio.advancedbilling.models.InvoicePaymentMethodType; +import com.maxio.advancedbilling.models.RecordPaymentRequest; + +RecordPaymentRequest recordPaymentRequest = new RecordPaymentRequest.Builder( + new CreatePayment.Builder( + "amount8", + "memo0", + "payment_details6", + InvoicePaymentMethodType.CASH + ) + .build() +) +.build(); ``` diff --git a/doc/models/record-payment-response.md b/doc/models/record-payment-response.md index 7a56e611..97512ebd 100644 --- a/doc/models/record-payment-response.md +++ b/doc/models/record-payment-response.md @@ -12,35 +12,29 @@ | `PaidInvoices` | [`List`](../../doc/models/paid-invoice.md) | Optional | - | List getPaidInvoices() | setPaidInvoices(List paidInvoices) | | `Prepayment` | [`InvoicePrePayment`](../../doc/models/invoice-pre-payment.md) | Optional | - | InvoicePrePayment getPrepayment() | setPrepayment(InvoicePrePayment prepayment) | -## Example (as JSON) - -```json -{ - "paid_invoices": [ - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - } - ], - "prepayment": { - "subscription_id": 148, - "amount_in_cents": 124, - "ending_balance_in_cents": 164 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.InvoicePrePayment; +import com.maxio.advancedbilling.models.InvoiceStatus; +import com.maxio.advancedbilling.models.PaidInvoice; +import com.maxio.advancedbilling.models.RecordPaymentResponse; +import java.util.Arrays; + +RecordPaymentResponse recordPaymentResponse = new RecordPaymentResponse.Builder() + .paidInvoices(Arrays.asList( + new PaidInvoice.Builder() + .invoiceId("invoice_id8") + .status(InvoiceStatus.DRAFT) + .dueAmount("due_amount0") + .paidAmount("paid_amount0") + .build() + )) + .prepayment(new InvoicePrePayment.Builder() + .subscriptionId(148) + .amountInCents(124L) + .endingBalanceInCents(164L) + .build()) + .build(); ``` diff --git a/doc/models/recurring-scheme.md b/doc/models/recurring-scheme.md index 8e378217..8ae770f1 100644 --- a/doc/models/recurring-scheme.md +++ b/doc/models/recurring-scheme.md @@ -13,3 +13,11 @@ | `RECUR_INDEFINITELY` | | `RECUR_WITH_DURATION` | +## Example + +```java +import com.maxio.advancedbilling.models.RecurringScheme; + +RecurringScheme recurringScheme = RecurringScheme.RECUR_INDEFINITELY; +``` + diff --git a/doc/models/referral-code.md b/doc/models/referral-code.md index 749e3c5a..1ece44aa 100644 --- a/doc/models/referral-code.md +++ b/doc/models/referral-code.md @@ -14,14 +14,16 @@ | `SubscriptionId` | `Integer` | Optional | - | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `Code` | `String` | Optional | - | String getCode() | setCode(String code) | -## Example (as JSON) - -```json -{ - "id": 42, - "site_id": 224, - "subscription_id": 152, - "code": "code6" -} +## Example + +```java +import com.maxio.advancedbilling.models.ReferralCode; + +ReferralCode referralCode = new ReferralCode.Builder() + .id(186) + .siteId(112) + .subscriptionId(40) + .code("code6") + .build(); ``` diff --git a/doc/models/referral-validation-response.md b/doc/models/referral-validation-response.md index a585ce7c..461f6689 100644 --- a/doc/models/referral-validation-response.md +++ b/doc/models/referral-validation-response.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | --- | --- | | `ReferralCode` | [`ReferralCode`](../../doc/models/referral-code.md) | Optional | - | ReferralCode getReferralCode() | setReferralCode(ReferralCode referralCode) | -## Example (as JSON) - -```json -{ - "referral_code": { - "id": 46, - "site_id": 228, - "subscription_id": 156, - "code": "code0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ReferralCode; +import com.maxio.advancedbilling.models.ReferralValidationResponse; + +ReferralValidationResponse referralValidationResponse = new ReferralValidationResponse.Builder() + .referralCode(new ReferralCode.Builder() + .id(46) + .siteId(228) + .subscriptionId(156) + .code("code0") + .build()) + .build(); ``` diff --git a/doc/models/refund-consolidated-invoice.md b/doc/models/refund-consolidated-invoice.md index b0abaa29..f66a45fb 100644 --- a/doc/models/refund-consolidated-invoice.md +++ b/doc/models/refund-consolidated-invoice.md @@ -1,7 +1,7 @@ # Refund Consolidated Invoice -Refund consolidated invoice +Refund consolidated invoice. ## Structure @@ -18,19 +18,26 @@ Refund consolidated invoice | `ApplyCredit` | `Boolean` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | Boolean getApplyCredit() | setApplyCredit(Boolean applyCredit) | | `Amount` | `String` | Optional | The amount of payment to be refunded in decimal format. Example: "10.50". This will default to the full amount of the payment if not provided. | String getAmount() | setAmount(String amount) | -## Example (as JSON) - -```json -{ - "memo": "memo0", - "payment_id": 46, - "segment_uids": [ - "String0", - "String1" - ], - "external": false, - "apply_credit": false, - "amount": "amount8" -} +## Example + +```java +import com.maxio.advancedbilling.models.RefundConsolidatedInvoice; +import com.maxio.advancedbilling.models.containers.RefundConsolidatedInvoiceSegmentUids; +import java.util.Arrays; + +RefundConsolidatedInvoice refundConsolidatedInvoice = new RefundConsolidatedInvoice.Builder( + "memo0", + 138, + RefundConsolidatedInvoiceSegmentUids.fromListOfString( + Arrays.asList( + "String0", + "String1" + ) + ) +) +.external(false) +.applyCredit(false) +.amount("amount8") +.build(); ``` diff --git a/doc/models/refund-invoice-event-data.md b/doc/models/refund-invoice-event-data.md index 4df78410..d30fa07f 100644 --- a/doc/models/refund-invoice-event-data.md +++ b/doc/models/refund-invoice-event-data.md @@ -12,7 +12,7 @@ Example schema for an `refund_invoice` event | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `ApplyCredit` | `boolean` | Required | If true, credit was created and applied it to the invoice. | boolean getApplyCredit() | setApplyCredit(boolean applyCredit) | -| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | +| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | | `CreditNoteAttributes` | [`CreditNote`](../../doc/models/credit-note.md) | Required | - | CreditNote getCreditNoteAttributes() | setCreditNoteAttributes(CreditNote creditNoteAttributes) | | `Memo` | `String` | Optional | The refund memo. | String getMemo() | setMemo(String memo) | | `OriginalAmount` | `String` | Optional | The full, original amount of the refund. | String getOriginalAmount() | setOriginalAmount(String originalAmount) | @@ -21,25 +21,31 @@ Example schema for an `refund_invoice` event | `RefundId` | `int` | Required | The ID of the refund transaction. | int getRefundId() | setRefundId(int refundId) | | `TransactionTime` | `ZonedDateTime` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | ZonedDateTime getTransactionTime() | setTransactionTime(ZonedDateTime transactionTime) | -## Example (as JSON) - -```json -{ - "apply_credit": false, - "consolidation_level": "parent", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 114, - "refund_amount": "refund_amount8", - "refund_id": 158, - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.RefundInvoiceEventData; + +RefundInvoiceEventData refundInvoiceEventData = new RefundInvoiceEventData.Builder( + false, + new CreditNote.Builder() + .uid("uid2") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number("number0") + .build(), + 140, + "refund_amount8", + 184, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") +) +.consolidationLevel(InvoiceConsolidationLevel.PARENT) +.memo("memo0") +.originalAmount("original_amount0") +.build(); ``` diff --git a/doc/models/refund-invoice-event.md b/doc/models/refund-invoice-event.md index 8a822210..129e400f 100644 --- a/doc/models/refund-invoice-event.md +++ b/doc/models/refund-invoice-event.md @@ -15,41 +15,51 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.REFUND_INVOICE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`RefundInvoiceEventData`](../../doc/models/refund-invoice-event-data.md) | Required | Example schema for an `refund_invoice` event | RefundInvoiceEventData getEventData() | setEventData(RefundInvoiceEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 54, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "refund_invoice", - "event_data": { - "apply_credit": false, - "consolidation_level": "child", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 204, - "refund_amount": "refund_amount8", - "refund_id": 248, - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.RefundInvoiceEvent; +import com.maxio.advancedbilling.models.RefundInvoiceEventData; + +RefundInvoiceEvent refundInvoiceEvent = new RefundInvoiceEvent.Builder( + 132L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.REFUND_INVOICE, + new RefundInvoiceEventData.Builder( + false, + new CreditNote.Builder() + .uid("uid2") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number("number0") + .build(), + 204, + "refund_amount8", + 248, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") + ) + .consolidationLevel(InvoiceConsolidationLevel.CHILD) + .memo("memo0") + .originalAmount("original_amount0") + .build() +) +.build(); ``` diff --git a/doc/models/refund-invoice-request.md b/doc/models/refund-invoice-request.md index 561f2cb2..5994fde9 100644 --- a/doc/models/refund-invoice-request.md +++ b/doc/models/refund-invoice-request.md @@ -11,18 +11,26 @@ | --- | --- | --- | --- | --- | --- | | `Refund` | [`RefundInvoiceRequestRefund`](../../doc/models/containers/refund-invoice-request-refund.md) | Required | This is a container for any-of cases. | RefundInvoiceRequestRefund getRefund() | setRefund(RefundInvoiceRequestRefund refund) | -## Example (as JSON) - -```json -{ - "refund": { - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false - } -} +## Example + +```java +import com.maxio.advancedbilling.models.RefundInvoice; +import com.maxio.advancedbilling.models.RefundInvoiceRequest; +import com.maxio.advancedbilling.models.containers.RefundInvoiceRequestRefund; + +RefundInvoiceRequest refundInvoiceRequest = new RefundInvoiceRequest.Builder( + RefundInvoiceRequestRefund.fromRefundInvoice( + new RefundInvoice.Builder( + "amount8", + "memo0", + 0 + ) + .external(false) + .applyCredit(false) + .voidInvoice(false) + .build() + ) +) +.build(); ``` diff --git a/doc/models/refund-invoice.md b/doc/models/refund-invoice.md index 8c8d0a2b..2922c069 100644 --- a/doc/models/refund-invoice.md +++ b/doc/models/refund-invoice.md @@ -16,18 +16,21 @@ Refund an invoice or a segment of a consolidated invoice. | `PaymentId` | `int` | Required | The ID of the payment to be refunded | int getPaymentId() | setPaymentId(int paymentId) | | `External` | `Boolean` | Optional | Flag that marks refund as external (no money is returned to the customer). Defaults to `false`. | Boolean getExternal() | setExternal(Boolean external) | | `ApplyCredit` | `Boolean` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | Boolean getApplyCredit() | setApplyCredit(Boolean applyCredit) | -| `VoidInvoice` | `Boolean` | Optional | If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, invoice will be voided after refund. Defaults to `false`. | Boolean getVoidInvoice() | setVoidInvoice(Boolean voidInvoice) | - -## Example (as JSON) - -```json -{ - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false -} +| `VoidInvoice` | `Boolean` | Optional | If `apply_credit` is set to false and refunding full amount, if `void_invoice` is set to true, invoice will be voided after refund. Defaults to `false`. | Boolean getVoidInvoice() | setVoidInvoice(Boolean voidInvoice) | + +## Example + +```java +import com.maxio.advancedbilling.models.RefundInvoice; + +RefundInvoice refundInvoice = new RefundInvoice.Builder( + "amount2", + "memo4", + 36 +) +.external(false) +.applyCredit(false) +.voidInvoice(false) +.build(); ``` diff --git a/doc/models/refund-prepayment-base-errors-response-exception.md b/doc/models/refund-prepayment-base-errors-response-exception.md index d878608a..d07838d7 100644 --- a/doc/models/refund-prepayment-base-errors-response-exception.md +++ b/doc/models/refund-prepayment-base-errors-response-exception.md @@ -13,20 +13,15 @@ Errors returned on creating a refund prepayment when bad request | --- | --- | --- | --- | --- | --- | | `Errors` | [`RefundPrepaymentBaseRefundError`](../../doc/models/refund-prepayment-base-refund-error.md) | Optional | - | RefundPrepaymentBaseRefundError getErrors() | setErrors(RefundPrepaymentBaseRefundError errors) | -## Example (as JSON) - -```json -{ - "errors": { - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } - } +## Example + +```java +try { + // make the API call +} catch (RefundPrepaymentBaseErrorsResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/refund-prepayment-base-refund-error.md b/doc/models/refund-prepayment-base-refund-error.md index 673618f8..a67ae7ca 100644 --- a/doc/models/refund-prepayment-base-refund-error.md +++ b/doc/models/refund-prepayment-base-refund-error.md @@ -11,18 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Refund` | [`BaseRefundError`](../../doc/models/base-refund-error.md) | Optional | - | BaseRefundError getRefund() | setRefund(BaseRefundError refund) | -## Example (as JSON) - -```json -{ - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.ApiHelper; +import com.maxio.advancedbilling.models.BaseRefundError; +import com.maxio.advancedbilling.models.RefundPrepaymentBaseRefundError; +import java.io.IOException; +import java.util.Arrays; + +RefundPrepaymentBaseRefundError refundPrepaymentBaseRefundError = new RefundPrepaymentBaseRefundError.Builder() + .refund(new BaseRefundError.Builder() + .base(Arrays.asList( + ApiHelper.deserialize("{\"key1\":\"val1\",\"key2\":\"val2\"}") + )) + .build()) + .build(); ``` diff --git a/doc/models/refund-prepayment-request.md b/doc/models/refund-prepayment-request.md index 4bb052d1..1104e8de 100644 --- a/doc/models/refund-prepayment-request.md +++ b/doc/models/refund-prepayment-request.md @@ -11,16 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `Refund` | [`RefundPrepayment`](../../doc/models/refund-prepayment.md) | Required | - | RefundPrepayment getRefund() | setRefund(RefundPrepayment refund) | -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": 132, - "amount": "String1", - "memo": "memo2", - "external": false - } -} +## Example + +```java +import com.maxio.advancedbilling.models.RefundPrepayment; +import com.maxio.advancedbilling.models.RefundPrepaymentRequest; +import com.maxio.advancedbilling.models.containers.RefundPrepaymentAmount; + +RefundPrepaymentRequest refundPrepaymentRequest = new RefundPrepaymentRequest.Builder( + new RefundPrepayment.Builder( + 132L, + RefundPrepaymentAmount.fromString( + "String1" + ), + "memo2" + ) + .external(false) + .build() +) +.build(); ``` diff --git a/doc/models/refund-prepayment.md b/doc/models/refund-prepayment.md index 94326c2a..91e7b80a 100644 --- a/doc/models/refund-prepayment.md +++ b/doc/models/refund-prepayment.md @@ -14,14 +14,20 @@ | `Memo` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getMemo() | setMemo(String memo) | | `External` | `Boolean` | Optional | Specify the type of refund you wish to initiate. When the prepayment is external, the `external` flag is optional. But if the prepayment was made through a payment profile, the `external` flag is required. | Boolean getExternal() | setExternal(Boolean external) | -## Example (as JSON) - -```json -{ - "amount_in_cents": 110, - "amount": "String3", - "memo": "memo4", - "external": false -} +## Example + +```java +import com.maxio.advancedbilling.models.RefundPrepayment; +import com.maxio.advancedbilling.models.containers.RefundPrepaymentAmount; + +RefundPrepayment refundPrepayment = new RefundPrepayment.Builder( + 22L, + RefundPrepaymentAmount.fromString( + "String1" + ), + "memo2" +) +.external(false) +.build(); ``` diff --git a/doc/models/refund-success.md b/doc/models/refund-success.md index 912cd84c..08394377 100644 --- a/doc/models/refund-success.md +++ b/doc/models/refund-success.md @@ -13,13 +13,16 @@ | `GatewayTransactionId` | `int` | Required | - | int getGatewayTransactionId() | setGatewayTransactionId(int gatewayTransactionId) | | `ProductId` | `int` | Required | - | int getProductId() | setProductId(int productId) | -## Example (as JSON) - -```json -{ - "refund_id": 12, - "gateway_transaction_id": 182, - "product_id": 168 -} +## Example + +```java +import com.maxio.advancedbilling.models.RefundSuccess; + +RefundSuccess refundSuccess = new RefundSuccess.Builder( + 34, + 160, + 190 +) +.build(); ``` diff --git a/doc/models/register.md b/doc/models/register.md index f279af67..9af7f5b9 100644 --- a/doc/models/register.md +++ b/doc/models/register.md @@ -12,16 +12,18 @@ | `Id` | `Integer` | Optional | - | Integer getId() | setId(Integer id) | | `MaxioId` | `String` | Optional | - | String getMaxioId() | setMaxioId(String maxioId) | | `Name` | `String` | Optional | - | String getName() | setName(String name) | -| `CurrencyCode` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | String getCurrencyCode() | setCurrencyCode(String currencyCode) | +| `CurrencyCode` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of an invoice transaction. | String getCurrencyCode() | setCurrencyCode(String currencyCode) | -## Example (as JSON) +## Example -```json -{ - "id": 90, - "maxio_id": "maxio_id0", - "name": "name6", - "currency_code": "currency_code2" -} +```java +import com.maxio.advancedbilling.models.Register; + +Register register = new Register.Builder() + .id(54) + .maxioId("maxio_id4") + .name("name2") + .currencyCode("currency_code2") + .build(); ``` diff --git a/doc/models/remove-payment-event-data.md b/doc/models/remove-payment-event-data.md index b3ff943a..f1a4b04e 100644 --- a/doc/models/remove-payment-event-data.md +++ b/doc/models/remove-payment-event-data.md @@ -19,19 +19,29 @@ Example schema for an `remove_payment` event | `PaymentMethod` | [`InvoiceEventPayment`](../../doc/models/containers/invoice-event-payment.md) | Required | A nested data structure detailing the method of payment | InvoiceEventPayment getPaymentMethod() | setPaymentMethod(InvoiceEventPayment paymentMethod) | | `Prepayment` | `boolean` | Required | The flag that shows whether the original payment was a prepayment or not | boolean getPrepayment() | setPrepayment(boolean prepayment) | -## Example (as JSON) - -```json -{ - "transaction_id": 180, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "prepayment": false, - "original_amount": "original_amount0" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.PaymentMethodApplePay; +import com.maxio.advancedbilling.models.RemovePaymentEventData; +import com.maxio.advancedbilling.models.containers.InvoiceEventPayment; + +RemovePaymentEventData removePaymentEventData = new RemovePaymentEventData.Builder( + 20, + "memo4", + "applied_amount8", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + InvoiceEventPayment.fromPaymentMethodApplePay( + new PaymentMethodApplePay.Builder( + InvoiceEventPaymentMethod.APPLE_PAY + ) + .build() + ), + false +) +.originalAmount("original_amount4") +.build(); ``` diff --git a/doc/models/remove-payment-event.md b/doc/models/remove-payment-event.md index 144b2c82..f1df3e90 100644 --- a/doc/models/remove-payment-event.md +++ b/doc/models/remove-payment-event.md @@ -15,35 +15,49 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.REMOVE_PAYMENT` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`RemovePaymentEventData`](../../doc/models/remove-payment-event-data.md) | Required | Example schema for an `remove_payment` event | RemovePaymentEventData getEventData() | setEventData(RemovePaymentEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 236, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "remove_payment", - "event_data": { - "transaction_id": 78, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "prepayment": false, - "original_amount": "original_amount0" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventPaymentMethod; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.PaymentMethodApplePay; +import com.maxio.advancedbilling.models.RemovePaymentEvent; +import com.maxio.advancedbilling.models.RemovePaymentEventData; +import com.maxio.advancedbilling.models.containers.InvoiceEventPayment; + +RemovePaymentEvent removePaymentEvent = new RemovePaymentEvent.Builder( + 132L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.REMOVE_PAYMENT, + new RemovePaymentEventData.Builder( + 78, + "memo0", + "applied_amount2", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + InvoiceEventPayment.fromPaymentMethodApplePay( + new PaymentMethodApplePay.Builder( + InvoiceEventPaymentMethod.APPLE_PAY + ) + .build() + ), + false + ) + .originalAmount("original_amount0") + .build() +) +.build(); ``` diff --git a/doc/models/renewal-preview-component.md b/doc/models/renewal-preview-component.md index e325bc21..77e6842c 100644 --- a/doc/models/renewal-preview-component.md +++ b/doc/models/renewal-preview-component.md @@ -13,13 +13,21 @@ | `Quantity` | `Integer` | Optional | The quantity for which you wish to preview billing. This is useful if you want to preview a predicted, higher usage value than is currently present on the subscription.

This quantity represents:

- Whether or not an on/off component is enabled - use 0 for disabled or 1 for enabled
- The desired allocated_quantity for a quantity-based component
- The desired unit_balance for a metered component
- The desired metric quantity for an events-based component | Integer getQuantity() | setQuantity(Integer quantity) | | `PricePointId` | [`RenewalPreviewComponentPricePointId`](../../doc/models/containers/renewal-preview-component-price-point-id.md) | Optional | This is a container for one-of cases. | RenewalPreviewComponentPricePointId getPricePointId() | setPricePointId(RenewalPreviewComponentPricePointId pricePointId) | -## Example (as JSON) - -```json -{ - "component_id": "String7", - "quantity": 174, - "price_point_id": "String1" -} +## Example + +```java +import com.maxio.advancedbilling.models.RenewalPreviewComponent; +import com.maxio.advancedbilling.models.containers.RenewalPreviewComponentComponentId; +import com.maxio.advancedbilling.models.containers.RenewalPreviewComponentPricePointId; + +RenewalPreviewComponent renewalPreviewComponent = new RenewalPreviewComponent.Builder() + .componentId(RenewalPreviewComponentComponentId.fromString( + "String1" + )) + .quantity(254) + .pricePointId(RenewalPreviewComponentPricePointId.fromString( + "String7" + )) + .build(); ``` diff --git a/doc/models/renewal-preview-line-item.md b/doc/models/renewal-preview-line-item.md index 7e9e3017..87952e94 100644 --- a/doc/models/renewal-preview-line-item.md +++ b/doc/models/renewal-preview-line-item.md @@ -24,15 +24,19 @@ | `PeriodRangeStart` | `String` | Optional | - | String getPeriodRangeStart() | setPeriodRangeStart(String periodRangeStart) | | `PeriodRangeEnd` | `String` | Optional | - | String getPeriodRangeEnd() | setPeriodRangeEnd(String periodRangeEnd) | -## Example (as JSON) - -```json -{ - "transaction_type": "charge", - "kind": "prepaid_usage_component", - "amount_in_cents": 154, - "memo": "memo0", - "discount_amount_in_cents": 214 -} +## Example + +```java +import com.maxio.advancedbilling.models.LineItemKind; +import com.maxio.advancedbilling.models.LineItemTransactionType; +import com.maxio.advancedbilling.models.RenewalPreviewLineItem; + +RenewalPreviewLineItem renewalPreviewLineItem = new RenewalPreviewLineItem.Builder() + .transactionType(LineItemTransactionType.ADJUSTMENT) + .kind(LineItemKind.PREPAID_USAGE_COMPONENT) + .amountInCents(32L) + .memo("memo0") + .discountAmountInCents(228L) + .build(); ``` diff --git a/doc/models/renewal-preview-request.md b/doc/models/renewal-preview-request.md index bf92069a..11a87490 100644 --- a/doc/models/renewal-preview-request.md +++ b/doc/models/renewal-preview-request.md @@ -9,29 +9,29 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Components` | [`List`](../../doc/models/renewal-preview-component.md) | Optional | An optional array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | List getComponents() | setComponents(List components) | - -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - } - ] -} +| `Components` | [`List`](../../doc/models/renewal-preview-component.md) | Optional | (Optional) Array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | List getComponents() | setComponents(List components) | + +## Example + +```java +import com.maxio.advancedbilling.models.RenewalPreviewComponent; +import com.maxio.advancedbilling.models.RenewalPreviewRequest; +import com.maxio.advancedbilling.models.containers.RenewalPreviewComponentComponentId; +import com.maxio.advancedbilling.models.containers.RenewalPreviewComponentPricePointId; +import java.util.Arrays; + +RenewalPreviewRequest renewalPreviewRequest = new RenewalPreviewRequest.Builder() + .components(Arrays.asList( + new RenewalPreviewComponent.Builder() + .componentId(RenewalPreviewComponentComponentId.fromString( + "String5" + )) + .quantity(210) + .pricePointId(RenewalPreviewComponentPricePointId.fromString( + "String3" + )) + .build() + )) + .build(); ``` diff --git a/doc/models/renewal-preview-response.md b/doc/models/renewal-preview-response.md index 54bd1161..dfe6c024 100644 --- a/doc/models/renewal-preview-response.md +++ b/doc/models/renewal-preview-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `RenewalPreview` | [`RenewalPreview`](../../doc/models/renewal-preview.md) | Required | - | RenewalPreview getRenewalPreview() | setRenewalPreview(RenewalPreview renewalPreview) | -## Example (as JSON) - -```json -{ - "renewal_preview": { - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 132, - "total_tax_in_cents": 0, - "total_discount_in_cents": 250, - "total_in_cents": 20 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.RenewalPreview; +import com.maxio.advancedbilling.models.RenewalPreviewResponse; + +RenewalPreviewResponse renewalPreviewResponse = new RenewalPreviewResponse.Builder( + new RenewalPreview.Builder() + .nextAssessmentAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .subtotalInCents(132L) + .totalTaxInCents(0L) + .totalDiscountInCents(250L) + .totalInCents(20L) + .build() +) +.build(); ``` diff --git a/doc/models/renewal-preview.md b/doc/models/renewal-preview.md index 17917c19..ee492dbd 100644 --- a/doc/models/renewal-preview.md +++ b/doc/models/renewal-preview.md @@ -19,15 +19,18 @@ | `UncalculatedTaxes` | `Boolean` | Optional | A boolean indicating whether or not additional taxes will be calculated at the time of renewal. This will be true if you are using Avalara and the address of the subscription is in one of your defined taxable regions. | Boolean getUncalculatedTaxes() | setUncalculatedTaxes(Boolean uncalculatedTaxes) | | `LineItems` | [`List`](../../doc/models/renewal-preview-line-item.md) | Optional | An array of objects representing the individual transactions that will be created at the next renewal | List getLineItems() | setLineItems(List lineItems) | -## Example (as JSON) - -```json -{ - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 160, - "total_tax_in_cents": 28, - "total_discount_in_cents": 34, - "total_in_cents": 48 -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.RenewalPreview; + +RenewalPreview renewalPreview = new RenewalPreview.Builder() + .nextAssessmentAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .subtotalInCents(102L) + .totalTaxInCents(226L) + .totalDiscountInCents(232L) + .totalInCents(246L) + .build(); ``` diff --git a/doc/models/replay-webhooks-request.md b/doc/models/replay-webhooks-request.md index 2bf5e211..c5de6e97 100644 --- a/doc/models/replay-webhooks-request.md +++ b/doc/models/replay-webhooks-request.md @@ -11,13 +11,19 @@ | --- | --- | --- | --- | --- | --- | | `Ids` | `List` | Required | - | List getIds() | setIds(List ids) | -## Example (as JSON) - -```json -{ - "ids": [ - 15 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ReplayWebhooksRequest; +import java.util.Arrays; + +ReplayWebhooksRequest replayWebhooksRequest = new ReplayWebhooksRequest.Builder( + Arrays.asList( + 209L, + 210L, + 211L + ) +) +.build(); ``` diff --git a/doc/models/replay-webhooks-response.md b/doc/models/replay-webhooks-response.md index 9662bb8a..d96422e9 100644 --- a/doc/models/replay-webhooks-response.md +++ b/doc/models/replay-webhooks-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | --- | --- | | `Status` | `String` | Optional | - | String getStatus() | setStatus(String status) | -## Example (as JSON) +## Example -```json -{ - "status": "status4" -} +```java +import com.maxio.advancedbilling.models.ReplayWebhooksResponse; + +ReplayWebhooksResponse replayWebhooksResponse = new ReplayWebhooksResponse.Builder() + .status("status6") + .build(); ``` diff --git a/doc/models/resent-invitation.md b/doc/models/resent-invitation.md index a8a4b776..242ecf76 100644 --- a/doc/models/resent-invitation.md +++ b/doc/models/resent-invitation.md @@ -16,16 +16,19 @@ | `LastInviteSentAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getLastInviteSentAt() | setLastInviteSentAt(ZonedDateTime lastInviteSentAt) | | `LastInviteAcceptedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getLastInviteAcceptedAt() | setLastInviteAcceptedAt(ZonedDateTime lastInviteAcceptedAt) | -## Example (as JSON) - -```json -{ - "last_invite_sent_at": "01/01/2024 04:30:00", - "last_invite_accepted_at": "01/01/2024 04:35:00", - "last_sent_at": "last_sent_at8", - "last_accepted_at": "last_accepted_at8", - "send_invite_link_text": "send_invite_link_text6", - "uninvited_count": 6 -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ResentInvitation; + +ResentInvitation resentInvitation = new ResentInvitation.Builder() + .lastSentAt("last_sent_at0") + .lastAcceptedAt("last_accepted_at0") + .sendInviteLinkText("send_invite_link_text8") + .uninvitedCount(178) + .lastInviteSentAt(DateTimeHelper.fromRfc8601DateTime("2024-01-01T04:30:00+00:00")) + .lastInviteAcceptedAt(DateTimeHelper.fromRfc8601DateTime("2024-01-01T04:35:00+00:00")) + .build(); ``` diff --git a/doc/models/resource-type.md b/doc/models/resource-type.md index 1490b923..e135d01d 100644 --- a/doc/models/resource-type.md +++ b/doc/models/resource-type.md @@ -12,3 +12,11 @@ | `SUBSCRIPTIONS` | | `CUSTOMERS` | +## Example + +```java +import com.maxio.advancedbilling.models.ResourceType; + +ResourceType resourceType = ResourceType.SUBSCRIPTIONS; +``` + diff --git a/doc/models/restriction-type.md b/doc/models/restriction-type.md index 816172f6..ed1dcdf2 100644 --- a/doc/models/restriction-type.md +++ b/doc/models/restriction-type.md @@ -12,3 +12,11 @@ | `COMPONENT` | | `PRODUCT` | +## Example + +```java +import com.maxio.advancedbilling.models.RestrictionType; + +RestrictionType restrictionType = RestrictionType.COMPONENT; +``` + diff --git a/doc/models/resume-options.md b/doc/models/resume-options.md index 4c7e1fc0..a2bcd28d 100644 --- a/doc/models/resume-options.md +++ b/doc/models/resume-options.md @@ -12,12 +12,14 @@ | `RequireResume` | `Boolean` | Optional | Chargify will only attempt to resume the subscription's billing period. If not resumable, the subscription will be left in its current state. | Boolean getRequireResume() | setRequireResume(Boolean requireResume) | | `ForgiveBalance` | `Boolean` | Optional | Indicates whether or not Chargify should clear the subscription's existing balance before attempting to resume the subscription. If subscription cannot be resumed, the balance will remain as it was before the attempt to resume was made. | Boolean getForgiveBalance() | setForgiveBalance(Boolean forgiveBalance) | -## Example (as JSON) +## Example -```json -{ - "require_resume": false, - "forgive_balance": false -} +```java +import com.maxio.advancedbilling.models.ResumeOptions; + +ResumeOptions resumeOptions = new ResumeOptions.Builder() + .requireResume(false) + .forgiveBalance(false) + .build(); ``` diff --git a/doc/models/resumption-charge.md b/doc/models/resumption-charge.md index 799f3d35..6ea681f8 100644 --- a/doc/models/resumption-charge.md +++ b/doc/models/resumption-charge.md @@ -15,3 +15,11 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```java +import com.maxio.advancedbilling.models.ResumptionCharge; + +ResumptionCharge resumptionCharge = ResumptionCharge.IMMEDIATE; +``` + diff --git a/doc/models/revoked-invitation.md b/doc/models/revoked-invitation.md index a540fd84..ee227cd8 100644 --- a/doc/models/revoked-invitation.md +++ b/doc/models/revoked-invitation.md @@ -13,13 +13,15 @@ | `LastAcceptedAt` | `String` | Optional | - | String getLastAcceptedAt() | setLastAcceptedAt(String lastAcceptedAt) | | `UninvitedCount` | `Integer` | Optional | - | Integer getUninvitedCount() | setUninvitedCount(Integer uninvitedCount) | -## Example (as JSON) - -```json -{ - "last_sent_at": "last_sent_at2", - "last_accepted_at": "last_accepted_at2", - "uninvited_count": 226 -} +## Example + +```java +import com.maxio.advancedbilling.models.RevokedInvitation; + +RevokedInvitation revokedInvitation = new RevokedInvitation.Builder() + .lastSentAt("last_sent_at8") + .lastAcceptedAt("last_accepted_at8") + .uninvitedCount(130) + .build(); ``` diff --git a/doc/models/sale-rep-item-mrr.md b/doc/models/sale-rep-item-mrr.md index 196175f9..bd5692d0 100644 --- a/doc/models/sale-rep-item-mrr.md +++ b/doc/models/sale-rep-item-mrr.md @@ -13,13 +13,15 @@ | `Usage` | `String` | Optional | - | String getUsage() | setUsage(String usage) | | `Recurring` | `String` | Optional | - | String getRecurring() | setRecurring(String recurring) | -## Example (as JSON) - -```json -{ - "mrr": "mrr2", - "usage": "usage0", - "recurring": "recurring4" -} +## Example + +```java +import com.maxio.advancedbilling.models.SaleRepItemMrr; + +SaleRepItemMrr saleRepItemMrr = new SaleRepItemMrr.Builder() + .mrr("mrr8") + .usage("usage0") + .recurring("recurring6") + .build(); ``` diff --git a/doc/models/sale-rep-settings.md b/doc/models/sale-rep-settings.md index 2503dcf9..485363e7 100644 --- a/doc/models/sale-rep-settings.md +++ b/doc/models/sale-rep-settings.md @@ -17,15 +17,17 @@ | `SalesRepId` | `Integer` | Optional | - | Integer getSalesRepId() | setSalesRepId(Integer salesRepId) | | `SalesRepName` | `String` | Optional | - | String getSalesRepName() | setSalesRepName(String salesRepName) | -## Example (as JSON) - -```json -{ - "customer_name": "customer_name8", - "subscription_id": 200, - "site_link": "site_link4", - "site_name": "site_name8", - "subscription_mrr": "subscription_mrr6" -} +## Example + +```java +import com.maxio.advancedbilling.models.SaleRepSettings; + +SaleRepSettings saleRepSettings = new SaleRepSettings.Builder() + .customerName("customer_name6") + .subscriptionId(202) + .siteLink("site_link2") + .siteName("site_name6") + .subscriptionMrr("subscription_mrr4") + .build(); ``` diff --git a/doc/models/sale-rep-subscription.md b/doc/models/sale-rep-subscription.md index 19435734..2aad445e 100644 --- a/doc/models/sale-rep-subscription.md +++ b/doc/models/sale-rep-subscription.md @@ -20,15 +20,17 @@ | `LastPayment` | `String` | Optional | - | String getLastPayment() | setLastPayment(String lastPayment) | | `ChurnDate` | `String` | Optional | - | String getChurnDate() | setChurnDate(String churnDate) | -## Example (as JSON) - -```json -{ - "id": 18, - "site_name": "site_name2", - "subscription_url": "subscription_url6", - "customer_name": "customer_name2", - "created_at": "created_at8" -} +## Example + +```java +import com.maxio.advancedbilling.models.SaleRepSubscription; + +SaleRepSubscription saleRepSubscription = new SaleRepSubscription.Builder() + .id(68) + .siteName("site_name8") + .subscriptionUrl("subscription_url2") + .customerName("customer_name8") + .createdAt("created_at4") + .build(); ``` diff --git a/doc/models/sale-rep.md b/doc/models/sale-rep.md index 2e4ac521..6f4b7505 100644 --- a/doc/models/sale-rep.md +++ b/doc/models/sale-rep.md @@ -15,30 +15,41 @@ | `TestMode` | `Boolean` | Optional | - | Boolean getTestMode() | setTestMode(Boolean testMode) | | `Subscriptions` | [`List`](../../doc/models/sale-rep-subscription.md) | Optional | - | List getSubscriptions() | setSubscriptions(List subscriptions) | -## Example (as JSON) - -```json -{ - "id": 18, - "full_name": "full_name0", - "subscriptions_count": 162, - "test_mode": false, - "subscriptions": [ - { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" - }, - { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.SaleRep; +import com.maxio.advancedbilling.models.SaleRepSubscription; +import java.util.Arrays; + +SaleRep saleRep = new SaleRep.Builder() + .id(78) + .fullName("full_name0") + .subscriptionsCount(102) + .testMode(false) + .subscriptions(Arrays.asList( + new SaleRepSubscription.Builder() + .id(202) + .siteName("site_name8") + .subscriptionUrl("subscription_url2") + .customerName("customer_name8") + .createdAt("created_at4") + .build(), + new SaleRepSubscription.Builder() + .id(202) + .siteName("site_name8") + .subscriptionUrl("subscription_url2") + .customerName("customer_name8") + .createdAt("created_at4") + .build(), + new SaleRepSubscription.Builder() + .id(202) + .siteName("site_name8") + .subscriptionUrl("subscription_url2") + .customerName("customer_name8") + .createdAt("created_at4") + .build() + )) + .build(); ``` diff --git a/doc/models/scheduled-renewal-component-custom-price.md b/doc/models/scheduled-renewal-component-custom-price.md index 0d82dafe..ae194736 100644 --- a/doc/models/scheduled-renewal-component-custom-price.md +++ b/doc/models/scheduled-renewal-component-custom-price.md @@ -12,22 +12,38 @@ Custom pricing for a component within a scheduled renewal. | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `TaxIncluded` | `Boolean` | Optional | Whether or not the price point includes tax | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -| `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | +| `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | List getPrices() | setPrices(List prices) | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "tax_included": false -} +## Example + +```java +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.ScheduledRenewalComponentCustomPrice; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +ScheduledRenewalComponentCustomPrice scheduledRenewalComponentCustomPrice = new ScheduledRenewalComponentCustomPrice.Builder( + PricingScheme.PER_UNIT, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) +) +.taxIncluded(false) +.build(); ``` diff --git a/doc/models/scheduled-renewal-configuration-item-request.md b/doc/models/scheduled-renewal-configuration-item-request.md index 5a967344..1d67eca1 100644 --- a/doc/models/scheduled-renewal-configuration-item-request.md +++ b/doc/models/scheduled-renewal-configuration-item-request.md @@ -11,32 +11,62 @@ | --- | --- | --- | --- | --- | --- | | `RenewalConfigurationItem` | [`ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem`](../../doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md) | Required | This is a container for one-of cases. | ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem getRenewalConfigurationItem() | setRenewalConfigurationItem(ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem renewalConfigurationItem) | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.ScheduledRenewalComponentCustomPrice; +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationItemRequest; +import com.maxio.advancedbilling.models.ScheduledRenewalItemRequestBodyComponent; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import com.maxio.advancedbilling.models.containers.ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem; +import java.util.Arrays; + +ScheduledRenewalConfigurationItemRequest scheduledRenewalConfigurationItemRequest = new ScheduledRenewalConfigurationItemRequest.Builder( + ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem.fromScheduledRenewalItemRequestBodyComponent( + new ScheduledRenewalItemRequestBodyComponent.Builder( + "Component", + 108 + ) + .pricePointId(122) + .quantity(212) + .customPrice(new ScheduledRenewalComponentCustomPrice.Builder( + PricingScheme.STAIRSTEP, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .build()) + .build() + ) +) +.build(); ``` diff --git a/doc/models/scheduled-renewal-configuration-item-response.md b/doc/models/scheduled-renewal-configuration-item-response.md index 1abaa4b1..f6561d36 100644 --- a/doc/models/scheduled-renewal-configuration-item-response.md +++ b/doc/models/scheduled-renewal-configuration-item-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `ScheduledRenewalConfigurationItem` | [`ScheduledRenewalConfigurationItem`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | ScheduledRenewalConfigurationItem getScheduledRenewalConfigurationItem() | setScheduledRenewalConfigurationItem(ScheduledRenewalConfigurationItem scheduledRenewalConfigurationItem) | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration_item": { - "id": 98, - "subscription_id": 208, - "subscription_renewal_configuration_id": 108, - "item_id": 246, - "item_type": "item_type2" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationItem; +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationItemResponse; + +ScheduledRenewalConfigurationItemResponse scheduledRenewalConfigurationItemResponse = new ScheduledRenewalConfigurationItemResponse.Builder() + .scheduledRenewalConfigurationItem(new ScheduledRenewalConfigurationItem.Builder() + .id(98) + .subscriptionId(208) + .subscriptionRenewalConfigurationId(108) + .itemId(246) + .itemType("item_type2") + .build()) + .build(); ``` diff --git a/doc/models/scheduled-renewal-configuration-item.md b/doc/models/scheduled-renewal-configuration-item.md index 9592d0f6..647b93e4 100644 --- a/doc/models/scheduled-renewal-configuration-item.md +++ b/doc/models/scheduled-renewal-configuration-item.md @@ -21,15 +21,17 @@ | `DecimalQuantity` | `String` | Optional | - | String getDecimalQuantity() | setDecimalQuantity(String decimalQuantity) | | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | -## Example (as JSON) - -```json -{ - "id": 146, - "subscription_id": 0, - "subscription_renewal_configuration_id": 156, - "item_id": 38, - "item_type": "item_type4" -} +## Example + +```java +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationItem; + +ScheduledRenewalConfigurationItem scheduledRenewalConfigurationItem = new ScheduledRenewalConfigurationItem.Builder() + .id(54) + .subscriptionId(164) + .subscriptionRenewalConfigurationId(64) + .itemId(202) + .itemType("item_type0") + .build(); ``` diff --git a/doc/models/scheduled-renewal-configuration-request-body.md b/doc/models/scheduled-renewal-configuration-request-body.md index c2c23629..9f27b7b8 100644 --- a/doc/models/scheduled-renewal-configuration-request-body.md +++ b/doc/models/scheduled-renewal-configuration-request-body.md @@ -15,15 +15,18 @@ | `ContractId` | `Integer` | Optional | (Optional) Existing contract to associate with the scheduled renewal. Contracts must be enabled for your site. | Integer getContractId() | setContractId(Integer contractId) | | `CreateNewContract` | `Boolean` | Optional | (Optional) Set to true to create a new contract when contracts are enabled. Contracts must be enabled for your site. | Boolean getCreateNewContract() | setCreateNewContract(Boolean createNewContract) | -## Example (as JSON) - -```json -{ - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 110, - "create_new_contract": false -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationRequestBody; + +ScheduledRenewalConfigurationRequestBody scheduledRenewalConfigurationRequestBody = new ScheduledRenewalConfigurationRequestBody.Builder() + .startsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .lockInAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .contractId(162) + .createNewContract(false) + .build(); ``` diff --git a/doc/models/scheduled-renewal-configuration-request.md b/doc/models/scheduled-renewal-configuration-request.md index 6ec6201a..23dad266 100644 --- a/doc/models/scheduled-renewal-configuration-request.md +++ b/doc/models/scheduled-renewal-configuration-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `RenewalConfiguration` | [`ScheduledRenewalConfigurationRequestBody`](../../doc/models/scheduled-renewal-configuration-request-body.md) | Required | - | ScheduledRenewalConfigurationRequestBody getRenewalConfiguration() | setRenewalConfiguration(ScheduledRenewalConfigurationRequestBody renewalConfiguration) | -## Example (as JSON) - -```json -{ - "renewal_configuration": { - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 244, - "create_new_contract": false - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationRequest; +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationRequestBody; + +ScheduledRenewalConfigurationRequest scheduledRenewalConfigurationRequest = new ScheduledRenewalConfigurationRequest.Builder( + new ScheduledRenewalConfigurationRequestBody.Builder() + .startsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .lockInAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .contractId(244) + .createNewContract(false) + .build() +) +.build(); ``` diff --git a/doc/models/scheduled-renewal-configuration-response.md b/doc/models/scheduled-renewal-configuration-response.md index ea94f252..3bfe766f 100644 --- a/doc/models/scheduled-renewal-configuration-response.md +++ b/doc/models/scheduled-renewal-configuration-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `ScheduledRenewalConfiguration` | [`ScheduledRenewalConfiguration`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | ScheduledRenewalConfiguration getScheduledRenewalConfiguration() | setScheduledRenewalConfiguration(ScheduledRenewalConfiguration scheduledRenewalConfiguration) | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration": { - "id": 134, - "site_id": 60, - "subscription_id": 244, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ScheduledRenewalConfiguration; +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationResponse; + +ScheduledRenewalConfigurationResponse scheduledRenewalConfigurationResponse = new ScheduledRenewalConfigurationResponse.Builder() + .scheduledRenewalConfiguration(new ScheduledRenewalConfiguration.Builder() + .id(134) + .siteId(60) + .subscriptionId(244) + .startsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build()) + .build(); ``` diff --git a/doc/models/scheduled-renewal-configuration.md b/doc/models/scheduled-renewal-configuration.md index b7e29e95..481e0e72 100644 --- a/doc/models/scheduled-renewal-configuration.md +++ b/doc/models/scheduled-renewal-configuration.md @@ -20,15 +20,18 @@ | `ScheduledRenewalConfigurationItems` | [`List`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | List getScheduledRenewalConfigurationItems() | setScheduledRenewalConfigurationItems(List scheduledRenewalConfigurationItems) | | `Contract` | [`Contract`](../../doc/models/contract.md) | Optional | Contract linked to the scheduled renewal configuration. | Contract getContract() | setContract(Contract contract) | -## Example (as JSON) - -```json -{ - "id": 152, - "site_id": 78, - "subscription_id": 6, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ScheduledRenewalConfiguration; + +ScheduledRenewalConfiguration scheduledRenewalConfiguration = new ScheduledRenewalConfiguration.Builder() + .id(8) + .siteId(190) + .subscriptionId(118) + .startsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/scheduled-renewal-configurations-response.md b/doc/models/scheduled-renewal-configurations-response.md index d0ee3067..00799796 100644 --- a/doc/models/scheduled-renewal-configurations-response.md +++ b/doc/models/scheduled-renewal-configurations-response.md @@ -11,33 +11,24 @@ | --- | --- | --- | --- | --- | --- | | `ScheduledRenewalConfigurations` | [`List`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | List getScheduledRenewalConfigurations() | setScheduledRenewalConfigurations(List scheduledRenewalConfigurations) | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configurations": [ - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ScheduledRenewalConfiguration; +import com.maxio.advancedbilling.models.ScheduledRenewalConfigurationsResponse; +import java.util.Arrays; + +ScheduledRenewalConfigurationsResponse scheduledRenewalConfigurationsResponse = new ScheduledRenewalConfigurationsResponse.Builder() + .scheduledRenewalConfigurations(Arrays.asList( + new ScheduledRenewalConfiguration.Builder() + .id(122) + .siteId(48) + .subscriptionId(232) + .startsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .endsAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() + )) + .build(); ``` diff --git a/doc/models/scheduled-renewal-item-request-body-component.md b/doc/models/scheduled-renewal-item-request-body-component.md index fad2625e..f7e13825 100644 --- a/doc/models/scheduled-renewal-item-request-body-component.md +++ b/doc/models/scheduled-renewal-item-request-body-component.md @@ -12,33 +12,58 @@ | `ItemType` | `String` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `"Component"` | String getItemType() | setItemType(String itemType) | | `ItemId` | `int` | Required | Product or component identifier. | int getItemId() | setItemId(int itemId) | | `PricePointId` | `Integer` | Optional | Price point identifier. | Integer getPricePointId() | setPricePointId(Integer pricePointId) | -| `Quantity` | `Integer` | Optional | Optional quantity for the item. | Integer getQuantity() | setQuantity(Integer quantity) | +| `Quantity` | `Integer` | Optional | (Optional) Quantity for the item. | Integer getQuantity() | setQuantity(Integer quantity) | | `CustomPrice` | [`ScheduledRenewalComponentCustomPrice`](../../doc/models/scheduled-renewal-component-custom-price.md) | Optional | Custom pricing for a component within a scheduled renewal. | ScheduledRenewalComponentCustomPrice getCustomPrice() | setCustomPrice(ScheduledRenewalComponentCustomPrice customPrice) | -## Example (as JSON) - -```json -{ - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.ScheduledRenewalComponentCustomPrice; +import com.maxio.advancedbilling.models.ScheduledRenewalItemRequestBodyComponent; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +ScheduledRenewalItemRequestBodyComponent scheduledRenewalItemRequestBodyComponent = new ScheduledRenewalItemRequestBodyComponent.Builder( + "Component", + 20 +) +.pricePointId(6) +.quantity(84) +.customPrice(new ScheduledRenewalComponentCustomPrice.Builder( + PricingScheme.STAIRSTEP, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .build()) +.build(); ``` diff --git a/doc/models/scheduled-renewal-item-request-body-product.md b/doc/models/scheduled-renewal-item-request-body-product.md index 06efff3d..fe0bb4f0 100644 --- a/doc/models/scheduled-renewal-item-request-body-product.md +++ b/doc/models/scheduled-renewal-item-request-body-product.md @@ -12,27 +12,39 @@ | `ItemType` | `String` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `"Product"` | String getItemType() | setItemType(String itemType) | | `ItemId` | `int` | Required | Product or component identifier. | int getItemId() | setItemId(int itemId) | | `PricePointId` | `Integer` | Optional | Price point identifier. | Integer getPricePointId() | setPricePointId(Integer pricePointId) | -| `Quantity` | `Integer` | Optional | Optional quantity for the item. | Integer getQuantity() | setQuantity(Integer quantity) | +| `Quantity` | `Integer` | Optional | (Optional) Quantity for the item. | Integer getQuantity() | setQuantity(Integer quantity) | | `CustomPrice` | [`ScheduledRenewalProductPricePoint`](../../doc/models/scheduled-renewal-product-price-point.md) | Optional | Custom pricing for a product within a scheduled renewal. | ScheduledRenewalProductPricePoint getCustomPrice() | setCustomPrice(ScheduledRenewalProductPricePoint customPrice) | -## Example (as JSON) - -```json -{ - "item_type": "Product", - "item_id": 32, - "price_point_id": 18, - "quantity": 96, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 30, - "expiration_interval": 52 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.ScheduledRenewalItemRequestBodyProduct; +import com.maxio.advancedbilling.models.ScheduledRenewalProductPricePoint; +import com.maxio.advancedbilling.models.containers.ScheduledRenewalProductPricePointInterval; +import com.maxio.advancedbilling.models.containers.ScheduledRenewalProductPricePointPriceInCents; + +ScheduledRenewalItemRequestBodyProduct scheduledRenewalItemRequestBodyProduct = new ScheduledRenewalItemRequestBodyProduct.Builder( + "Product", + 154 +) +.pricePointId(168) +.quantity(166) +.customPrice(new ScheduledRenewalProductPricePoint.Builder( + ScheduledRenewalProductPricePointPriceInCents.fromString( + "String3" + ), + ScheduledRenewalProductPricePointInterval.fromString( + "String3" + ), + IntervalUnit.DAY + ) + .name("name4") + .handle("handle0") + .taxIncluded(false) + .initialChargeInCents(30L) + .expirationInterval(52) + .build()) +.build(); ``` diff --git a/doc/models/scheduled-renewal-lock-in-request.md b/doc/models/scheduled-renewal-lock-in-request.md index 9a25fdb2..d5fddc98 100644 --- a/doc/models/scheduled-renewal-lock-in-request.md +++ b/doc/models/scheduled-renewal-lock-in-request.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `LockInAt` | `LocalDate` | Required | Date to lock in the renewal. | LocalDate getLockInAt() | setLockInAt(LocalDate lockInAt) | -## Example (as JSON) +## Example -```json -{ - "lock_in_at": "2016-03-13" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.ScheduledRenewalLockInRequest; + +ScheduledRenewalLockInRequest scheduledRenewalLockInRequest = new ScheduledRenewalLockInRequest.Builder( + DateTimeHelper.fromSimpleDate("2016-03-13") +) +.build(); ``` diff --git a/doc/models/scheduled-renewal-product-price-point.md b/doc/models/scheduled-renewal-product-price-point.md index 1b7fe884..62da8d37 100644 --- a/doc/models/scheduled-renewal-product-price-point.md +++ b/doc/models/scheduled-renewal-product-price-point.md @@ -18,21 +18,31 @@ Custom pricing for a product within a scheduled renewal. | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | Required if using `custom_price` attribute. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `TaxIncluded` | `Boolean` | Optional | (Optional) | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | | `InitialChargeInCents` | `Long` | Optional | The product price point initial charge, in integer cents. | Long getInitialChargeInCents() | setInitialChargeInCents(Long initialChargeInCents) | -| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String9", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 86, - "expiration_interval": 108 -} +## Example + +```java +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.ScheduledRenewalProductPricePoint; +import com.maxio.advancedbilling.models.containers.ScheduledRenewalProductPricePointInterval; +import com.maxio.advancedbilling.models.containers.ScheduledRenewalProductPricePointPriceInCents; + +ScheduledRenewalProductPricePoint scheduledRenewalProductPricePoint = new ScheduledRenewalProductPricePoint.Builder( + ScheduledRenewalProductPricePointPriceInCents.fromString( + "String1" + ), + ScheduledRenewalProductPricePointInterval.fromString( + "String7" + ), + IntervalUnit.DAY +) +.name("name6") +.handle("handle2") +.taxIncluded(false) +.initialChargeInCents(218L) +.expirationInterval(240) +.build(); ``` diff --git a/doc/models/scheduled-renewal-update-request.md b/doc/models/scheduled-renewal-update-request.md index b09f32c7..13272125 100644 --- a/doc/models/scheduled-renewal-update-request.md +++ b/doc/models/scheduled-renewal-update-request.md @@ -11,32 +11,62 @@ | --- | --- | --- | --- | --- | --- | | `RenewalConfigurationItem` | [`ScheduledRenewalUpdateRequestRenewalConfigurationItem`](../../doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md) | Required | This is a container for one-of cases. | ScheduledRenewalUpdateRequestRenewalConfigurationItem getRenewalConfigurationItem() | setRenewalConfigurationItem(ScheduledRenewalUpdateRequestRenewalConfigurationItem renewalConfigurationItem) | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.ScheduledRenewalComponentCustomPrice; +import com.maxio.advancedbilling.models.ScheduledRenewalItemRequestBodyComponent; +import com.maxio.advancedbilling.models.ScheduledRenewalUpdateRequest; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import com.maxio.advancedbilling.models.containers.ScheduledRenewalUpdateRequestRenewalConfigurationItem; +import java.util.Arrays; + +ScheduledRenewalUpdateRequest scheduledRenewalUpdateRequest = new ScheduledRenewalUpdateRequest.Builder( + ScheduledRenewalUpdateRequestRenewalConfigurationItem.fromScheduledRenewalItemRequestBodyComponent( + new ScheduledRenewalItemRequestBodyComponent.Builder( + "Component", + 108 + ) + .pricePointId(122) + .quantity(212) + .customPrice(new ScheduledRenewalComponentCustomPrice.Builder( + PricingScheme.STAIRSTEP, + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .build()) + .build() + ) +) +.build(); ``` diff --git a/doc/models/segment-price.md b/doc/models/segment-price.md index cf6bdd36..438106a3 100644 --- a/doc/models/segment-price.md +++ b/doc/models/segment-price.md @@ -18,15 +18,17 @@ | `FormattedUnitPrice` | `String` | Optional | - | String getFormattedUnitPrice() | setFormattedUnitPrice(String formattedUnitPrice) | | `SegmentId` | `Integer` | Optional | - | Integer getSegmentId() | setSegmentId(Integer segmentId) | -## Example (as JSON) - -```json -{ - "id": 220, - "component_id": 74, - "starting_quantity": 118, - "ending_quantity": 92, - "unit_price": "unit_price0" -} +## Example + +```java +import com.maxio.advancedbilling.models.SegmentPrice; + +SegmentPrice segmentPrice = new SegmentPrice.Builder() + .id(194) + .componentId(48) + .startingQuantity(144) + .endingQuantity(118) + .unitPrice("unit_price0") + .build(); ``` diff --git a/doc/models/segment-response.md b/doc/models/segment-response.md index def21f41..f48b9579 100644 --- a/doc/models/segment-response.md +++ b/doc/models/segment-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Segment` | [`Segment`](../../doc/models/segment.md) | Optional | - | Segment getSegment() | setSegment(Segment segment) | -## Example (as JSON) - -```json -{ - "segment": { - "id": 118, - "component_id": 228, - "price_point_id": 4, - "event_based_billing_metric_id": 56, - "pricing_scheme": "stairstep" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.Segment; +import com.maxio.advancedbilling.models.SegmentResponse; + +SegmentResponse segmentResponse = new SegmentResponse.Builder() + .segment(new Segment.Builder() + .id(118) + .componentId(228) + .pricePointId(4) + .eventBasedBillingMetricId(56) + .pricingScheme(PricingScheme.STAIRSTEP) + .build()) + .build(); ``` diff --git a/doc/models/segment.md b/doc/models/segment.md index 839446b9..a9849678 100644 --- a/doc/models/segment.md +++ b/doc/models/segment.md @@ -22,15 +22,18 @@ | `UpdatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | | `Prices` | [`List`](../../doc/models/segment-price.md) | Optional | **Constraints**: *Minimum Items*: `1` | List getPrices() | setPrices(List prices) | -## Example (as JSON) - -```json -{ - "id": 6, - "component_id": 116, - "price_point_id": 140, - "event_based_billing_metric_id": 200, - "pricing_scheme": "stairstep" -} +## Example + +```java +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.Segment; + +Segment segment = new Segment.Builder() + .id(118) + .componentId(228) + .pricePointId(4) + .eventBasedBillingMetricId(56) + .pricingScheme(PricingScheme.STAIRSTEP) + .build(); ``` diff --git a/doc/models/send-email.md b/doc/models/send-email.md index d8d7b53f..41bf7e21 100644 --- a/doc/models/send-email.md +++ b/doc/models/send-email.md @@ -12,12 +12,15 @@ | `CanExecute` | `boolean` | Required | - | boolean getCanExecute() | setCanExecute(boolean canExecute) | | `Url` | `String` | Required | - | String getUrl() | setUrl(String url) | -## Example (as JSON) +## Example -```json -{ - "can_execute": false, - "url": "url2" -} +```java +import com.maxio.advancedbilling.models.SendEmail; + +SendEmail sendEmail = new SendEmail.Builder( + false, + "url2" +) +.build(); ``` diff --git a/doc/models/send-invoice-request.md b/doc/models/send-invoice-request.md index 46c4af53..30ed2f10 100644 --- a/doc/models/send-invoice-request.md +++ b/doc/models/send-invoice-request.md @@ -14,25 +14,27 @@ | `BccRecipientEmails` | `List` | Optional | **Constraints**: *Maximum Items*: `5` | List getBccRecipientEmails() | setBccRecipientEmails(List bccRecipientEmails) | | `AttachmentUrls` | `List` | Optional | Array of URLs to files to attach to the invoice email. Max 10 files, 10MB each.

**Constraints**: *Maximum Items*: `10` | List getAttachmentUrls() | setAttachmentUrls(List attachmentUrls) | -## Example (as JSON) - -```json -{ - "recipient_emails": [ - "recipient_emails3", - "recipient_emails4" - ], - "cc_recipient_emails": [ - "cc_recipient_emails6", - "cc_recipient_emails5" - ], - "bcc_recipient_emails": [ - "bcc_recipient_emails6" - ], - "attachment_urls": [ - "attachment_urls0", - "attachment_urls1" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.SendInvoiceRequest; +import java.util.Arrays; + +SendInvoiceRequest sendInvoiceRequest = new SendInvoiceRequest.Builder() + .recipientEmails(Arrays.asList( + "recipient_emails7" + )) + .ccRecipientEmails(Arrays.asList( + "cc_recipient_emails2" + )) + .bccRecipientEmails(Arrays.asList( + "bcc_recipient_emails0", + "bcc_recipient_emails1", + "bcc_recipient_emails2" + )) + .attachmentUrls(Arrays.asList( + "attachment_urls4" + )) + .build(); ``` diff --git a/doc/models/service-credit-1.md b/doc/models/service-credit-1.md index b641f2a9..5504d127 100644 --- a/doc/models/service-credit-1.md +++ b/doc/models/service-credit-1.md @@ -14,19 +14,22 @@ | `EndingBalanceInCents` | `Long` | Optional | The new balance for the credit account | Long getEndingBalanceInCents() | setEndingBalanceInCents(Long endingBalanceInCents) | | `EntryType` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | ServiceCreditType getEntryType() | setEntryType(ServiceCreditType entryType) | | `Memo` | `String` | Optional | The memo attached to the entry | String getMemo() | setMemo(String memo) | -| `InvoiceUid` | `String` | Optional | The invoice uid associated with the entry. Only present for debit entries | String getInvoiceUid() | setInvoiceUid(String invoiceUid) | +| `InvoiceUid` | `String` | Optional | The invoice uid associated with the entry. Only present for debit entries. | String getInvoiceUid() | setInvoiceUid(String invoiceUid) | | `RemainingBalanceInCents` | `Long` | Optional | The remaining balance for the entry | Long getRemainingBalanceInCents() | setRemainingBalanceInCents(Long remainingBalanceInCents) | | `CreatedAt` | `ZonedDateTime` | Optional | The date and time the entry was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | -## Example (as JSON) +## Example -```json -{ - "id": 174, - "amount_in_cents": 4, - "ending_balance_in_cents": 44, - "entry_type": "Credit", - "memo": "memo8" -} +```java +import com.maxio.advancedbilling.models.ServiceCredit1; +import com.maxio.advancedbilling.models.ServiceCreditType; + +ServiceCredit1 serviceCredit1 = new ServiceCredit1.Builder() + .id(12) + .amountInCents(158L) + .endingBalanceInCents(138L) + .entryType(ServiceCreditType.CREDIT) + .memo("memo4") + .build(); ``` diff --git a/doc/models/service-credit-response.md b/doc/models/service-credit-response.md index ea1d9fd2..ea8384a7 100644 --- a/doc/models/service-credit-response.md +++ b/doc/models/service-credit-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `ServiceCredit` | [`ServiceCredit`](../../doc/models/service-credit.md) | Required | - | ServiceCredit getServiceCredit() | setServiceCredit(ServiceCredit serviceCredit) | -## Example (as JSON) - -```json -{ - "service_credit": { - "id": 38, - "amount_in_cents": 124, - "ending_balance_in_cents": 164, - "entry_type": "Credit", - "memo": "memo0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ServiceCredit; +import com.maxio.advancedbilling.models.ServiceCreditResponse; +import com.maxio.advancedbilling.models.ServiceCreditType; + +ServiceCreditResponse serviceCreditResponse = new ServiceCreditResponse.Builder( + new ServiceCredit.Builder() + .id(38) + .amountInCents(124L) + .endingBalanceInCents(164L) + .entryType(ServiceCreditType.CREDIT) + .memo("memo0") + .build() +) +.build(); ``` diff --git a/doc/models/service-credit-type.md b/doc/models/service-credit-type.md index e4763845..2dcae74a 100644 --- a/doc/models/service-credit-type.md +++ b/doc/models/service-credit-type.md @@ -14,3 +14,11 @@ The type of entry | `CREDIT` | | `DEBIT` | +## Example + +```java +import com.maxio.advancedbilling.models.ServiceCreditType; + +ServiceCreditType serviceCreditType = ServiceCreditType.CREDIT; +``` + diff --git a/doc/models/service-credit.md b/doc/models/service-credit.md index da7b9dd0..68d86792 100644 --- a/doc/models/service-credit.md +++ b/doc/models/service-credit.md @@ -15,15 +15,18 @@ | `EntryType` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | ServiceCreditType getEntryType() | setEntryType(ServiceCreditType entryType) | | `Memo` | `String` | Optional | The memo attached to the entry | String getMemo() | setMemo(String memo) | -## Example (as JSON) - -```json -{ - "id": 216, - "amount_in_cents": 210, - "ending_balance_in_cents": 86, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```java +import com.maxio.advancedbilling.models.ServiceCredit; +import com.maxio.advancedbilling.models.ServiceCreditType; + +ServiceCredit serviceCredit = new ServiceCredit.Builder() + .id(132) + .amountInCents(218L) + .endingBalanceInCents(2L) + .entryType(ServiceCreditType.CREDIT) + .memo("memo8") + .build(); ``` diff --git a/doc/models/signup-proforma-preview-response.md b/doc/models/signup-proforma-preview-response.md index 7d45204c..39a8d5dd 100644 --- a/doc/models/signup-proforma-preview-response.md +++ b/doc/models/signup-proforma-preview-response.md @@ -11,26 +11,31 @@ | --- | --- | --- | --- | --- | --- | | `ProformaInvoicePreview` | [`SignupProformaPreview`](../../doc/models/signup-proforma-preview.md) | Required | - | SignupProformaPreview getProformaInvoicePreview() | setProformaInvoicePreview(SignupProformaPreview proformaInvoicePreview) | -## Example (as JSON) - -```json -{ - "proforma_invoice_preview": { - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 - }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoice; +import com.maxio.advancedbilling.models.SignupProformaPreview; +import com.maxio.advancedbilling.models.SignupProformaPreviewResponse; + +SignupProformaPreviewResponse signupProformaPreviewResponse = new SignupProformaPreviewResponse.Builder( + new SignupProformaPreview.Builder() + .currentProformaInvoice(new ProformaInvoice.Builder() + .uid("uid6") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number(132) + .build()) + .nextProformaInvoice(new ProformaInvoice.Builder() + .uid("uid8") + .siteId(212) + .customerId(68) + .subscriptionId(140) + .number(16) + .build()) + .build() +) +.build(); ``` diff --git a/doc/models/signup-proforma-preview.md b/doc/models/signup-proforma-preview.md index beedb771..6785278a 100644 --- a/doc/models/signup-proforma-preview.md +++ b/doc/models/signup-proforma-preview.md @@ -12,24 +12,27 @@ | `CurrentProformaInvoice` | [`ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | ProformaInvoice getCurrentProformaInvoice() | setCurrentProformaInvoice(ProformaInvoice currentProformaInvoice) | | `NextProformaInvoice` | [`ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | ProformaInvoice getNextProformaInvoice() | setNextProformaInvoice(ProformaInvoice nextProformaInvoice) | -## Example (as JSON) - -```json -{ - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 - }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ProformaInvoice; +import com.maxio.advancedbilling.models.SignupProformaPreview; + +SignupProformaPreview signupProformaPreview = new SignupProformaPreview.Builder() + .currentProformaInvoice(new ProformaInvoice.Builder() + .uid("uid6") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number(132) + .build()) + .nextProformaInvoice(new ProformaInvoice.Builder() + .uid("uid8") + .siteId(212) + .customerId(68) + .subscriptionId(140) + .number(16) + .build()) + .build(); ``` diff --git a/doc/models/single-error-response-exception.md b/doc/models/single-error-response-exception.md index cdc83776..2ac79e49 100644 --- a/doc/models/single-error-response-exception.md +++ b/doc/models/single-error-response-exception.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Error` | `String` | Required | - | String getError() | setError(String error) | -## Example (as JSON) - -```json -{ - "error": "error2" +## Example + +```java +try { + // make the API call +} catch (SingleErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/single-string-error-response-exception.md b/doc/models/single-string-error-response-exception.md index 635fb690..32f8cb2d 100644 --- a/doc/models/single-string-error-response-exception.md +++ b/doc/models/single-string-error-response-exception.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | `String` | Optional | - | String getErrors() | setErrors(String errors) | -## Example (as JSON) - -```json -{ - "errors": "errors4" +## Example + +```java +try { + // make the API call +} catch (SingleStringErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/site-response.md b/doc/models/site-response.md index 7f2234f2..faf8ef4d 100644 --- a/doc/models/site-response.md +++ b/doc/models/site-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Site` | [`Site`](../../doc/models/site.md) | Required | - | Site getSite() | setSite(Site site) | -## Example (as JSON) - -```json -{ - "site": { - "id": 64, - "name": "name4", - "subdomain": "subdomain0", - "currency": "currency4", - "seller_id": 228 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Site; +import com.maxio.advancedbilling.models.SiteResponse; + +SiteResponse siteResponse = new SiteResponse.Builder( + new Site.Builder() + .id(64) + .name("name4") + .subdomain("subdomain0") + .currency("currency4") + .sellerId(228) + .build() +) +.build(); ``` diff --git a/doc/models/site-statistics.md b/doc/models/site-statistics.md index 4f3d34ec..8b5e970b 100644 --- a/doc/models/site-statistics.md +++ b/doc/models/site-statistics.md @@ -21,15 +21,17 @@ | `TotalUnpaidSubscriptions` | `Integer` | Optional | - | Integer getTotalUnpaidSubscriptions() | setTotalUnpaidSubscriptions(Integer totalUnpaidSubscriptions) | | `TotalDunningSubscriptions` | `Integer` | Optional | - | Integer getTotalDunningSubscriptions() | setTotalDunningSubscriptions(Integer totalDunningSubscriptions) | -## Example (as JSON) - -```json -{ - "total_subscriptions": 204, - "subscriptions_today": 134, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" -} +## Example + +```java +import com.maxio.advancedbilling.models.SiteStatistics; + +SiteStatistics siteStatistics = new SiteStatistics.Builder() + .totalSubscriptions(168) + .subscriptionsToday(170) + .totalRevenue("total_revenue2") + .revenueToday("revenue_today0") + .revenueThisMonth("revenue_this_month0") + .build(); ``` diff --git a/doc/models/site-summary.md b/doc/models/site-summary.md index a6d083c5..8332bd16 100644 --- a/doc/models/site-summary.md +++ b/doc/models/site-summary.md @@ -15,21 +15,24 @@ | `SiteCurrency` | `String` | Optional | - | String getSiteCurrency() | setSiteCurrency(String siteCurrency) | | `Stats` | [`SiteStatistics`](../../doc/models/site-statistics.md) | Optional | - | SiteStatistics getStats() | setStats(SiteStatistics stats) | -## Example (as JSON) - -```json -{ - "seller_name": "seller_name0", - "site_name": "site_name4", - "site_id": 218, - "site_currency": "site_currency6", - "stats": { - "total_subscriptions": 110, - "subscriptions_today": 228, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.SiteStatistics; +import com.maxio.advancedbilling.models.SiteSummary; + +SiteSummary siteSummary = new SiteSummary.Builder() + .sellerName("seller_name4") + .siteName("site_name8") + .siteId(252) + .siteCurrency("site_currency0") + .stats(new SiteStatistics.Builder() + .totalSubscriptions(110) + .subscriptionsToday(228) + .totalRevenue("total_revenue6") + .revenueToday("revenue_today4") + .revenueThisMonth("revenue_this_month4") + .build()) + .build(); ``` diff --git a/doc/models/site.md b/doc/models/site.md index 3bf1817a..a6838676 100644 --- a/doc/models/site.md +++ b/doc/models/site.md @@ -30,15 +30,17 @@ | `PortalEnabled` | `Boolean` | Optional | Whether the Billing Portal is enabled for this site. | Boolean getPortalEnabled() | setPortalEnabled(Boolean portalEnabled) | | `Test` | `Boolean` | Optional | - | Boolean getTest() | setTest(Boolean test) | -## Example (as JSON) - -```json -{ - "id": 34, - "name": "name0", - "subdomain": "subdomain4", - "currency": "currency0", - "seller_id": 198 -} +## Example + +```java +import com.maxio.advancedbilling.models.Site; + +Site site = new Site.Builder() + .id(64) + .name("name4") + .subdomain("subdomain0") + .currency("currency4") + .sellerId(228) + .build(); ``` diff --git a/doc/models/sorting-direction.md b/doc/models/sorting-direction.md index 547aa444..b0415fb3 100644 --- a/doc/models/sorting-direction.md +++ b/doc/models/sorting-direction.md @@ -14,3 +14,11 @@ Used for sorting results. | `ASC` | | `DESC` | +## Example + +```java +import com.maxio.advancedbilling.models.SortingDirection; + +SortingDirection sortingDirection = SortingDirection.ASC; +``` + diff --git a/doc/models/status.md b/doc/models/status.md index 3531d2ce..ca9dad4a 100644 --- a/doc/models/status.md +++ b/doc/models/status.md @@ -16,3 +16,11 @@ | `ACTIVE` | | `FULFILLED` | +## Example + +```java +import com.maxio.advancedbilling.models.Status; + +Status status = Status.PENDING; +``` + diff --git a/doc/models/subscription-add-coupon-error-exception.md b/doc/models/subscription-add-coupon-error-exception.md index b56536aa..cfa3ffb1 100644 --- a/doc/models/subscription-add-coupon-error-exception.md +++ b/doc/models/subscription-add-coupon-error-exception.md @@ -14,25 +14,15 @@ | `CouponCodes` | `List` | Optional | - | List getCouponCodes() | setCouponCodes(List couponCodes) | | `Subscription` | `List` | Optional | - | List getSubscription() | setSubscription(List subscription) | -## Example (as JSON) - -```json -{ - "codes": [ - "codes6", - "codes7", - "codes8" - ], - "coupon_code": [ - "coupon_code8", - "coupon_code7" - ], - "coupon_codes": [ - "coupon_codes2" - ], - "subscription": [ - "subscription8" - ] +## Example + +```java +try { + // make the API call +} catch (SubscriptionAddCouponErrorException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/subscription-component-allocation-error-exception.md b/doc/models/subscription-component-allocation-error-exception.md index ecd13b2a..2e2e8677 100644 --- a/doc/models/subscription-component-allocation-error-exception.md +++ b/doc/models/subscription-component-allocation-error-exception.md @@ -11,16 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`List`](../../doc/models/subscription-component-allocation-error-item.md) | Optional | - | List getErrors() | setErrors(List errors) | -## Example (as JSON) - -```json -{ - "errors": [ - { - "kind": "kind8", - "message": "message0" - } - ] +## Example + +```java +try { + // make the API call +} catch (SubscriptionComponentAllocationErrorException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/subscription-component-allocation-error-item.md b/doc/models/subscription-component-allocation-error-item.md index 2e8b37ae..7451f434 100644 --- a/doc/models/subscription-component-allocation-error-item.md +++ b/doc/models/subscription-component-allocation-error-item.md @@ -12,12 +12,14 @@ | `Kind` | `String` | Optional | - | String getKind() | setKind(String kind) | | `Message` | `String` | Optional | - | String getMessage() | setMessage(String message) | -## Example (as JSON) +## Example -```json -{ - "kind": "kind0", - "message": "message8" -} +```java +import com.maxio.advancedbilling.models.SubscriptionComponentAllocationErrorItem; + +SubscriptionComponentAllocationErrorItem subscriptionComponentAllocationErrorItem = new SubscriptionComponentAllocationErrorItem.Builder() + .kind("kind6") + .message("message8") + .build(); ``` diff --git a/doc/models/subscription-component-response.md b/doc/models/subscription-component-response.md index 0ace52b6..180804d6 100644 --- a/doc/models/subscription-component-response.md +++ b/doc/models/subscription-component-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Component` | [`SubscriptionComponent`](../../doc/models/subscription-component.md) | Optional | - | SubscriptionComponent getComponent() | setComponent(SubscriptionComponent component) | -## Example (as JSON) - -```json -{ - "component": { - "id": 80, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentKind; +import com.maxio.advancedbilling.models.SubscriptionComponent; +import com.maxio.advancedbilling.models.SubscriptionComponentResponse; + +SubscriptionComponentResponse subscriptionComponentResponse = new SubscriptionComponentResponse.Builder() + .component(new SubscriptionComponent.Builder() + .id(80) + .name("name8") + .kind(ComponentKind.QUANTITY_BASED_COMPONENT) + .unitName("unit_name0") + .enabled(false) + .build()) + .build(); ``` diff --git a/doc/models/subscription-component-subscription.md b/doc/models/subscription-component-subscription.md index 2abead2a..c2632743 100644 --- a/doc/models/subscription-component-subscription.md +++ b/doc/models/subscription-component-subscription.md @@ -1,7 +1,7 @@ # Subscription Component Subscription -An optional object, will be returned if provided `include=subscription` query param. +(Optional) Object that will be returned if the `include=subscription` query param is provided. ## Structure @@ -14,12 +14,16 @@ An optional object, will be returned if provided `include=subscription` query pa | `State` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | SubscriptionState getState() | setState(SubscriptionState state) | | `UpdatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | -## Example (as JSON) +## Example -```json -{ - "state": "paused", - "updated_at": "2016-03-13T12:52:32.123Z" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.SubscriptionComponentSubscription; +import com.maxio.advancedbilling.models.SubscriptionState; + +SubscriptionComponentSubscription subscriptionComponentSubscription = new SubscriptionComponentSubscription.Builder() + .state(SubscriptionState.ASSESSING) + .updatedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 8d7f2c27..7d87a00f 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -13,8 +13,8 @@ | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | ComponentKind getKind() | setKind(ComponentKind kind) | | `UnitName` | `String` | Optional | - | String getUnitName() | setUnitName(String unitName) | -| `Enabled` | `Boolean` | Optional | (for on/off components) indicates if the component is enabled for the subscription | Boolean getEnabled() | setEnabled(Boolean enabled) | -| `UnitBalance` | `Integer` | Optional | - | Integer getUnitBalance() | setUnitBalance(Integer unitBalance) | +| `Enabled` | `Boolean` | Optional | (for on/off components) indicates if the component is enabled for the subscription. | Boolean getEnabled() | setEnabled(Boolean enabled) | +| `UnitBalance` | [`SubscriptionComponentUnitBalance`](../../doc/models/containers/subscription-component-unit-balance.md) | Optional | This is a container for one-of cases. | SubscriptionComponentUnitBalance getUnitBalance() | setUnitBalance(SubscriptionComponentUnitBalance unitBalance) | | `Currency` | `String` | Optional | - | String getCurrency() | setCurrency(String currency) | | `AllocatedQuantity` | [`SubscriptionComponentAllocatedQuantity`](../../doc/models/containers/subscription-component-allocated-quantity.md) | Optional | This is a container for one-of cases. | SubscriptionComponentAllocatedQuantity getAllocatedQuantity() | setAllocatedQuantity(SubscriptionComponentAllocatedQuantity allocatedQuantity) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | @@ -36,21 +36,24 @@ | `UseSiteExchangeRate` | `Boolean` | Optional | - | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `Description` | `String` | Optional | - | String getDescription() | setDescription(String description) | | `AllowFractionalQuantities` | `Boolean` | Optional | - | Boolean getAllowFractionalQuantities() | setAllowFractionalQuantities(Boolean allowFractionalQuantities) | -| `Subscription` | [`SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | An optional object, will be returned if provided `include=subscription` query param. | SubscriptionComponentSubscription getSubscription() | setSubscription(SubscriptionComponentSubscription subscription) | +| `Subscription` | [`SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | (Optional) Object that will be returned if the `include=subscription` query param is provided. | SubscriptionComponentSubscription getSubscription() | setSubscription(SubscriptionComponentSubscription subscription) | | `HistoricUsages` | [`List`](../../doc/models/historic-usage.md) | Optional | - | List getHistoricUsages() | setHistoricUsages(List historicUsages) | | `DisplayOnHostedPage` | `Boolean` | Optional | - | Boolean getDisplayOnHostedPage() | setDisplayOnHostedPage(Boolean displayOnHostedPage) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | -## Example (as JSON) +## Example -```json -{ - "id": 20, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false -} +```java +import com.maxio.advancedbilling.models.ComponentKind; +import com.maxio.advancedbilling.models.SubscriptionComponent; + +SubscriptionComponent subscriptionComponent = new SubscriptionComponent.Builder() + .id(254) + .name("name8") + .kind(ComponentKind.QUANTITY_BASED_COMPONENT) + .unitName("unit_name0") + .enabled(false) + .build(); ``` diff --git a/doc/models/subscription-custom-price.md b/doc/models/subscription-custom-price.md index b21b15fc..94386524 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -19,25 +19,41 @@ | `TrialPriceInCents` | [`SubscriptionCustomPriceTrialPriceInCents`](../../doc/models/containers/subscription-custom-price-trial-price-in-cents.md) | Optional | This is a container for one-of cases. | SubscriptionCustomPriceTrialPriceInCents getTrialPriceInCents() | setTrialPriceInCents(SubscriptionCustomPriceTrialPriceInCents trialPriceInCents) | | `TrialInterval` | [`SubscriptionCustomPriceTrialInterval`](../../doc/models/containers/subscription-custom-price-trial-interval.md) | Optional | This is a container for one-of cases. | SubscriptionCustomPriceTrialInterval getTrialInterval() | setTrialInterval(SubscriptionCustomPriceTrialInterval trialInterval) | | `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | (Optional) | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | -| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | +| `TrialType` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | TrialType getTrialType() | setTrialType(TrialType trialType) | | `InitialChargeInCents` | [`SubscriptionCustomPriceInitialChargeInCents`](../../doc/models/containers/subscription-custom-price-initial-charge-in-cents.md) | Optional | This is a container for one-of cases. | SubscriptionCustomPriceInitialChargeInCents getInitialChargeInCents() | setInitialChargeInCents(SubscriptionCustomPriceInitialChargeInCents initialChargeInCents) | | `InitialChargeAfterTrial` | `Boolean` | Optional | (Optional) | Boolean getInitialChargeAfterTrial() | setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) | | `ExpirationInterval` | [`SubscriptionCustomPriceExpirationInterval`](../../doc/models/containers/subscription-custom-price-expiration-interval.md) | Optional | This is a container for one-of cases. | SubscriptionCustomPriceExpirationInterval getExpirationInterval() | setExpirationInterval(SubscriptionCustomPriceExpirationInterval expirationInterval) | | `ExpirationIntervalUnit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (Optional) | ExpirationIntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalUnit) | | `TaxIncluded` | `Boolean` | Optional | (Optional) | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" -} +## Example + +```java +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.SubscriptionCustomPrice; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceInterval; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPricePriceInCents; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceTrialInterval; +import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceTrialPriceInCents; + +SubscriptionCustomPrice subscriptionCustomPrice = new SubscriptionCustomPrice.Builder( + SubscriptionCustomPricePriceInCents.fromString( + "String5" + ), + SubscriptionCustomPriceInterval.fromString( + "String1" + ), + IntervalUnit.DAY +) +.name("name2") +.handle("handle8") +.trialPriceInCents(SubscriptionCustomPriceTrialPriceInCents.fromString( + "String5" + )) +.trialInterval(SubscriptionCustomPriceTrialInterval.fromString( + "String9" + )) +.trialIntervalUnit(IntervalUnit.DAY) +.build(); ``` diff --git a/doc/models/subscription-date-field.md b/doc/models/subscription-date-field.md index 3de7f3b6..ea030a07 100644 --- a/doc/models/subscription-date-field.md +++ b/doc/models/subscription-date-field.md @@ -19,3 +19,11 @@ | `TRIAL_ENDED_AT` | | `UPDATED_AT` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionDateField; + +SubscriptionDateField subscriptionDateField = SubscriptionDateField.UPDATED_AT; +``` + diff --git a/doc/models/subscription-filter.md b/doc/models/subscription-filter.md index 82621dd3..d4717e7b 100644 --- a/doc/models/subscription-filter.md +++ b/doc/models/subscription-filter.md @@ -18,19 +18,25 @@ Nested filter used for List Subscription Components For Site Filter | `StartDatetime` | `ZonedDateTime` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. To use this filter you also have to include the following param in the request `include=subscription`. | ZonedDateTime getStartDatetime() | setStartDatetime(ZonedDateTime startDatetime) | | `EndDatetime` | `ZonedDateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. To use this filter you also have to include the following param in the request `include=subscription`. | ZonedDateTime getEndDatetime() | setEndDatetime(ZonedDateTime endDatetime) | -## Example (as JSON) - -```json -{ - "states": [ - "active", - "canceled" - ], - "start_date": "2024-01-17", - "end_date": "2024-01-31", - "start_datetime": "01/17/2024 09:15:30", - "end_datetime": "01/17/2024 17:20:06", - "date_field": "updated_at" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.SubscriptionFilter; +import com.maxio.advancedbilling.models.SubscriptionListDateField; +import com.maxio.advancedbilling.models.SubscriptionStateFilter; +import java.util.Arrays; + +SubscriptionFilter subscriptionFilter = new SubscriptionFilter.Builder() + .states(Arrays.asList( + SubscriptionStateFilter.ACTIVE, + SubscriptionStateFilter.CANCELED + )) + .dateField(SubscriptionListDateField.UPDATED_AT) + .startDate(DateTimeHelper.fromSimpleDate("2024-01-17")) + .endDate(DateTimeHelper.fromSimpleDate("2024-01-31")) + .startDatetime(DateTimeHelper.fromRfc8601DateTime("2024-01-17T09:15:30+00:00")) + .endDatetime(DateTimeHelper.fromRfc8601DateTime("2024-01-17T17:20:06Z")) + .build(); ``` diff --git a/doc/models/subscription-group-balances.md b/doc/models/subscription-group-balances.md index 5e81ccaa..117506b2 100644 --- a/doc/models/subscription-group-balances.md +++ b/doc/models/subscription-group-balances.md @@ -14,30 +14,33 @@ | `OpenInvoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | - | AccountBalance getOpenInvoices() | setOpenInvoices(AccountBalance openInvoices) | | `PendingDiscounts` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | - | AccountBalance getPendingDiscounts() | setPendingDiscounts(AccountBalance pendingDiscounts) | -## Example (as JSON) - -```json -{ - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 - }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 - }, - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 - }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.AccountBalance; +import com.maxio.advancedbilling.models.SubscriptionGroupBalances; + +SubscriptionGroupBalances subscriptionGroupBalances = new SubscriptionGroupBalances.Builder() + .prepayments(new AccountBalance.Builder() + .balanceInCents(192L) + .automaticBalanceInCents(178L) + .remittanceBalanceInCents(146L) + .build()) + .serviceCredits(new AccountBalance.Builder() + .balanceInCents(84L) + .automaticBalanceInCents(70L) + .remittanceBalanceInCents(38L) + .build()) + .openInvoices(new AccountBalance.Builder() + .balanceInCents(40L) + .automaticBalanceInCents(202L) + .remittanceBalanceInCents(170L) + .build()) + .pendingDiscounts(new AccountBalance.Builder() + .balanceInCents(88L) + .automaticBalanceInCents(154L) + .remittanceBalanceInCents(134L) + .build()) + .build(); ``` diff --git a/doc/models/subscription-group-bank-account.md b/doc/models/subscription-group-bank-account.md index a095ad90..03504586 100644 --- a/doc/models/subscription-group-bank-account.md +++ b/doc/models/subscription-group-bank-account.md @@ -11,9 +11,9 @@ | --- | --- | --- | --- | --- | --- | | `BankName` | `String` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | String getBankName() | setBankName(String bankName) | | `BankAccountNumber` | `String` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | String getBankAccountNumber() | setBankAccountNumber(String bankAccountNumber) | -| `BankRoutingNumber` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | String getBankRoutingNumber() | setBankRoutingNumber(String bankRoutingNumber) | -| `BankIban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | String getBankIban() | setBankIban(String bankIban) | -| `BankBranchCode` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | String getBankBranchCode() | setBankBranchCode(String bankBranchCode) | +| `BankRoutingNumber` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless.) The routing number of the bank. It becomes bank_code while passing via GoCardless API. | String getBankRoutingNumber() | setBankRoutingNumber(String bankRoutingNumber) | +| `BankIban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | String getBankIban() | setBankIban(String bankIban) | +| `BankBranchCode` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | String getBankBranchCode() | setBankBranchCode(String bankBranchCode) | | `BankAccountType` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | BankAccountType getBankAccountType() | setBankAccountType(BankAccountType bankAccountType) | | `BankAccountHolderType` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | BankAccountHolderType getBankAccountHolderType() | setBankAccountHolderType(BankAccountHolderType bankAccountHolderType) | | `PaymentType` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | PaymentType getPaymentType() | setPaymentType(PaymentType paymentType) | @@ -26,15 +26,17 @@ | `CurrentVault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | BankAccountVault getCurrentVault() | setCurrentVault(BankAccountVault currentVault) | | `GatewayHandle` | `String` | Optional | - | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | -## Example (as JSON) +## Example -```json -{ - "bank_name": "bank_name2", - "bank_account_number": "bank_account_number4", - "bank_routing_number": "bank_routing_number8", - "bank_iban": "bank_iban6", - "bank_branch_code": "bank_branch_code6" -} +```java +import com.maxio.advancedbilling.models.SubscriptionGroupBankAccount; + +SubscriptionGroupBankAccount subscriptionGroupBankAccount = new SubscriptionGroupBankAccount.Builder() + .bankName("bank_name2") + .bankAccountNumber("bank_account_number4") + .bankRoutingNumber("bank_routing_number8") + .bankIban("bank_iban6") + .bankBranchCode("bank_branch_code6") + .build(); ``` diff --git a/doc/models/subscription-group-component-custom-price.md b/doc/models/subscription-group-component-custom-price.md index 5d01736f..6f515117 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -15,34 +15,115 @@ Used in place of `price_point_id` to define a custom price point unique to the s | `Prices` | [`List`](../../doc/models/price.md) | Optional | - | List getPrices() | setPrices(List prices) | | `OveragePricing` | [`List`](../../doc/models/component-custom-price.md) | Optional | - | List getOveragePricing() | setOveragePricing(List overagePricing) | -## Example (as JSON) - -```json -{ - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "overage_pricing": [ - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCustomPrice; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.SubscriptionGroupComponentCustomPrice; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +SubscriptionGroupComponentCustomPrice subscriptionGroupComponentCustomPrice = new SubscriptionGroupComponentCustomPrice.Builder() + .pricingScheme(PricingScheme.STAIRSTEP) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .overagePricing(Arrays.asList( + new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(230) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(10) + .build(), + new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(230) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(10) + .build(), + new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(230) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(10) + .build() + )) + .build(); ``` diff --git a/doc/models/subscription-group-create-error-response-exception.md b/doc/models/subscription-group-create-error-response-exception.md index edc6618f..940f3632 100644 --- a/doc/models/subscription-group-create-error-response-exception.md +++ b/doc/models/subscription-group-create-error-response-exception.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`SubscriptionGroupCreateErrorResponseErrors`](../../doc/models/containers/subscription-group-create-error-response-errors.md) | Required | This is a container for one-of cases. | SubscriptionGroupCreateErrorResponseErrors getErrors() | setErrors(SubscriptionGroupCreateErrorResponseErrors errors) | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members6" - ] - } +## Example + +```java +try { + // make the API call +} catch (SubscriptionGroupCreateErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index 5d78cb6e..b8a81956 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -30,16 +30,22 @@ | `Cvv` | `String` | Optional | - | String getCvv() | setCvv(String cvv) | | `PaymentType` | `String` | Optional | - | String getPaymentType() | setPaymentType(String paymentType) | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_592nf92ng0sjd4300p", - "full_number": 4111111111111111, - "vault_token": "vault_token6", - "current_vault": "braintree_blue", - "gateway_handle": "gateway_handle6", - "first_name": "first_name4" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreditCardVault; +import com.maxio.advancedbilling.models.SubscriptionGroupCreditCard; +import com.maxio.advancedbilling.models.containers.SubscriptionGroupCreditCardFullNumber; + +SubscriptionGroupCreditCard subscriptionGroupCreditCard = new SubscriptionGroupCreditCard.Builder() + .chargifyToken("tok_592nf92ng0sjd4300p") + .vaultToken("vault_token0") + .currentVault(CreditCardVault.BLUE_SNAP) + .gatewayHandle("gateway_handle0") + .firstName("first_name8") + .fullNumber(SubscriptionGroupCreditCardFullNumber.fromNumber( + 4111111111111111 + )) + .build(); ``` diff --git a/doc/models/subscription-group-customer.md b/doc/models/subscription-group-customer.md index 33d39090..2ee5fd30 100644 --- a/doc/models/subscription-group-customer.md +++ b/doc/models/subscription-group-customer.md @@ -15,15 +15,17 @@ | `Email` | `String` | Optional | - | String getEmail() | setEmail(String email) | | `Reference` | `String` | Optional | - | String getReference() | setReference(String reference) | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization2", - "email": "email2", - "reference": "reference0" -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupCustomer; + +SubscriptionGroupCustomer subscriptionGroupCustomer = new SubscriptionGroupCustomer.Builder() + .firstName("first_name6") + .lastName("last_name4") + .organization("organization0") + .email("email0") + .reference("reference8") + .build(); ``` diff --git a/doc/models/subscription-group-include.md b/doc/models/subscription-group-include.md index 3225e28e..4c067ea5 100644 --- a/doc/models/subscription-group-include.md +++ b/doc/models/subscription-group-include.md @@ -11,3 +11,11 @@ | --- | | `CURRENT_BILLING_AMOUNT_IN_CENTS` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupInclude; + +SubscriptionGroupInclude subscriptionGroupInclude = SubscriptionGroupInclude.CURRENT_BILLING_AMOUNT_IN_CENTS; +``` + diff --git a/doc/models/subscription-group-item.md b/doc/models/subscription-group-item.md index 2146544d..f27ef5e1 100644 --- a/doc/models/subscription-group-item.md +++ b/doc/models/subscription-group-item.md @@ -20,15 +20,17 @@ | `TotalRevenueInCents` | `Long` | Optional | - | Long getTotalRevenueInCents() | setTotalRevenueInCents(Long totalRevenueInCents) | | `BalanceInCents` | `Long` | Optional | - | Long getBalanceInCents() | setBalanceInCents(Long balanceInCents) | -## Example (as JSON) - -```json -{ - "id": 16, - "reference": "reference8", - "product_id": 214, - "product_handle": "product_handle4", - "product_price_point_id": 138 -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupItem; + +SubscriptionGroupItem subscriptionGroupItem = new SubscriptionGroupItem.Builder() + .id(26) + .reference("reference4") + .productId(32) + .productHandle("product_handle8") + .productPricePointId(148) + .build(); ``` diff --git a/doc/models/subscription-group-members-array-error.md b/doc/models/subscription-group-members-array-error.md index ccae2d56..77223e2a 100644 --- a/doc/models/subscription-group-members-array-error.md +++ b/doc/models/subscription-group-members-array-error.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | --- | --- | | `Members` | `List` | Required | - | List getMembers() | setMembers(List members) | -## Example (as JSON) - -```json -{ - "members": [ - "members6" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupMembersArrayError; +import java.util.Arrays; + +SubscriptionGroupMembersArrayError subscriptionGroupMembersArrayError = new SubscriptionGroupMembersArrayError.Builder( + Arrays.asList( + "members6" + ) +) +.build(); ``` diff --git a/doc/models/subscription-group-payment-profile.md b/doc/models/subscription-group-payment-profile.md index 927fc6cc..1d0af1f3 100644 --- a/doc/models/subscription-group-payment-profile.md +++ b/doc/models/subscription-group-payment-profile.md @@ -14,14 +14,16 @@ | `LastName` | `String` | Optional | - | String getLastName() | setLastName(String lastName) | | `MaskedCardNumber` | `String` | Optional | - | String getMaskedCardNumber() | setMaskedCardNumber(String maskedCardNumber) | -## Example (as JSON) - -```json -{ - "id": 22, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupPaymentProfile; + +SubscriptionGroupPaymentProfile subscriptionGroupPaymentProfile = new SubscriptionGroupPaymentProfile.Builder() + .id(246) + .firstName("first_name6") + .lastName("last_name4") + .maskedCardNumber("masked_card_number4") + .build(); ``` diff --git a/doc/models/subscription-group-prepayment-method.md b/doc/models/subscription-group-prepayment-method.md index dc41027f..1fdb7812 100644 --- a/doc/models/subscription-group-prepayment-method.md +++ b/doc/models/subscription-group-prepayment-method.md @@ -16,3 +16,11 @@ | `PAYPAL_ACCOUNT` | | `OTHER` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupPrepaymentMethod; + +SubscriptionGroupPrepaymentMethod subscriptionGroupPrepaymentMethod = SubscriptionGroupPrepaymentMethod.CHECK; +``` + diff --git a/doc/models/subscription-group-prepayment-request.md b/doc/models/subscription-group-prepayment-request.md index 88fe8f6d..a4bc9232 100644 --- a/doc/models/subscription-group-prepayment-request.md +++ b/doc/models/subscription-group-prepayment-request.md @@ -11,16 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Prepayment` | [`SubscriptionGroupPrepayment`](../../doc/models/subscription-group-prepayment.md) | Required | - | SubscriptionGroupPrepayment getPrepayment() | setPrepayment(SubscriptionGroupPrepayment prepayment) | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 136, - "details": "details8", - "memo": "memo2", - "method": "paypal_account" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupPrepayment; +import com.maxio.advancedbilling.models.SubscriptionGroupPrepaymentMethod; +import com.maxio.advancedbilling.models.SubscriptionGroupPrepaymentRequest; + +SubscriptionGroupPrepaymentRequest subscriptionGroupPrepaymentRequest = new SubscriptionGroupPrepaymentRequest.Builder( + new SubscriptionGroupPrepayment.Builder( + 136, + "details8", + "memo2", + SubscriptionGroupPrepaymentMethod.PAYPAL_ACCOUNT + ) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-group-prepayment-response.md b/doc/models/subscription-group-prepayment-response.md index f8f6eb4c..0426ab14 100644 --- a/doc/models/subscription-group-prepayment-response.md +++ b/doc/models/subscription-group-prepayment-response.md @@ -15,15 +15,18 @@ | `EntryType` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | ServiceCreditType getEntryType() | setEntryType(ServiceCreditType entryType) | | `Memo` | `String` | Optional | A memo attached to the entry. | String getMemo() | setMemo(String memo) | -## Example (as JSON) - -```json -{ - "id": 110, - "amount_in_cents": 196, - "ending_balance_in_cents": 236, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```java +import com.maxio.advancedbilling.models.ServiceCreditType; +import com.maxio.advancedbilling.models.SubscriptionGroupPrepaymentResponse; + +SubscriptionGroupPrepaymentResponse subscriptionGroupPrepaymentResponse = new SubscriptionGroupPrepaymentResponse.Builder() + .id(32) + .amountInCents(138L) + .endingBalanceInCents(158L) + .entryType(ServiceCreditType.CREDIT) + .memo("memo2") + .build(); ``` diff --git a/doc/models/subscription-group-prepayment.md b/doc/models/subscription-group-prepayment.md index 56f35f14..679e6a59 100644 --- a/doc/models/subscription-group-prepayment.md +++ b/doc/models/subscription-group-prepayment.md @@ -14,14 +14,18 @@ | `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | | `Method` | [`SubscriptionGroupPrepaymentMethod`](../../doc/models/subscription-group-prepayment-method.md) | Required | - | SubscriptionGroupPrepaymentMethod getMethod() | setMethod(SubscriptionGroupPrepaymentMethod method) | -## Example (as JSON) - -```json -{ - "amount": 96, - "details": "details2", - "memo": "memo6", - "method": "money_order" -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupPrepayment; +import com.maxio.advancedbilling.models.SubscriptionGroupPrepaymentMethod; + +SubscriptionGroupPrepayment subscriptionGroupPrepayment = new SubscriptionGroupPrepayment.Builder( + 12, + "details4", + "memo8", + SubscriptionGroupPrepaymentMethod.MONEY_ORDER +) +.build(); ``` diff --git a/doc/models/subscription-group-response.md b/doc/models/subscription-group-response.md index e43d5ce1..39c9a31b 100644 --- a/doc/models/subscription-group-response.md +++ b/doc/models/subscription-group-response.md @@ -11,25 +11,32 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionGroup` | [`SubscriptionGroup`](../../doc/models/subscription-group.md) | Required | - | SubscriptionGroup getSubscriptionGroup() | setSubscriptionGroup(SubscriptionGroup subscriptionGroup) | -## Example (as JSON) - -```json -{ - "subscription_group": { - "uid": "uid8", - "customer_id": 220, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "prepaid", - "subscription_ids": [ - 74, - 75 - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CollectionMethod; +import com.maxio.advancedbilling.models.SubscriptionGroup; +import com.maxio.advancedbilling.models.SubscriptionGroupPaymentProfile; +import com.maxio.advancedbilling.models.SubscriptionGroupResponse; +import java.util.Arrays; + +SubscriptionGroupResponse subscriptionGroupResponse = new SubscriptionGroupResponse.Builder( + new SubscriptionGroup.Builder() + .uid("uid8") + .customerId(220) + .paymentProfile(new SubscriptionGroupPaymentProfile.Builder() + .id(44) + .firstName("first_name4") + .lastName("last_name2") + .maskedCardNumber("masked_card_number2") + .build()) + .paymentCollectionMethod(CollectionMethod.PREPAID) + .subscriptionIds(Arrays.asList( + 74, + 75 + )) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-group-signup-component.md b/doc/models/subscription-group-signup-component.md index 08a30d69..a1fc583f 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -15,73 +15,134 @@ | `PricePointId` | [`SubscriptionGroupSignupComponentPricePointId`](../../doc/models/containers/subscription-group-signup-component-price-point-id.md) | Optional | This is a container for one-of cases. | SubscriptionGroupSignupComponentPricePointId getPricePointId() | setPricePointId(SubscriptionGroupSignupComponentPricePointId pricePointId) | | `CustomPrice` | [`SubscriptionGroupComponentCustomPrice`](../../doc/models/subscription-group-component-custom-price.md) | Optional | Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. | SubscriptionGroupComponentCustomPrice getCustomPrice() | setCustomPrice(SubscriptionGroupComponentCustomPrice customPrice) | -## Example (as JSON) +## Example -```json -{ - "component_id": "String1", - "allocated_quantity": "String5", - "unit_balance": "String9", - "price_point_id": "String5", - "custom_price": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "overage_pricing": [ - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - ] - } -} +```java +import com.maxio.advancedbilling.models.ComponentCustomPrice; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.SubscriptionGroupComponentCustomPrice; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupComponent; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import com.maxio.advancedbilling.models.containers.SubscriptionGroupSignupComponentAllocatedQuantity; +import com.maxio.advancedbilling.models.containers.SubscriptionGroupSignupComponentComponentId; +import com.maxio.advancedbilling.models.containers.SubscriptionGroupSignupComponentPricePointId; +import com.maxio.advancedbilling.models.containers.SubscriptionGroupSignupComponentUnitBalance; +import java.util.Arrays; + +SubscriptionGroupSignupComponent subscriptionGroupSignupComponent = new SubscriptionGroupSignupComponent.Builder() + .componentId(SubscriptionGroupSignupComponentComponentId.fromString( + "String7" + )) + .allocatedQuantity(SubscriptionGroupSignupComponentAllocatedQuantity.fromString( + "String1" + )) + .unitBalance(SubscriptionGroupSignupComponentUnitBalance.fromString( + "String5" + )) + .pricePointId(SubscriptionGroupSignupComponentPricePointId.fromString( + "String1" + )) + .customPrice(new SubscriptionGroupComponentCustomPrice.Builder() + .pricingScheme(PricingScheme.STAIRSTEP) + .prices(Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + )) + .overagePricing(Arrays.asList( + new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(230) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(10) + .build(), + new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(230) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(10) + .build(), + new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(230) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(10) + .build() + )) + .build()) + .build(); ``` diff --git a/doc/models/subscription-group-signup-error-response-exception.md b/doc/models/subscription-group-signup-error-response-exception.md index d50d9117..2489ef34 100644 --- a/doc/models/subscription-group-signup-error-response-exception.md +++ b/doc/models/subscription-group-signup-error-response-exception.md @@ -11,60 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`SubscriptionGroupSignupError`](../../doc/models/subscription-group-signup-error.md) | Required | - | SubscriptionGroupSignupError getErrors() | setErrors(SubscriptionGroupSignupError errors) | -## Example (as JSON) - -```json -{ - "errors": { - "subscriptions": { - "0": { - "payment_profile.chargify_token": [ - "Chargify token not found" - ], - "product": [ - "Product must be among the Products for this Site" - ], - "product_price_point_id": [ - "Product price point must belong to product." - ], - "base": [ - "No payment method was on file for the $30.00 balance'" - ], - "payment_profile.expiration_month": [ - "Credit card expiration month: cannot be blank." - ], - "payment_profile.expiration_year": [ - "Credit card expiration year: cannot be blank." - ], - "payment_profile.full_number": [ - "Credit card number: cannot be blank." - ], - "payment_profile": [ - "payment_profile2" - ] - } - }, - "payer_reference": "payer_reference4", - "payer": { - "last_name": [ - "last_name5", - "last_name6" - ], - "first_name": [ - "first_name8" - ], - "email": [ - "email0", - "email9" - ] - }, - "subscription_group": [ - "subscription_group7", - "subscription_group8", - "subscription_group9" - ], - "payment_profile_id": "payment_profile_id8" - } +## Example + +```java +try { + // make the API call +} catch (SubscriptionGroupSignupErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/subscription-group-signup-error.md b/doc/models/subscription-group-signup-error.md index d6e0375a..87a68b2f 100644 --- a/doc/models/subscription-group-signup-error.md +++ b/doc/models/subscription-group-signup-error.md @@ -16,67 +16,92 @@ | `PaymentProfileId` | `String` | Optional | - | String getPaymentProfileId() | setPaymentProfileId(String paymentProfileId) | | `PayerId` | `String` | Optional | - | String getPayerId() | setPayerId(String payerId) | -## Example (as JSON) +## Example -```json -{ - "subscriptions": { - "key0": { - "product": [ - "product9" - ], - "product_price_point_id": [ - "product_price_point_id7" - ], - "payment_profile": [ - "payment_profile2" - ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" - ], - "base": [ - "base5", - "base6" - ] - }, - "key1": { - "product": [ - "product9" - ], - "product_price_point_id": [ - "product_price_point_id7" - ], - "payment_profile": [ - "payment_profile2" - ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" - ], - "base": [ - "base5", - "base6" - ] - } - }, - "payer_reference": "payer_reference0", - "payer": { - "last_name": [ - "last_name5", - "last_name6" - ], - "first_name": [ - "first_name8" - ], - "email": [ - "email0", - "email9" - ] - }, - "subscription_group": [ - "subscription_group1", - "subscription_group2" - ], - "payment_profile_id": "payment_profile_id2" -} +```java +import com.maxio.advancedbilling.models.PayerError; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupError; +import com.maxio.advancedbilling.models.SubscriptionGroupSubscriptionError; +import java.util.Arrays; +import java.util.LinkedHashMap; + +SubscriptionGroupSignupError subscriptionGroupSignupError = new SubscriptionGroupSignupError.Builder() + .subscriptions(new LinkedHashMap() {{ + put("key0", new SubscriptionGroupSubscriptionError.Builder() + .product(Arrays.asList( + "product9" + )) + .productPricePointId(Arrays.asList( + "product_price_point_id7" + )) + .paymentProfile(Arrays.asList( + "payment_profile2" + )) + .paymentProfileChargifyToken(Arrays.asList( + "payment_profile.chargify_token6" + )) + .base(Arrays.asList( + "base5", + "base6" + )) + .build()); + put("key1", new SubscriptionGroupSubscriptionError.Builder() + .product(Arrays.asList( + "product9" + )) + .productPricePointId(Arrays.asList( + "product_price_point_id7" + )) + .paymentProfile(Arrays.asList( + "payment_profile2" + )) + .paymentProfileChargifyToken(Arrays.asList( + "payment_profile.chargify_token6" + )) + .base(Arrays.asList( + "base5", + "base6" + )) + .build()); + put("key2", new SubscriptionGroupSubscriptionError.Builder() + .product(Arrays.asList( + "product9" + )) + .productPricePointId(Arrays.asList( + "product_price_point_id7" + )) + .paymentProfile(Arrays.asList( + "payment_profile2" + )) + .paymentProfileChargifyToken(Arrays.asList( + "payment_profile.chargify_token6" + )) + .base(Arrays.asList( + "base5", + "base6" + )) + .build()); + }}) + .payerReference("payer_reference8") + .payer(new PayerError.Builder() + .lastName(Arrays.asList( + "last_name5", + "last_name6" + )) + .firstName(Arrays.asList( + "first_name8" + )) + .email(Arrays.asList( + "email0", + "email9" + )) + .build()) + .subscriptionGroup(Arrays.asList( + "subscription_group3", + "subscription_group4", + "subscription_group5" + )) + .paymentProfileId("payment_profile_id4") + .build(); ``` diff --git a/doc/models/subscription-group-signup-event-data.md b/doc/models/subscription-group-signup-event-data.md index 15133759..b021179f 100644 --- a/doc/models/subscription-group-signup-event-data.md +++ b/doc/models/subscription-group-signup-event-data.md @@ -12,30 +12,36 @@ | `SubscriptionGroup` | [`SubscriptionGroupSignupFailureData`](../../doc/models/subscription-group-signup-failure-data.md) | Required | - | SubscriptionGroupSignupFailureData getSubscriptionGroup() | setSubscriptionGroup(SubscriptionGroupSignupFailureData subscriptionGroup) | | `Customer` | [`Customer`](../../doc/models/customer.md) | Required | - | Customer getCustomer() | setCustomer(Customer customer) | -## Example (as JSON) - -```json -{ - "subscription_group": { - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_profile_id": 128, - "payment_collection_method": "payment_collection_method8", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - }, - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Customer; +import com.maxio.advancedbilling.models.PayerAttributes; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupEventData; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupFailureData; + +SubscriptionGroupSignupEventData subscriptionGroupSignupEventData = new SubscriptionGroupSignupEventData.Builder( + new SubscriptionGroupSignupFailureData.Builder() + .payerId(150) + .payerReference("payer_reference6") + .paymentProfileId(128) + .paymentCollectionMethod("payment_collection_method8") + .payerAttributes(new PayerAttributes.Builder() + .firstName("first_name2") + .lastName("last_name0") + .email("email4") + .ccEmails("cc_emails2") + .organization("organization6") + .build()) + .build(), + new Customer.Builder() + .firstName("first_name0") + .lastName("last_name8") + .email("email6") + .ccEmails("cc_emails0") + .organization("organization6") + .build() +) +.build(); ``` diff --git a/doc/models/subscription-group-signup-failure-data.md b/doc/models/subscription-group-signup-failure-data.md index 86fe57eb..9fa61ea0 100644 --- a/doc/models/subscription-group-signup-failure-data.md +++ b/doc/models/subscription-group-signup-failure-data.md @@ -18,21 +18,24 @@ | `BankAccountAttributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | SubscriptionGroupBankAccount getBankAccountAttributes() | setBankAccountAttributes(SubscriptionGroupBankAccount bankAccountAttributes) | | `Subscriptions` | [`List`](../../doc/models/subscription-group-signup-item.md) | Optional | - | List getSubscriptions() | setSubscriptions(List subscriptions) | -## Example (as JSON) - -```json -{ - "payer_id": 16, - "payer_reference": "payer_reference8", - "payment_profile_id": 6, - "payment_collection_method": "payment_collection_method0", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.PayerAttributes; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupFailureData; + +SubscriptionGroupSignupFailureData subscriptionGroupSignupFailureData = new SubscriptionGroupSignupFailureData.Builder() + .payerId(236) + .payerReference("payer_reference2") + .paymentProfileId(42) + .paymentCollectionMethod("payment_collection_method4") + .payerAttributes(new PayerAttributes.Builder() + .firstName("first_name2") + .lastName("last_name0") + .email("email4") + .ccEmails("cc_emails2") + .organization("organization6") + .build()) + .build(); ``` diff --git a/doc/models/subscription-group-signup-item.md b/doc/models/subscription-group-signup-item.md index 03881048..c7236b18 100644 --- a/doc/models/subscription-group-signup-item.md +++ b/doc/models/subscription-group-signup-item.md @@ -13,29 +13,32 @@ | `ProductId` | `Integer` | Optional | The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. | Integer getProductId() | setProductId(Integer productId) | | `ProductPricePointId` | `Integer` | Optional | The ID of the particular price point on the product. | Integer getProductPricePointId() | setProductPricePointId(Integer productPricePointId) | | `ProductPricePointHandle` | `String` | Optional | The user-friendly API handle of a product's particular price point. | String getProductPricePointHandle() | setProductPricePointHandle(String productPricePointHandle) | -| `OfferId` | `Integer` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:` | Integer getOfferId() | setOfferId(Integer offerId) | -| `Reference` | `String` | Optional | The reference value (provided by your app) for the subscription itelf. | String getReference() | setReference(String reference) | +| `OfferId` | `Integer` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:`. | Integer getOfferId() | setOfferId(Integer offerId) | +| `Reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | String getReference() | setReference(String reference) | | `Primary` | `Boolean` | Optional | One of the subscriptions must be marked as primary in the group. | Boolean getPrimary() | setPrimary(Boolean primary) | | `Currency` | `String` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | String getCurrency() | setCurrency(String currency) | | `CouponCodes` | `List` | Optional | An array for all the coupons attached to the subscription. | List getCouponCodes() | setCouponCodes(List couponCodes) | | `Components` | [`List`](../../doc/models/subscription-group-signup-component.md) | Optional | - | List getComponents() | setComponents(List components) | | `CustomPrice` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. | SubscriptionCustomPrice getCustomPrice() | setCustomPrice(SubscriptionCustomPrice customPrice) | -| `CalendarBilling` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | CalendarBilling getCalendarBilling() | setCalendarBilling(CalendarBilling calendarBilling) | +| `CalendarBilling` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | CalendarBilling getCalendarBilling() | setCalendarBilling(CalendarBilling calendarBilling) | | `Metafields` | `Map` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | Map getMetafields() | setMetafields(Map metafields) | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle2", - "product_id": 34, - "product_price_point_id": 214, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 150 -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupSignupItem; +import java.util.LinkedHashMap; + +SubscriptionGroupSignupItem subscriptionGroupSignupItem = new SubscriptionGroupSignupItem.Builder() + .productHandle("product_handle8") + .productId(12) + .productPricePointId(192) + .productPricePointHandle("product_price_point_handle8") + .offerId(172) + .metafields(new LinkedHashMap() {{ + put("custom_field_name_1", "custom_field_value_1"); + put("custom_field_name_2", "custom_field_value_2"); + }}) + .build(); ``` diff --git a/doc/models/subscription-group-signup-request.md b/doc/models/subscription-group-signup-request.md index 93c89056..702b7eee 100644 --- a/doc/models/subscription-group-signup-request.md +++ b/doc/models/subscription-group-signup-request.md @@ -11,36 +11,46 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionGroup` | [`SubscriptionGroupSignup`](../../doc/models/subscription-group-signup.md) | Required | - | SubscriptionGroupSignup getSubscriptionGroup() | setSubscriptionGroup(SubscriptionGroupSignup subscriptionGroup) | -## Example (as JSON) - -```json -{ - "subscription_group": { - "subscriptions": [ - { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 - } - ], - "payment_profile_id": 128, - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_collection_method": "prepaid", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CollectionMethod; +import com.maxio.advancedbilling.models.PayerAttributes; +import com.maxio.advancedbilling.models.SubscriptionGroupSignup; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupItem; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupRequest; +import java.util.Arrays; +import java.util.LinkedHashMap; + +SubscriptionGroupSignupRequest subscriptionGroupSignupRequest = new SubscriptionGroupSignupRequest.Builder( + new SubscriptionGroupSignup.Builder( + Arrays.asList( + new SubscriptionGroupSignupItem.Builder() + .productHandle("product_handle8") + .productId(144) + .productPricePointId(68) + .productPricePointHandle("product_price_point_handle4") + .offerId(40) + .metafields(new LinkedHashMap() {{ + put("custom_field_name_1", "custom_field_value_1"); + put("custom_field_name_2", "custom_field_value_2"); + }}) + .build() + ) + ) + .paymentProfileId(128) + .payerId(150) + .payerReference("payer_reference6") + .paymentCollectionMethod(CollectionMethod.PREPAID) + .payerAttributes(new PayerAttributes.Builder() + .firstName("first_name2") + .lastName("last_name0") + .email("email4") + .ccEmails("cc_emails2") + .organization("organization6") + .build()) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-group-signup-response.md b/doc/models/subscription-group-signup-response.md index 47405ebe..15d58d87 100644 --- a/doc/models/subscription-group-signup-response.md +++ b/doc/models/subscription-group-signup-response.md @@ -21,19 +21,20 @@ | `Subscriptions` | [`List`](../../doc/models/subscription-group-item.md) | Optional | - | List getSubscriptions() | setSubscriptions(List subscriptions) | | `PaymentCollectionMethod` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | CollectionMethod getPaymentCollectionMethod() | setPaymentCollectionMethod(CollectionMethod paymentCollectionMethod) | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 28, - "customer_id": 48, - "payment_profile_id": 44, - "subscription_ids": [ - 158, - 159, - 160 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupSignupResponse; +import java.util.Arrays; + +SubscriptionGroupSignupResponse subscriptionGroupSignupResponse = new SubscriptionGroupSignupResponse.Builder() + .uid("uid4") + .scheme(60) + .customerId(80) + .paymentProfileId(244) + .subscriptionIds(Arrays.asList( + 190 + )) + .build(); ``` diff --git a/doc/models/subscription-group-signup.md b/doc/models/subscription-group-signup.md index 8e476e64..adcb8d6a 100644 --- a/doc/models/subscription-group-signup.md +++ b/doc/models/subscription-group-signup.md @@ -18,34 +18,42 @@ | `BankAccountAttributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | SubscriptionGroupBankAccount getBankAccountAttributes() | setBankAccountAttributes(SubscriptionGroupBankAccount bankAccountAttributes) | | `Subscriptions` | [`List`](../../doc/models/subscription-group-signup-item.md) | Required | - | List getSubscriptions() | setSubscriptions(List subscriptions) | -## Example (as JSON) - -```json -{ - "subscriptions": [ - { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 - } - ], - "payment_profile_id": 42, - "payer_id": 64, - "payer_reference": "payer_reference8", - "payment_collection_method": "automatic", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CollectionMethod; +import com.maxio.advancedbilling.models.PayerAttributes; +import com.maxio.advancedbilling.models.SubscriptionGroupSignup; +import com.maxio.advancedbilling.models.SubscriptionGroupSignupItem; +import java.util.Arrays; +import java.util.LinkedHashMap; + +SubscriptionGroupSignup subscriptionGroupSignup = new SubscriptionGroupSignup.Builder( + Arrays.asList( + new SubscriptionGroupSignupItem.Builder() + .productHandle("product_handle8") + .productId(144) + .productPricePointId(68) + .productPricePointHandle("product_price_point_handle4") + .offerId(40) + .metafields(new LinkedHashMap() {{ + put("custom_field_name_1", "custom_field_value_1"); + put("custom_field_name_2", "custom_field_value_2"); + }}) + .build() + ) +) +.paymentProfileId(124) +.payerId(146) +.payerReference("payer_reference0") +.paymentCollectionMethod(CollectionMethod.PREPAID) +.payerAttributes(new PayerAttributes.Builder() + .firstName("first_name2") + .lastName("last_name0") + .email("email4") + .ccEmails("cc_emails2") + .organization("organization6") + .build()) +.build(); ``` diff --git a/doc/models/subscription-group-single-error.md b/doc/models/subscription-group-single-error.md index 0555d29c..5d026a11 100644 --- a/doc/models/subscription-group-single-error.md +++ b/doc/models/subscription-group-single-error.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionGroup` | `String` | Required | - | String getSubscriptionGroup() | setSubscriptionGroup(String subscriptionGroup) | -## Example (as JSON) +## Example -```json -{ - "subscription_group": "subscription_group2" -} +```java +import com.maxio.advancedbilling.models.SubscriptionGroupSingleError; + +SubscriptionGroupSingleError subscriptionGroupSingleError = new SubscriptionGroupSingleError.Builder( + "subscription_group0" +) +.build(); ``` diff --git a/doc/models/subscription-group-subscription-error.md b/doc/models/subscription-group-subscription-error.md index 78ee69a4..bc1adbad 100644 --- a/doc/models/subscription-group-subscription-error.md +++ b/doc/models/subscription-group-subscription-error.md @@ -20,31 +20,34 @@ Object which contains subscription errors. | `PaymentProfileExpirationYear` | `List` | Optional | - | List getPaymentProfileExpirationYear() | setPaymentProfileExpirationYear(List paymentProfileExpirationYear) | | `PaymentProfileFullNumber` | `List` | Optional | - | List getPaymentProfileFullNumber() | setPaymentProfileFullNumber(List paymentProfileFullNumber) | -## Example (as JSON) - -```json -{ - "product": [ - "product7", - "product6" - ], - "product_price_point_id": [ - "product_price_point_id9", - "product_price_point_id0" - ], - "payment_profile": [ - "payment_profile4", - "payment_profile5" - ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token8", - "payment_profile.chargify_token9" - ], - "base": [ - "base7", - "base8", - "base9" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupSubscriptionError; +import java.util.Arrays; + +SubscriptionGroupSubscriptionError subscriptionGroupSubscriptionError = new SubscriptionGroupSubscriptionError.Builder() + .product(Arrays.asList( + "product7", + "product8" + )) + .productPricePointId(Arrays.asList( + "product_price_point_id3", + "product_price_point_id4" + )) + .paymentProfile(Arrays.asList( + "payment_profile8", + "payment_profile9" + )) + .paymentProfileChargifyToken(Arrays.asList( + "payment_profile.chargify_token2", + "payment_profile.chargify_token3" + )) + .base(Arrays.asList( + "base1", + "base2", + "base3" + )) + .build(); ``` diff --git a/doc/models/subscription-group-update-error-response-exception.md b/doc/models/subscription-group-update-error-response-exception.md index a115b1dd..b857a791 100644 --- a/doc/models/subscription-group-update-error-response-exception.md +++ b/doc/models/subscription-group-update-error-response-exception.md @@ -11,16 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`SubscriptionGroupUpdateError`](../../doc/models/subscription-group-update-error.md) | Optional | - | SubscriptionGroupUpdateError getErrors() | setErrors(SubscriptionGroupUpdateError errors) | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members2", - "members1" - ] - } +## Example + +```java +try { + // make the API call +} catch (SubscriptionGroupUpdateErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index ea312270..dc1cc432 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | --- | --- | | `Members` | `List` | Optional | - | List getMembers() | setMembers(List members) | -## Example (as JSON) - -```json -{ - "members": [ - "members4", - "members5", - "members6" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupUpdateError; +import java.util.Arrays; + +SubscriptionGroupUpdateError subscriptionGroupUpdateError = new SubscriptionGroupUpdateError.Builder() + .members(Arrays.asList( + "members6", + "members7" + )) + .build(); ``` diff --git a/doc/models/subscription-group.md b/doc/models/subscription-group.md index 93e431b4..c258bc93 100644 --- a/doc/models/subscription-group.md +++ b/doc/models/subscription-group.md @@ -16,24 +16,29 @@ | `SubscriptionIds` | `List` | Optional | - | List getSubscriptionIds() | setSubscriptionIds(List subscriptionIds) | | `CreatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "customer_id": 36, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "prepaid", - "subscription_ids": [ - 146, - 147, - 148 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CollectionMethod; +import com.maxio.advancedbilling.models.SubscriptionGroup; +import com.maxio.advancedbilling.models.SubscriptionGroupPaymentProfile; +import java.util.Arrays; + +SubscriptionGroup subscriptionGroup = new SubscriptionGroup.Builder() + .uid("uid8") + .customerId(78) + .paymentProfile(new SubscriptionGroupPaymentProfile.Builder() + .id(44) + .firstName("first_name4") + .lastName("last_name2") + .maskedCardNumber("masked_card_number2") + .build()) + .paymentCollectionMethod(CollectionMethod.AUTOMATIC) + .subscriptionIds(Arrays.asList( + 188, + 189, + 190 + )) + .build(); ``` diff --git a/doc/models/subscription-groups-list-include.md b/doc/models/subscription-groups-list-include.md index 27d18a04..ddfd5262 100644 --- a/doc/models/subscription-groups-list-include.md +++ b/doc/models/subscription-groups-list-include.md @@ -11,3 +11,11 @@ | --- | | `ACCOUNT_BALANCES` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionGroupsListInclude; + +SubscriptionGroupsListInclude subscriptionGroupsListInclude = SubscriptionGroupsListInclude.ACCOUNT_BALANCES; +``` + diff --git a/doc/models/subscription-include.md b/doc/models/subscription-include.md index 639f7da2..cbcd3874 100644 --- a/doc/models/subscription-include.md +++ b/doc/models/subscription-include.md @@ -12,3 +12,11 @@ | `COUPONS` | | `SELF_SERVICE_PAGE_TOKEN` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionInclude; + +SubscriptionInclude subscriptionInclude = SubscriptionInclude.COUPONS; +``` + diff --git a/doc/models/subscription-included-coupon.md b/doc/models/subscription-included-coupon.md index adb911e8..afa5fad6 100644 --- a/doc/models/subscription-included-coupon.md +++ b/doc/models/subscription-included-coupon.md @@ -17,17 +17,19 @@ | `AmountInCents` | `Long` | Optional | **Constraints**: `>= 0` | Long getAmountInCents() | setAmountInCents(Long amountInCents) | | `Percentage` | `String` | Optional | - | String getPercentage() | setPercentage(String percentage) | -## Example (as JSON) - -```json -{ - "code": "\"ABCD_10\"", - "use_count": 2, - "uses_allowed": 10, - "expires_at": "\"2023-07-13T05:18:58-04:00\"", - "amount_in_cents": 1000, - "percentage": "\"15.0\"", - "recurring": false -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionIncludedCoupon; + +SubscriptionIncludedCoupon subscriptionIncludedCoupon = new SubscriptionIncludedCoupon.Builder() + .code("\"ABCD_10\"") + .useCount(2) + .usesAllowed(10) + .expiresAt("\"2023-07-13T05:18:58-04:00\"") + .recurring(false) + .amountInCents(1000L) + .percentage("\"15.0\"") + .build(); ``` diff --git a/doc/models/subscription-list-date-field.md b/doc/models/subscription-list-date-field.md index dc18409d..12ce3821 100644 --- a/doc/models/subscription-list-date-field.md +++ b/doc/models/subscription-list-date-field.md @@ -13,7 +13,9 @@ ## Example -``` -updated_at +```java +import com.maxio.advancedbilling.models.SubscriptionListDateField; + +SubscriptionListDateField subscriptionListDateField = SubscriptionListDateField.UPDATED_AT; ``` diff --git a/doc/models/subscription-list-include.md b/doc/models/subscription-list-include.md index 27fb9c1d..137be160 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -10,4 +10,15 @@ | Name | | --- | | `SELF_SERVICE_PAGE_TOKEN` | +| `CURRENT_ACCOUNT_BALANCE_IN_CENTS` | +| `CURRENT_BILLING_AMOUNT` | +| `COUPONS` | + +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionListInclude; + +SubscriptionListInclude subscriptionListInclude = SubscriptionListInclude.SELF_SERVICE_PAGE_TOKEN; +``` diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index 49ca32d6..599f41bf 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -20,16 +20,18 @@ | `Proration` | [`Proration`](../../doc/models/proration.md) | Optional | - | Proration getProration() | setProration(Proration proration) | | `ProrationDate` | `ZonedDateTime` | Optional | The date that the proration is calculated from for the preview | ZonedDateTime getProrationDate() | setProrationDate(ZonedDateTime prorationDate) | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 242, - "product_price_point_id": 166 -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionMigrationPreviewOptions; + +SubscriptionMigrationPreviewOptions subscriptionMigrationPreviewOptions = new SubscriptionMigrationPreviewOptions.Builder() + .productId(70) + .productPricePointId(250) + .includeTrial(false) + .includeInitialCharge(false) + .includeCoupons(true) + .preservePeriod(false) + .build(); ``` diff --git a/doc/models/subscription-migration-preview-request.md b/doc/models/subscription-migration-preview-request.md index 195d9af6..05e6655e 100644 --- a/doc/models/subscription-migration-preview-request.md +++ b/doc/models/subscription-migration-preview-request.md @@ -11,18 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Migration` | [`SubscriptionMigrationPreviewOptions`](../../doc/models/subscription-migration-preview-options.md) | Required | - | SubscriptionMigrationPreviewOptions getMigration() | setMigration(SubscriptionMigrationPreviewOptions migration) | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionMigrationPreviewOptions; +import com.maxio.advancedbilling.models.SubscriptionMigrationPreviewRequest; + +SubscriptionMigrationPreviewRequest subscriptionMigrationPreviewRequest = new SubscriptionMigrationPreviewRequest.Builder( + new SubscriptionMigrationPreviewOptions.Builder() + .productId(158) + .productPricePointId(82) + .includeTrial(false) + .includeInitialCharge(false) + .includeCoupons(true) + .preservePeriod(false) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-migration-preview-response.md b/doc/models/subscription-migration-preview-response.md index c8b3443f..6593097a 100644 --- a/doc/models/subscription-migration-preview-response.md +++ b/doc/models/subscription-migration-preview-response.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `Migration` | [`SubscriptionMigrationPreview`](../../doc/models/subscription-migration-preview.md) | Required | - | SubscriptionMigrationPreview getMigration() | setMigration(SubscriptionMigrationPreview migration) | -## Example (as JSON) - -```json -{ - "migration": { - "prorated_adjustment_in_cents": 196, - "charge_in_cents": 78, - "payment_due_in_cents": 250, - "credit_applied_in_cents": 210 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionMigrationPreview; +import com.maxio.advancedbilling.models.SubscriptionMigrationPreviewResponse; + +SubscriptionMigrationPreviewResponse subscriptionMigrationPreviewResponse = new SubscriptionMigrationPreviewResponse.Builder( + new SubscriptionMigrationPreview.Builder() + .proratedAdjustmentInCents(196L) + .chargeInCents(78L) + .paymentDueInCents(250L) + .creditAppliedInCents(210L) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-migration-preview.md b/doc/models/subscription-migration-preview.md index c64fd1f7..4ab3b91b 100644 --- a/doc/models/subscription-migration-preview.md +++ b/doc/models/subscription-migration-preview.md @@ -14,14 +14,16 @@ | `PaymentDueInCents` | `Long` | Optional | The amount of the payment due in the case of an upgrade. | Long getPaymentDueInCents() | setPaymentDueInCents(Long paymentDueInCents) | | `CreditAppliedInCents` | `Long` | Optional | Represents a credit in cents that is applied to your subscription as part of a migration process for a specific product, which reduces the amount owed for the subscription. | Long getCreditAppliedInCents() | setCreditAppliedInCents(Long creditAppliedInCents) | -## Example (as JSON) - -```json -{ - "prorated_adjustment_in_cents": 134, - "charge_in_cents": 16, - "payment_due_in_cents": 188, - "credit_applied_in_cents": 148 -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionMigrationPreview; + +SubscriptionMigrationPreview subscriptionMigrationPreview = new SubscriptionMigrationPreview.Builder() + .proratedAdjustmentInCents(6L) + .chargeInCents(144L) + .paymentDueInCents(60L) + .creditAppliedInCents(20L) + .build(); ``` diff --git a/doc/models/subscription-mrr-breakout.md b/doc/models/subscription-mrr-breakout.md index 062eba48..830b41f8 100644 --- a/doc/models/subscription-mrr-breakout.md +++ b/doc/models/subscription-mrr-breakout.md @@ -12,12 +12,15 @@ | `PlanAmountInCents` | `long` | Required | - | long getPlanAmountInCents() | setPlanAmountInCents(long planAmountInCents) | | `UsageAmountInCents` | `long` | Required | - | long getUsageAmountInCents() | setUsageAmountInCents(long usageAmountInCents) | -## Example (as JSON) +## Example -```json -{ - "plan_amount_in_cents": 208, - "usage_amount_in_cents": 60 -} +```java +import com.maxio.advancedbilling.models.SubscriptionMRRBreakout; + +SubscriptionMRRBreakout subscriptionMRRBreakout = new SubscriptionMRRBreakout.Builder( + 248L, + 100L +) +.build(); ``` diff --git a/doc/models/subscription-mrr-response.md b/doc/models/subscription-mrr-response.md index 59e6137b..a02ccacf 100644 --- a/doc/models/subscription-mrr-response.md +++ b/doc/models/subscription-mrr-response.md @@ -11,20 +11,28 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionsMrr` | [`List`](../../doc/models/subscription-mrr.md) | Required | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | List getSubscriptionsMrr() | setSubscriptionsMrr(List subscriptionsMrr) | -## Example (as JSON) - -```json -{ - "subscriptions_mrr": [ - { - "subscription_id": 0, - "mrr_amount_in_cents": 0, - "breakouts": { - "plan_amount_in_cents": 0, - "usage_amount_in_cents": 0 - } - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionMRR; +import com.maxio.advancedbilling.models.SubscriptionMRRBreakout; +import com.maxio.advancedbilling.models.SubscriptionMRRResponse; +import java.util.Arrays; + +SubscriptionMRRResponse subscriptionMRRResponse = new SubscriptionMRRResponse.Builder( + Arrays.asList( + new SubscriptionMRR.Builder( + 0, + 0L + ) + .breakouts(new SubscriptionMRRBreakout.Builder( + 0L, + 0L + ) + .build()) + .build() + ) +) +.build(); ``` diff --git a/doc/models/subscription-mrr.md b/doc/models/subscription-mrr.md index 70c8b571..38eb4113 100644 --- a/doc/models/subscription-mrr.md +++ b/doc/models/subscription-mrr.md @@ -13,16 +13,21 @@ | `MrrAmountInCents` | `long` | Required | - | long getMrrAmountInCents() | setMrrAmountInCents(long mrrAmountInCents) | | `Breakouts` | [`SubscriptionMRRBreakout`](../../doc/models/subscription-mrr-breakout.md) | Optional | - | SubscriptionMRRBreakout getBreakouts() | setBreakouts(SubscriptionMRRBreakout breakouts) | -## Example (as JSON) - -```json -{ - "subscription_id": 4, - "mrr_amount_in_cents": 22, - "breakouts": { - "plan_amount_in_cents": 254, - "usage_amount_in_cents": 106 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionMRR; +import com.maxio.advancedbilling.models.SubscriptionMRRBreakout; + +SubscriptionMRR subscriptionMRR = new SubscriptionMRR.Builder( + 192, + 210L +) +.breakouts(new SubscriptionMRRBreakout.Builder( + 254L, + 106L + ) + .build()) +.build(); ``` diff --git a/doc/models/subscription-note-response.md b/doc/models/subscription-note-response.md index dc7eea80..8f0446ea 100644 --- a/doc/models/subscription-note-response.md +++ b/doc/models/subscription-note-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Note` | [`SubscriptionNote`](../../doc/models/subscription-note.md) | Required | - | SubscriptionNote getNote() | setNote(SubscriptionNote note) | -## Example (as JSON) - -```json -{ - "note": { - "id": 28, - "body": "body0", - "subscription_id": 138, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.SubscriptionNote; +import com.maxio.advancedbilling.models.SubscriptionNoteResponse; + +SubscriptionNoteResponse subscriptionNoteResponse = new SubscriptionNoteResponse.Builder( + new SubscriptionNote.Builder() + .id(28) + .body("body0") + .subscriptionId(138) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .updatedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-note.md b/doc/models/subscription-note.md index 6a5268ab..65dd5e3d 100644 --- a/doc/models/subscription-note.md +++ b/doc/models/subscription-note.md @@ -16,15 +16,18 @@ | `UpdatedAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | | `Sticky` | `Boolean` | Optional | - | Boolean getSticky() | setSticky(Boolean sticky) | -## Example (as JSON) - -```json -{ - "id": 36, - "body": "body4", - "subscription_id": 146, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.SubscriptionNote; + +SubscriptionNote subscriptionNote = new SubscriptionNote.Builder() + .id(18) + .body("body6") + .subscriptionId(128) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .updatedAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/doc/models/subscription-preview-response.md b/doc/models/subscription-preview-response.md index 51b6101d..0518a34d 100644 --- a/doc/models/subscription-preview-response.md +++ b/doc/models/subscription-preview-response.md @@ -11,56 +11,65 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionPreview` | [`SubscriptionPreview`](../../doc/models/subscription-preview.md) | Required | - | SubscriptionPreview getSubscriptionPreview() | setSubscriptionPreview(SubscriptionPreview subscriptionPreview) | -## Example (as JSON) +## Example -```json -{ - "subscription_preview": { - "current_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } - ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 - }, - "next_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } - ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } - } -} +```java +import com.maxio.advancedbilling.models.BillingManifest; +import com.maxio.advancedbilling.models.BillingManifestItem; +import com.maxio.advancedbilling.models.BillingManifestLineItemKind; +import com.maxio.advancedbilling.models.LineItemTransactionType; +import com.maxio.advancedbilling.models.SubscriptionPreview; +import com.maxio.advancedbilling.models.SubscriptionPreviewResponse; +import java.util.Arrays; + +SubscriptionPreviewResponse subscriptionPreviewResponse = new SubscriptionPreviewResponse.Builder( + new SubscriptionPreview.Builder() + .currentBillingManifest(new BillingManifest.Builder() + .lineItems(Arrays.asList( + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build() + )) + .totalInCents(38L) + .totalDiscountInCents(24L) + .totalTaxInCents(18L) + .subtotalInCents(150L) + .build()) + .nextBillingManifest(new BillingManifest.Builder() + .lineItems(Arrays.asList( + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build(), + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build(), + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build() + )) + .totalInCents(62L) + .totalDiscountInCents(208L) + .totalTaxInCents(42L) + .subtotalInCents(174L) + .build()) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-preview.md b/doc/models/subscription-preview.md index 241cc366..b28e41c2 100644 --- a/doc/models/subscription-preview.md +++ b/doc/models/subscription-preview.md @@ -12,54 +12,61 @@ | `CurrentBillingManifest` | [`BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | BillingManifest getCurrentBillingManifest() | setCurrentBillingManifest(BillingManifest currentBillingManifest) | | `NextBillingManifest` | [`BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | BillingManifest getNextBillingManifest() | setNextBillingManifest(BillingManifest nextBillingManifest) | -## Example (as JSON) +## Example -```json -{ - "current_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } - ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 - }, - "next_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } - ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } -} +```java +import com.maxio.advancedbilling.models.BillingManifest; +import com.maxio.advancedbilling.models.BillingManifestItem; +import com.maxio.advancedbilling.models.BillingManifestLineItemKind; +import com.maxio.advancedbilling.models.LineItemTransactionType; +import com.maxio.advancedbilling.models.SubscriptionPreview; +import java.util.Arrays; + +SubscriptionPreview subscriptionPreview = new SubscriptionPreview.Builder() + .currentBillingManifest(new BillingManifest.Builder() + .lineItems(Arrays.asList( + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build() + )) + .totalInCents(38L) + .totalDiscountInCents(24L) + .totalTaxInCents(18L) + .subtotalInCents(150L) + .build()) + .nextBillingManifest(new BillingManifest.Builder() + .lineItems(Arrays.asList( + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build(), + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build(), + new BillingManifestItem.Builder() + .transactionType(LineItemTransactionType.CREDIT) + .kind(BillingManifestLineItemKind.COMPONENT) + .amountInCents(24L) + .memo("memo2") + .discountAmountInCents(172L) + .build() + )) + .totalInCents(62L) + .totalDiscountInCents(208L) + .totalTaxInCents(42L) + .subtotalInCents(174L) + .build()) + .build(); ``` diff --git a/doc/models/subscription-product-change.md b/doc/models/subscription-product-change.md index 534beaf8..b325b8ed 100644 --- a/doc/models/subscription-product-change.md +++ b/doc/models/subscription-product-change.md @@ -1,6 +1,8 @@ # Subscription Product Change +Event data for both `subscription_product_change` and `subscription_product_change_scheduled`. The price point and `effective_at` fields are only populated for scheduled changes. + ## Structure `SubscriptionProductChange` @@ -11,13 +13,23 @@ | --- | --- | --- | --- | --- | --- | | `PreviousProductId` | `int` | Required | - | int getPreviousProductId() | setPreviousProductId(int previousProductId) | | `NewProductId` | `int` | Required | - | int getNewProductId() | setNewProductId(int newProductId) | - -## Example (as JSON) - -```json -{ - "previous_product_id": 126, - "new_product_id": 12 -} +| `PreviousProductPricePointId` | `Integer` | Optional | - | Integer getPreviousProductPricePointId() | setPreviousProductPricePointId(Integer previousProductPricePointId) | +| `NewProductPricePointId` | `Integer` | Optional | - | Integer getNewProductPricePointId() | setNewProductPricePointId(Integer newProductPricePointId) | +| `EffectiveAt` | `ZonedDateTime` | Optional | When the scheduled product change takes effect (the subscription's next renewal). Only sent for `subscription_product_change_scheduled`. | ZonedDateTime getEffectiveAt() | setEffectiveAt(ZonedDateTime effectiveAt) | + +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.SubscriptionProductChange; + +SubscriptionProductChange subscriptionProductChange = new SubscriptionProductChange.Builder( + 104, + 10 +) +.previousProductPricePointId(228) +.newProductPricePointId(222) +.effectiveAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) +.build(); ``` diff --git a/doc/models/subscription-product-migration-request.md b/doc/models/subscription-product-migration-request.md index 7018c558..807d3ea0 100644 --- a/doc/models/subscription-product-migration-request.md +++ b/doc/models/subscription-product-migration-request.md @@ -11,18 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `Migration` | [`SubscriptionProductMigration`](../../doc/models/subscription-product-migration.md) | Required | - | SubscriptionProductMigration getMigration() | setMigration(SubscriptionProductMigration migration) | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionProductMigration; +import com.maxio.advancedbilling.models.SubscriptionProductMigrationRequest; + +SubscriptionProductMigrationRequest subscriptionProductMigrationRequest = new SubscriptionProductMigrationRequest.Builder( + new SubscriptionProductMigration.Builder() + .productId(158) + .productPricePointId(82) + .includeTrial(false) + .includeInitialCharge(false) + .includeCoupons(true) + .preservePeriod(false) + .build() +) +.build(); ``` diff --git a/doc/models/subscription-product-migration.md b/doc/models/subscription-product-migration.md index ef926c39..29cf47dd 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -19,16 +19,18 @@ | `ProductPricePointHandle` | `String` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | String getProductPricePointHandle() | setProductPricePointHandle(String productPricePointHandle) | | `Proration` | [`Proration`](../../doc/models/proration.md) | Optional | - | Proration getProration() | setProration(Proration proration) | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 8, - "product_price_point_id": 172 -} +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionProductMigration; + +SubscriptionProductMigration subscriptionProductMigration = new SubscriptionProductMigration.Builder() + .productId(44) + .productPricePointId(224) + .includeTrial(false) + .includeInitialCharge(false) + .includeCoupons(true) + .preservePeriod(false) + .build(); ``` diff --git a/doc/models/subscription-purge-type.md b/doc/models/subscription-purge-type.md index cd25299c..f98d1303 100644 --- a/doc/models/subscription-purge-type.md +++ b/doc/models/subscription-purge-type.md @@ -12,3 +12,11 @@ | `CUSTOMER` | | `PAYMENT_PROFILE` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionPurgeType; + +SubscriptionPurgeType subscriptionPurgeType = SubscriptionPurgeType.CUSTOMER; +``` + diff --git a/doc/models/subscription-remove-coupon-errors-exception.md b/doc/models/subscription-remove-coupon-errors-exception.md index d4317870..f5d0dbbd 100644 --- a/doc/models/subscription-remove-coupon-errors-exception.md +++ b/doc/models/subscription-remove-coupon-errors-exception.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | `List` | Required | - | List getSubscription() | setSubscription(List subscription) | -## Example (as JSON) - -```json -{ - "subscription": [ - "subscription0" - ] +## Example + +```java +try { + // make the API call +} catch (SubscriptionRemoveCouponErrorsException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/subscription-response-error-exception.md b/doc/models/subscription-response-error-exception.md index 1501e048..34d5c447 100644 --- a/doc/models/subscription-response-error-exception.md +++ b/doc/models/subscription-response-error-exception.md @@ -11,17 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | - | Subscription getSubscription() | setSubscription(Subscription subscription) | -## Example (as JSON) - -```json -{ - "subscription": { - "id": 8, - "state": "paused", - "balance_in_cents": 124, - "total_revenue_in_cents": 48, - "product_price_in_cents": 238 - } +## Example + +```java +try { + // make the API call +} catch (SubscriptionResponseErrorException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/subscription-response.md b/doc/models/subscription-response.md index 10649ae8..ad712bc1 100644 --- a/doc/models/subscription-response.md +++ b/doc/models/subscription-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | - | Subscription getSubscription() | setSubscription(Subscription subscription) | -## Example (as JSON) - -```json -{ - "subscription": { - "id": 8, - "state": "paused", - "balance_in_cents": 124, - "total_revenue_in_cents": 48, - "product_price_in_cents": 238 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.Subscription; +import com.maxio.advancedbilling.models.SubscriptionResponse; +import com.maxio.advancedbilling.models.SubscriptionState; + +SubscriptionResponse subscriptionResponse = new SubscriptionResponse.Builder() + .subscription(new Subscription.Builder() + .id(8) + .state(SubscriptionState.PAUSED) + .balanceInCents(124L) + .totalRevenueInCents(48L) + .productPriceInCents(238L) + .build()) + .build(); ``` diff --git a/doc/models/subscription-sort.md b/doc/models/subscription-sort.md index b07e8ee0..337e181d 100644 --- a/doc/models/subscription-sort.md +++ b/doc/models/subscription-sort.md @@ -20,3 +20,11 @@ | `OPEN_BALANCE` | | `EXPIRES_AT` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionSort; + +SubscriptionSort subscriptionSort = SubscriptionSort.TOTAL_PAYMENTS; +``` + diff --git a/doc/models/subscription-state-change.md b/doc/models/subscription-state-change.md index 8d0c8cbe..86859668 100644 --- a/doc/models/subscription-state-change.md +++ b/doc/models/subscription-state-change.md @@ -12,12 +12,15 @@ | `PreviousSubscriptionState` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getPreviousSubscriptionState() | setPreviousSubscriptionState(String previousSubscriptionState) | | `NewSubscriptionState` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getNewSubscriptionState() | setNewSubscriptionState(String newSubscriptionState) | -## Example (as JSON) +## Example -```json -{ - "previous_subscription_state": "previous_subscription_state2", - "new_subscription_state": "new_subscription_state6" -} +```java +import com.maxio.advancedbilling.models.SubscriptionStateChange; + +SubscriptionStateChange subscriptionStateChange = new SubscriptionStateChange.Builder( + "previous_subscription_state8", + "new_subscription_state2" +) +.build(); ``` diff --git a/doc/models/subscription-state-filter.md b/doc/models/subscription-state-filter.md index 148d4118..9f22541c 100644 --- a/doc/models/subscription-state-filter.md +++ b/doc/models/subscription-state-filter.md @@ -15,12 +15,25 @@ Allowed values for filtering by the current state of the subscription. | `CANCELED` | | `EXPIRED` | | `EXPIRED_CARDS` | +| `ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS` | +| `ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS` | | `ON_HOLD` | +| `AWAITING_SIGNUP` | +| `AWAITING_SIGNUP_DATE` | | `PAST_DUE` | | `PENDING_CANCELLATION` | | `PENDING_RENEWAL` | +| `PREPAID_DUNNING` | | `SUSPENDED` | | `TRIAL_ENDED` | | `TRIALING` | | `UNPAID` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionStateFilter; + +SubscriptionStateFilter subscriptionStateFilter = SubscriptionStateFilter.AWAITING_SIGNUP; +``` + diff --git a/doc/models/subscription-state.md b/doc/models/subscription-state.md index 6e893623..9e0197a4 100644 --- a/doc/models/subscription-state.md +++ b/doc/models/subscription-state.md @@ -48,3 +48,11 @@ See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/2425211902 | `ON_HOLD` | | `AWAITING_SIGNUP` | +## Example + +```java +import com.maxio.advancedbilling.models.SubscriptionState; + +SubscriptionState subscriptionState = SubscriptionState.AWAITING_SIGNUP; +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md index cd34c6fc..68e6c080 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -13,13 +13,13 @@ | `State` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | SubscriptionState getState() | setState(SubscriptionState state) | | `BalanceInCents` | `Long` | Optional | Gives the current outstanding subscription balance in the number of cents. | Long getBalanceInCents() | setBalanceInCents(Long balanceInCents) | | `TotalRevenueInCents` | `Long` | Optional | Gives the total revenue from the subscription in the number of cents. | Long getTotalRevenueInCents() | setTotalRevenueInCents(Long totalRevenueInCents) | -| `ProductPriceInCents` | `Long` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. NOTE: this may differ from the current price of,the product, if you’ve changed the price of the product but haven’t,moved this subscription to a newer version. | Long getProductPriceInCents() | setProductPriceInCents(Long productPriceInCents) | +| `ProductPriceInCents` | `Long` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version), currently subscribed. NOTE: this may differ from the current price of the product, if you’ve changed the price of the product but haven’t moved this subscription to a newer version. | Long getProductPriceInCents() | setProductPriceInCents(Long productPriceInCents) | | `ProductVersionNumber` | `Integer` | Optional | The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. | Integer getProductVersionNumber() | setProductVersionNumber(Integer productVersionNumber) | -| `CurrentPeriodEndsAt` | `ZonedDateTime` | Optional | Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) | ZonedDateTime getCurrentPeriodEndsAt() | setCurrentPeriodEndsAt(ZonedDateTime currentPeriodEndsAt) | -| `NextAssessmentAt` | `ZonedDateTime` | Optional | Timestamp that indicates when capture of payment will be tried or,retried. This value will usually track the current_period_ends_at, but,will diverge if a renewal payment fails and must be retried. In that,case, the current_period_ends_at will advance to the end of the next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) | ZonedDateTime getNextAssessmentAt() | setNextAssessmentAt(ZonedDateTime nextAssessmentAt) | +| `CurrentPeriodEndsAt` | `ZonedDateTime` | Optional | Timestamp relating to the end of the current (recurring) period (i.e., when the next regularly scheduled attempted charge will occur) | ZonedDateTime getCurrentPeriodEndsAt() | setCurrentPeriodEndsAt(ZonedDateTime currentPeriodEndsAt) | +| `NextAssessmentAt` | `ZonedDateTime` | Optional | Timestamp that indicates when capture of payment will be tried or retried. This value will usually track the current_period_ends_at, but will diverge if a renewal payment fails and must be retried. In that case, the current_period_ends_at will advance to the end of the next period (time doesn’t stop because a payment was missed) but the next_assessment_at will be scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). | ZonedDateTime getNextAssessmentAt() | setNextAssessmentAt(ZonedDateTime nextAssessmentAt) | | `TrialStartedAt` | `ZonedDateTime` | Optional | Timestamp for when the trial period (if any) began | ZonedDateTime getTrialStartedAt() | setTrialStartedAt(ZonedDateTime trialStartedAt) | | `TrialEndedAt` | `ZonedDateTime` | Optional | Timestamp for when the trial period (if any) ended | ZonedDateTime getTrialEndedAt() | setTrialEndedAt(ZonedDateTime trialEndedAt) | -| `ActivatedAt` | `ZonedDateTime` | Optional | Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial) | ZonedDateTime getActivatedAt() | setActivatedAt(ZonedDateTime activatedAt) | +| `ActivatedAt` | `ZonedDateTime` | Optional | Timestamp for when the subscription began (i.e., when it came out of trial, or when it began in the case of no trial) | ZonedDateTime getActivatedAt() | setActivatedAt(ZonedDateTime activatedAt) | | `ExpiresAt` | `ZonedDateTime` | Optional | Timestamp giving the expiration date of this subscription (if any) | ZonedDateTime getExpiresAt() | setExpiresAt(ZonedDateTime expiresAt) | | `CreatedAt` | `ZonedDateTime` | Optional | The creation date for this subscription | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `UpdatedAt` | `ZonedDateTime` | Optional | The date of last update for this subscription | ZonedDateTime getUpdatedAt() | setUpdatedAt(ZonedDateTime updatedAt) | @@ -28,9 +28,9 @@ | `CancelAtEndOfPeriod` | `Boolean` | Optional | Whether or not the subscription will (or has) canceled at the end of the period. | Boolean getCancelAtEndOfPeriod() | setCancelAtEndOfPeriod(Boolean cancelAtEndOfPeriod) | | `CanceledAt` | `ZonedDateTime` | Optional | The timestamp of the most recent cancellation | ZonedDateTime getCanceledAt() | setCanceledAt(ZonedDateTime canceledAt) | | `CurrentPeriodStartedAt` | `ZonedDateTime` | Optional | Timestamp relating to the start of the current (recurring) period | ZonedDateTime getCurrentPeriodStartedAt() | setCurrentPeriodStartedAt(ZonedDateTime currentPeriodStartedAt) | -| `PreviousState` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state) | SubscriptionState getPreviousState() | setPreviousState(SubscriptionState previousState) | +| `PreviousState` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state). | SubscriptionState getPreviousState() | setPreviousState(SubscriptionState previousState) | | `SignupPaymentId` | `Integer` | Optional | The ID of the transaction that generated the revenue | Integer getSignupPaymentId() | setSignupPaymentId(Integer signupPaymentId) | -| `SignupRevenue` | `String` | Optional | The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) | String getSignupRevenue() | setSignupRevenue(String signupRevenue) | +| `SignupRevenue` | `String` | Optional | The revenue, formatted as a string of decimal separated dollars and cents, from the subscription signup ($50.00 would be formatted as 50.00) | String getSignupRevenue() | setSignupRevenue(String signupRevenue) | | `DelayedCancelAt` | `ZonedDateTime` | Optional | Timestamp for when the subscription is currently set to cancel. | ZonedDateTime getDelayedCancelAt() | setDelayedCancelAt(ZonedDateTime delayedCancelAt) | | `CouponCode` | `String` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | String getCouponCode() | setCouponCode(String couponCode) | | `SnapDay` | `String` | Optional | A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. | String getSnapDay() | setSnapDay(String snapDay) | @@ -46,7 +46,7 @@ | `NextProductHandle` | `String` | Optional | If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. | String getNextProductHandle() | setNextProductHandle(String nextProductHandle) | | `CouponUseCount` | `Integer` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | Integer getCouponUseCount() | setCouponUseCount(Integer couponUseCount) | | `CouponUsesAllowed` | `Integer` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | Integer getCouponUsesAllowed() | setCouponUsesAllowed(Integer couponUsesAllowed) | -| `ReasonCode` | `String` | Optional | The churn reason code associated to a cancelled subscription. | String getReasonCode() | setReasonCode(String reasonCode) | +| `ReasonCode` | `String` | Optional | The churn reason code associated to a canceled subscription. | String getReasonCode() | setReasonCode(String reasonCode) | | `AutomaticallyResumeAt` | `ZonedDateTime` | Optional | The date the subscription is scheduled to automatically resume from the on_hold state. | ZonedDateTime getAutomaticallyResumeAt() | setAutomaticallyResumeAt(ZonedDateTime automaticallyResumeAt) | | `CouponCodes` | `List` | Optional | An array for all the coupons attached to the subscription. | List getCouponCodes() | setCouponCodes(List couponCodes) | | `OfferId` | `Integer` | Optional | The ID of the offer associated with the subscription. | Integer getOfferId() | setOfferId(Integer offerId) | @@ -57,10 +57,10 @@ | `NextProductPricePointId` | `Integer` | Optional | If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal. | Integer getNextProductPricePointId() | setNextProductPricePointId(Integer nextProductPricePointId) | | `NetTerms` | `Integer` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | Integer getNetTerms() | setNetTerms(Integer netTerms) | | `StoredCredentialTransactionId` | `Integer` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | Integer getStoredCredentialTransactionId() | setStoredCredentialTransactionId(Integer storedCredentialTransactionId) | -| `Reference` | `String` | Optional | The reference value (provided by your app) for the subscription istelf. | String getReference() | setReference(String reference) | +| `Reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | String getReference() | setReference(String reference) | | `OnHoldAt` | `ZonedDateTime` | Optional | The timestamp of the most recent on hold action. | ZonedDateTime getOnHoldAt() | setOnHoldAt(ZonedDateTime onHoldAt) | -| `PrepaidDunning` | `Boolean` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | Boolean getPrepaidDunning() | setPrepaidDunning(Boolean prepaidDunning) | -| `Coupons` | [`List`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`.
Only in Read Subscription Endpoint. | List getCoupons() | setCoupons(List coupons) | +| `PrepaidDunning` | `Boolean` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled. | Boolean getPrepaidDunning() | setPrepaidDunning(Boolean prepaidDunning) | +| `Coupons` | [`List`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request: `include[]=coupons`.
Only in Read Subscription Endpoint. | List getCoupons() | setCoupons(List coupons) | | `DunningCommunicationDelayEnabled` | `Boolean` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. | Boolean getDunningCommunicationDelayEnabled() | setDunningCommunicationDelayEnabled(Boolean dunningCommunicationDelayEnabled) | | `DunningCommunicationDelayTimeZone` | `String` | Optional | Time zone for the Dunning Communication Delay feature. | String getDunningCommunicationDelayTimeZone() | setDunningCommunicationDelayTimeZone(String dunningCommunicationDelayTimeZone) | | `ReceivesInvoiceEmails` | `Boolean` | Optional | - | Boolean getReceivesInvoiceEmails() | setReceivesInvoiceEmails(Boolean receivesInvoiceEmails) | @@ -72,38 +72,46 @@ | `PrepaidConfiguration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Optional | - | PrepaidConfiguration getPrepaidConfiguration() | setPrepaidConfiguration(PrepaidConfiguration prepaidConfiguration) | | `SelfServicePageToken` | `String` | Optional | Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. | String getSelfServicePageToken() | setSelfServicePageToken(String selfServicePageToken) | -## Example (as JSON) +## Example -```json -{ - "credit_card": { - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null - }, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "id": 96, - "state": "soft_failure", - "balance_in_cents": 212, - "total_revenue_in_cents": 136, - "product_price_in_cents": 70 -} +```java +import com.maxio.advancedbilling.models.CardType; +import com.maxio.advancedbilling.models.CreditCardPaymentProfile; +import com.maxio.advancedbilling.models.CreditCardVault; +import com.maxio.advancedbilling.models.PaymentType; +import com.maxio.advancedbilling.models.Subscription; +import com.maxio.advancedbilling.models.SubscriptionState; + +Subscription subscription = new Subscription.Builder() + .id(8) + .state(SubscriptionState.PAUSED) + .balanceInCents(124L) + .totalRevenueInCents(48L) + .productPriceInCents(238L) + .creditCard(new CreditCardPaymentProfile.Builder( + PaymentType.CREDIT_CARD + ) + .id(10088716) + .firstName("Test") + .lastName("Subscription") + .maskedCardNumber("XXXX-XXXX-XXXX-1") + .cardType(CardType.BOGUS) + .expirationMonth(1) + .expirationYear(2022) + .customerId(14543792) + .currentVault(CreditCardVault.BOGUS) + .vaultToken("1") + .billingAddress("123 Montana Way") + .billingCity("Billings") + .billingState("MT") + .billingZip("59101") + .billingCountry("US") + .customerVaultToken("customer_vault_token2") + .billingAddress2("") + .siteGatewaySettingId(1) + .gatewayHandle("gateway_handle8") + .build()) + .dunningCommunicationDelayTimeZone("\"Eastern Time (US & Canada)\"") + .build(); ``` diff --git a/doc/models/subscriptions-mrr-error-response-exception.md b/doc/models/subscriptions-mrr-error-response-exception.md index bd851a9c..e445d9e9 100644 --- a/doc/models/subscriptions-mrr-error-response-exception.md +++ b/doc/models/subscriptions-mrr-error-response-exception.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`AttributeError`](../../doc/models/attribute-error.md) | Required | - | AttributeError getErrors() | setErrors(AttributeError errors) | -## Example (as JSON) - -```json -{ - "errors": { - "attribute": [ - "supplied value is invalid, expected ISO 8601 format" - ] - } +## Example + +```java +try { + // make the API call +} catch (SubscriptionsMrrErrorResponseException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/tax-configuration-kind.md b/doc/models/tax-configuration-kind.md index ef95cf08..9894600a 100644 --- a/doc/models/tax-configuration-kind.md +++ b/doc/models/tax-configuration-kind.md @@ -14,3 +14,11 @@ | `ENUM_LINKED_AVALARA` | | `ENUM_DIGITAL_RIVER` | +## Example + +```java +import com.maxio.advancedbilling.models.TaxConfigurationKind; + +TaxConfigurationKind taxConfigurationKind = TaxConfigurationKind.CUSTOM; +``` + diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index 0d05ee96..667ed622 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -13,13 +13,17 @@ | `DestinationAddress` | [`TaxDestinationAddress`](../../doc/models/tax-destination-address.md) | Optional | - | TaxDestinationAddress getDestinationAddress() | setDestinationAddress(TaxDestinationAddress destinationAddress) | | `FullyConfigured` | `Boolean` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview

**Default**: `false` | Boolean getFullyConfigured() | setFullyConfigured(Boolean fullyConfigured) | -## Example (as JSON) - -```json -{ - "kind": "custom", - "fully_configured": false, - "destination_address": "shipping_only" -} +## Example + +```java +import com.maxio.advancedbilling.models.TaxConfiguration; +import com.maxio.advancedbilling.models.TaxConfigurationKind; +import com.maxio.advancedbilling.models.TaxDestinationAddress; + +TaxConfiguration taxConfiguration = new TaxConfiguration.Builder() + .kind(TaxConfigurationKind.CUSTOM) + .destinationAddress(TaxDestinationAddress.SHIPPING_ONLY) + .fullyConfigured(false) + .build(); ``` diff --git a/doc/models/tax-destination-address.md b/doc/models/tax-destination-address.md index f2a5b2ac..e84bdec1 100644 --- a/doc/models/tax-destination-address.md +++ b/doc/models/tax-destination-address.md @@ -14,3 +14,11 @@ | `SHIPPING_ONLY` | | `BILLING_ONLY` | +## Example + +```java +import com.maxio.advancedbilling.models.TaxDestinationAddress; + +TaxDestinationAddress taxDestinationAddress = TaxDestinationAddress.SHIPPING_ONLY; +``` + diff --git a/doc/models/tokenized-payment-profile.md b/doc/models/tokenized-payment-profile.md index a7732130..5025ddee 100644 --- a/doc/models/tokenized-payment-profile.md +++ b/doc/models/tokenized-payment-profile.md @@ -14,14 +14,17 @@ | `GatewayHandle` | `String` | Optional | - | String getGatewayHandle() | setGatewayHandle(String gatewayHandle) | | `CustomerVaultToken` | `String` | Optional | - | String getCustomerVaultToken() | setCustomerVaultToken(String customerVaultToken) | -## Example (as JSON) - -```json -{ - "id": 72, - "vault_token": "vault_token2", - "gateway_handle": "gateway_handle8", - "customer_vault_token": "customer_vault_token8" -} +## Example + +```java +import com.maxio.advancedbilling.models.TokenizedPaymentProfile; + +TokenizedPaymentProfile tokenizedPaymentProfile = new TokenizedPaymentProfile.Builder( + 116 +) +.vaultToken("vault_token0") +.gatewayHandle("gateway_handle0") +.customerVaultToken("customer_vault_token6") +.build(); ``` diff --git a/doc/models/too-many-management-link-requests-error-exception.md b/doc/models/too-many-management-link-requests-error-exception.md index 923d73a5..4419a71c 100644 --- a/doc/models/too-many-management-link-requests-error-exception.md +++ b/doc/models/too-many-management-link-requests-error-exception.md @@ -11,14 +11,15 @@ | --- | --- | --- | --- | --- | --- | | `Errors` | [`TooManyManagementLinkRequests`](../../doc/models/too-many-management-link-requests.md) | Required | - | TooManyManagementLinkRequests getErrors() | setErrors(TooManyManagementLinkRequests errors) | -## Example (as JSON) - -```json -{ - "errors": { - "error": "error4", - "new_link_available_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```java +try { + // make the API call +} catch (TooManyManagementLinkRequestsErrorException e) { + e.printStackTrace(); +} catch (ApiException e) { + e.printStackTrace(); } ``` diff --git a/doc/models/too-many-management-link-requests.md b/doc/models/too-many-management-link-requests.md index 2f2aa5a8..4c168483 100644 --- a/doc/models/too-many-management-link-requests.md +++ b/doc/models/too-many-management-link-requests.md @@ -12,12 +12,16 @@ | `Error` | `String` | Required | - | String getError() | setError(String error) | | `NewLinkAvailableAt` | `ZonedDateTime` | Required | - | ZonedDateTime getNewLinkAvailableAt() | setNewLinkAvailableAt(ZonedDateTime newLinkAvailableAt) | -## Example (as JSON) +## Example -```json -{ - "error": "error2", - "new_link_available_at": "2016-03-13T12:52:32.123Z" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.TooManyManagementLinkRequests; + +TooManyManagementLinkRequests tooManyManagementLinkRequests = new TooManyManagementLinkRequests.Builder( + "error8", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") +) +.build(); ``` diff --git a/doc/models/trial-type.md b/doc/models/trial-type.md index 1298d99b..d94afe5a 100644 --- a/doc/models/trial-type.md +++ b/doc/models/trial-type.md @@ -1,7 +1,7 @@ # Trial Type -Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. +Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. ## Enumeration @@ -14,3 +14,11 @@ Indicates how a trial is handled when the trail period ends and there is no cred | `NO_OBLIGATION` | | `PAYMENT_EXPECTED` | +## Example + +```java +import com.maxio.advancedbilling.models.TrialType; + +TrialType trialType = TrialType.NO_OBLIGATION; +``` + diff --git a/doc/models/update-allocation-expiration-date.md b/doc/models/update-allocation-expiration-date.md index 1a2b4261..a8888cb6 100644 --- a/doc/models/update-allocation-expiration-date.md +++ b/doc/models/update-allocation-expiration-date.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | --- | --- | | `Allocation` | [`AllocationExpirationDate`](../../doc/models/allocation-expiration-date.md) | Optional | - | AllocationExpirationDate getAllocation() | setAllocation(AllocationExpirationDate allocation) | -## Example (as JSON) - -```json -{ - "allocation": { - "expires_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.AllocationExpirationDate; +import com.maxio.advancedbilling.models.UpdateAllocationExpirationDate; + +UpdateAllocationExpirationDate updateAllocationExpirationDate = new UpdateAllocationExpirationDate.Builder() + .allocation(new AllocationExpirationDate.Builder() + .expiresAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build()) + .build(); ``` diff --git a/doc/models/update-component-price-point-request.md b/doc/models/update-component-price-point-request.md index e55b4115..e71a317c 100644 --- a/doc/models/update-component-price-point-request.md +++ b/doc/models/update-component-price-point-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`UpdateComponentPricePoint`](../../doc/models/update-component-price-point.md) | Optional | - | UpdateComponentPricePoint getPricePoint() | setPricePoint(UpdateComponentPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false - } -} +## Example + +```java +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.UpdateComponentPricePoint; +import com.maxio.advancedbilling.models.UpdateComponentPricePointRequest; + +UpdateComponentPricePointRequest updateComponentPricePointRequest = new UpdateComponentPricePointRequest.Builder() + .pricePoint(new UpdateComponentPricePoint.Builder() + .name("name0") + .handle("handle6") + .pricingScheme(PricingScheme.PER_UNIT) + .useSiteExchangeRate(false) + .taxIncluded(false) + .build()) + .build(); ``` diff --git a/doc/models/update-component-price-point.md b/doc/models/update-component-price-point.md index cb8d4f34..bcd4434b 100644 --- a/doc/models/update-component-price-point.md +++ b/doc/models/update-component-price-point.md @@ -14,19 +14,22 @@ | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `UseSiteExchangeRate` | `Boolean` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | | `TaxIncluded` | `Boolean` | Optional | Whether or not the price point includes tax | Boolean getTaxIncluded() | setTaxIncluded(Boolean taxIncluded) | -| `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | +| `Interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled. | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `Prices` | [`List`](../../doc/models/update-price.md) | Optional | - | List getPrices() | setPrices(List prices) | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false -} +```java +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.UpdateComponentPricePoint; + +UpdateComponentPricePoint updateComponentPricePoint = new UpdateComponentPricePoint.Builder() + .name("name4") + .handle("handle0") + .pricingScheme(PricingScheme.STAIRSTEP) + .useSiteExchangeRate(false) + .taxIncluded(false) + .build(); ``` diff --git a/doc/models/update-component-request.md b/doc/models/update-component-request.md index 217e702e..0c4fd068 100644 --- a/doc/models/update-component-request.md +++ b/doc/models/update-component-request.md @@ -11,18 +11,23 @@ | --- | --- | --- | --- | --- | --- | | `Component` | [`UpdateComponent`](../../doc/models/update-component.md) | Required | - | UpdateComponent getComponent() | setComponent(UpdateComponent component) | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "handle": "handle4", - "name": "name8", - "description": "description2", - "accounting_code": "accounting_code4", - "taxable": false - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ItemCategory; +import com.maxio.advancedbilling.models.UpdateComponent; +import com.maxio.advancedbilling.models.UpdateComponentRequest; + +UpdateComponentRequest updateComponentRequest = new UpdateComponentRequest.Builder( + new UpdateComponent.Builder() + .handle("handle4") + .name("name8") + .description("description2") + .accountingCode("accounting_code4") + .taxable(false) + .itemCategory(ItemCategory.ENUM_BUSINESS_SOFTWARE) + .build() +) +.build(); ``` diff --git a/doc/models/update-component.md b/doc/models/update-component.md index a3db17aa..6222e955 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | -| `Name` | `String` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | String getName() | setName(String name) | +| `Name` | `String` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | String getName() | setName(String name) | | `Description` | `String` | Optional | The description of the component. | String getDescription() | setDescription(String description) | | `AccountingCode` | `String` | Optional | - | String getAccountingCode() | setAccountingCode(String accountingCode) | | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | @@ -18,17 +18,21 @@ | `ItemCategory` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | ItemCategory getItemCategory() | setItemCategory(ItemCategory itemCategory) | | `DisplayOnHostedPage` | `Boolean` | Optional | - | Boolean getDisplayOnHostedPage() | setDisplayOnHostedPage(Boolean displayOnHostedPage) | | `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "handle": "handle6", - "name": "name0", - "description": "description0", - "accounting_code": "accounting_code6", - "taxable": false -} +| `UnspscCode` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | String getUnspscCode() | setUnspscCode(String unspscCode) | + +## Example + +```java +import com.maxio.advancedbilling.models.ItemCategory; +import com.maxio.advancedbilling.models.UpdateComponent; + +UpdateComponent updateComponent = new UpdateComponent.Builder() + .handle("handle4") + .name("name8") + .description("description8") + .accountingCode("accounting_code4") + .taxable(false) + .itemCategory(ItemCategory.ENUM_BUSINESS_SOFTWARE) + .build(); ``` diff --git a/doc/models/update-coupon-currency.md b/doc/models/update-coupon-currency.md index 5035c5e5..d6a75aee 100644 --- a/doc/models/update-coupon-currency.md +++ b/doc/models/update-coupon-currency.md @@ -12,12 +12,15 @@ | `Currency` | `String` | Required | ISO code for the site defined currency. | String getCurrency() | setCurrency(String currency) | | `Price` | `int` | Required | Price for the given currency. | int getPrice() | setPrice(int price) | -## Example (as JSON) +## Example -```json -{ - "currency": "currency4", - "price": 146 -} +```java +import com.maxio.advancedbilling.models.UpdateCouponCurrency; + +UpdateCouponCurrency updateCouponCurrency = new UpdateCouponCurrency.Builder( + "currency4", + 100 +) +.build(); ``` diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index 11154dba..6a7151a8 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -12,12 +12,15 @@ | `Id` | `int` | Required | ID of the currency price record being updated | int getId() | setId(int id) | | `Price` | `double` | Required | New price for the given currency | double getPrice() | setPrice(double price) | -## Example (as JSON) +## Example -```json -{ - "id": 146, - "price": 71.86 -} +```java +import com.maxio.advancedbilling.models.UpdateCurrencyPrice; + +UpdateCurrencyPrice updateCurrencyPrice = new UpdateCurrencyPrice.Builder( + 104, + 163.6D +) +.build(); ``` diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index f51702f5..3a637c2b 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -11,16 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `CurrencyPrices` | [`List`](../../doc/models/update-currency-price.md) | Required | - | List getCurrencyPrices() | setCurrencyPrices(List currencyPrices) | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "price": 233.74 - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateCurrencyPrice; +import com.maxio.advancedbilling.models.UpdateCurrencyPricesRequest; +import java.util.Arrays; + +UpdateCurrencyPricesRequest updateCurrencyPricesRequest = new UpdateCurrencyPricesRequest.Builder( + Arrays.asList( + new UpdateCurrencyPrice.Builder( + 50, + 233.74D + ) + .build() + ) +) +.build(); ``` diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 7f17ccc3..e4ce8f05 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Customer` | [`UpdateCustomer`](../../doc/models/update-customer.md) | Required | - | UpdateCustomer getCustomer() | setCustomer(UpdateCustomer customer) | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateCustomer; +import com.maxio.advancedbilling.models.UpdateCustomerRequest; + +UpdateCustomerRequest updateCustomerRequest = new UpdateCustomerRequest.Builder( + new UpdateCustomer.Builder() + .firstName("first_name0") + .lastName("last_name8") + .email("email6") + .ccEmails("cc_emails0") + .organization("organization6") + .build() +) +.build(); ``` diff --git a/doc/models/update-customer.md b/doc/models/update-customer.md index 888cdf26..71a9eeb6 100644 --- a/doc/models/update-customer.md +++ b/doc/models/update-customer.md @@ -25,20 +25,24 @@ | `Locale` | `String` | Optional | Set a specific language on a customer record. | String getLocale() | setLocale(String locale) | | `VatNumber` | `String` | Optional | - | String getVatNumber() | setVatNumber(String vatNumber) | | `TaxExempt` | `Boolean` | Optional | - | Boolean getTaxExempt() | setTaxExempt(Boolean taxExempt) | +| `Surcharging` | `Boolean` | Optional | Whether surcharging is enabled for the customer. Only applied on sites where surcharging control is enabled. | Boolean getSurcharging() | setSurcharging(Boolean surcharging) | | `TaxExemptReason` | `String` | Optional | - | String getTaxExemptReason() | setTaxExemptReason(String taxExemptReason) | | `ParentId` | `Integer` | Optional | - | Integer getParentId() | setParentId(Integer parentId) | -| `Verified` | `Boolean` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway | Boolean getVerified() | setVerified(Boolean verified) | +| `Verified` | `Boolean` | Optional | Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net gateway. | Boolean getVerified() | setVerified(Boolean verified) | | `SalesforceId` | `String` | Optional | The Salesforce ID of the customer | String getSalesforceId() | setSalesforceId(String salesforceId) | +| `BrandingThemeId` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | Integer getBrandingThemeId() | setBrandingThemeId(Integer brandingThemeId) | -## Example (as JSON) +## Example -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails8", - "organization": "organization6" -} +```java +import com.maxio.advancedbilling.models.UpdateCustomer; + +UpdateCustomer updateCustomer = new UpdateCustomer.Builder() + .firstName("first_name2") + .lastName("last_name0") + .email("email4") + .ccEmails("cc_emails8") + .organization("organization6") + .build(); ``` diff --git a/doc/models/update-invoice-item.md b/doc/models/update-invoice-item.md new file mode 100644 index 00000000..03f6884a --- /dev/null +++ b/doc/models/update-invoice-item.md @@ -0,0 +1,48 @@ + +# Update Invoice Item + +A line item change for a draft ad hoc invoice. Supports the same attributes as line items on invoice creation, plus `uid` and `_destroy` for updating or removing existing line items. + +## Structure + +`UpdateInvoiceItem` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Title` | `String` | Optional | - | String getTitle() | setTitle(String title) | +| `Quantity` | [`UpdateInvoiceItemQuantity`](../../doc/models/containers/update-invoice-item-quantity.md) | Optional | This is a container for one-of cases. | UpdateInvoiceItemQuantity getQuantity() | setQuantity(UpdateInvoiceItemQuantity quantity) | +| `UnitPrice` | [`UpdateInvoiceItemUnitPrice`](../../doc/models/containers/update-invoice-item-unit-price.md) | Optional | This is a container for one-of cases. | UpdateInvoiceItemUnitPrice getUnitPrice() | setUnitPrice(UpdateInvoiceItemUnitPrice unitPrice) | +| `Taxable` | `Boolean` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If using AvaTax, a tax_code parameter must also be sent. | Boolean getTaxable() | setTaxable(Boolean taxable) | +| `TaxCode` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | String getTaxCode() | setTaxCode(String taxCode) | +| `PeriodRangeStart` | `String` | Optional | YYYY-MM-DD | String getPeriodRangeStart() | setPeriodRangeStart(String periodRangeStart) | +| `PeriodRangeEnd` | `String` | Optional | YYYY-MM-DD | String getPeriodRangeEnd() | setPeriodRangeEnd(String periodRangeEnd) | +| `ProductId` | [`UpdateInvoiceItemProductId`](../../doc/models/containers/update-invoice-item-product-id.md) | Optional | This is a container for one-of cases. | UpdateInvoiceItemProductId getProductId() | setProductId(UpdateInvoiceItemProductId productId) | +| `ComponentId` | [`UpdateInvoiceItemComponentId`](../../doc/models/containers/update-invoice-item-component-id.md) | Optional | This is a container for one-of cases. | UpdateInvoiceItemComponentId getComponentId() | setComponentId(UpdateInvoiceItemComponentId componentId) | +| `PricePointId` | [`UpdateInvoiceItemPricePointId`](../../doc/models/containers/update-invoice-item-price-point-id.md) | Optional | This is a container for one-of cases. | UpdateInvoiceItemPricePointId getPricePointId() | setPricePointId(UpdateInvoiceItemPricePointId pricePointId) | +| `ProductPricePointId` | [`UpdateInvoiceItemProductPricePointId`](../../doc/models/containers/update-invoice-item-product-price-point-id.md) | Optional | This is a container for one-of cases. | UpdateInvoiceItemProductPricePointId getProductPricePointId() | setProductPricePointId(UpdateInvoiceItemProductPricePointId productPricePointId) | +| `Description` | `String` | Optional | **Constraints**: *Maximum Length*: `255` | String getDescription() | setDescription(String description) | +| `Uid` | `String` | Optional | Unique identifier of an existing line item on the invoice. When provided, the matching line item is updated with the submitted attributes. When omitted, a new line item is added to the invoice. | String getUid() | setUid(String uid) | +| `Destroy` | `Boolean` | Optional | Set to `true` together with `uid` to remove the matching line item from the invoice. Line items not referenced in the request remain unchanged. | Boolean getDestroy() | setDestroy(Boolean destroy) | + +## Example + +```java +import com.maxio.advancedbilling.models.UpdateInvoiceItem; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemQuantity; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemUnitPrice; + +UpdateInvoiceItem updateInvoiceItem = new UpdateInvoiceItem.Builder() + .title("title8") + .quantity(UpdateInvoiceItemQuantity.fromPrecision( + 94.82D + )) + .unitPrice(UpdateInvoiceItemUnitPrice.fromPrecision( + 78.04D + )) + .taxable(false) + .taxCode("tax_code0") + .build(); +``` + diff --git a/doc/models/update-invoice-request.md b/doc/models/update-invoice-request.md new file mode 100644 index 00000000..6e64d19a --- /dev/null +++ b/doc/models/update-invoice-request.md @@ -0,0 +1,72 @@ + +# Update Invoice Request + +Request payload for updating a draft ad hoc invoice. + +## Structure + +`UpdateInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Invoice` | [`UpdateInvoice`](../../doc/models/update-invoice.md) | Required | Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. | UpdateInvoice getInvoice() | setInvoice(UpdateInvoice invoice) | + +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.UpdateInvoice; +import com.maxio.advancedbilling.models.UpdateInvoiceItem; +import com.maxio.advancedbilling.models.UpdateInvoiceRequest; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemQuantity; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemUnitPrice; +import java.util.Arrays; + +UpdateInvoiceRequest updateInvoiceRequest = new UpdateInvoiceRequest.Builder( + new UpdateInvoice.Builder() + .lineItems(Arrays.asList( + new UpdateInvoiceItem.Builder() + .title("title4") + .quantity(UpdateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(UpdateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build(), + new UpdateInvoiceItem.Builder() + .title("title4") + .quantity(UpdateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(UpdateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build(), + new UpdateInvoiceItem.Builder() + .title("title4") + .quantity(UpdateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(UpdateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build() + )) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .netTerms(144) + .paymentInstructions("payment_instructions6") + .memo("memo0") + .build() +) +.build(); +``` + diff --git a/doc/models/update-invoice.md b/doc/models/update-invoice.md new file mode 100644 index 00000000..923eedc0 --- /dev/null +++ b/doc/models/update-invoice.md @@ -0,0 +1,54 @@ + +# Update Invoice + +Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. + +## Structure + +`UpdateInvoice` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `LineItems` | [`List`](../../doc/models/update-invoice-item.md) | Optional | Line item changes to apply. Line items without a `uid` are added, line items with a `uid` are updated, and line items with a `uid` and `_destroy` set to `true` are removed. Existing line items not referenced in the array remain unchanged. | List getLineItems() | setLineItems(List lineItems) | +| `IssueDate` | `LocalDate` | Optional | New issue date for the invoice (format YYYY-MM-DD). This date is interpreted and validated in your site's time zone. It must be today or a date in the past — future dates are not accepted. The due date is recalculated from the issue date and net terms. | LocalDate getIssueDate() | setIssueDate(LocalDate issueDate) | +| `NetTerms` | `Integer` | Optional | Number of days after the issue date on which the invoice is due. The due date is recalculated when net terms or the issue date change. | Integer getNetTerms() | setNetTerms(Integer netTerms) | +| `PaymentInstructions` | `String` | Optional | Custom payment instructions displayed on the invoice. | String getPaymentInstructions() | setPaymentInstructions(String paymentInstructions) | +| `Memo` | `String` | Optional | A custom memo displayed on the invoice. | String getMemo() | setMemo(String memo) | +| `SellerAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the seller address on the invoice | CreateInvoiceAddress getSellerAddress() | setSellerAddress(CreateInvoiceAddress sellerAddress) | +| `BillingAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the billing address on the invoice | CreateInvoiceAddress getBillingAddress() | setBillingAddress(CreateInvoiceAddress billingAddress) | +| `ShippingAddress` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the shipping address on the invoice | CreateInvoiceAddress getShippingAddress() | setShippingAddress(CreateInvoiceAddress shippingAddress) | +| `Coupons` | [`List`](../../doc/models/create-invoice-coupon.md) | Optional | When present, replaces all discounts currently applied to the invoice. Send an empty array to remove all discounts. | List getCoupons() | setCoupons(List coupons) | + +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.UpdateInvoice; +import com.maxio.advancedbilling.models.UpdateInvoiceItem; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemQuantity; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemUnitPrice; +import java.util.Arrays; + +UpdateInvoice updateInvoice = new UpdateInvoice.Builder() + .lineItems(Arrays.asList( + new UpdateInvoiceItem.Builder() + .title("title4") + .quantity(UpdateInvoiceItemQuantity.fromPrecision( + 56.68D + )) + .unitPrice(UpdateInvoiceItemUnitPrice.fromPrecision( + 39.9D + )) + .taxable(false) + .taxCode("tax_code6") + .build() + )) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .netTerms(46) + .paymentInstructions("payment_instructions6") + .memo("memo2") + .build(); +``` + diff --git a/doc/models/update-metadata-request.md b/doc/models/update-metadata-request.md index 491f6b74..caa940c7 100644 --- a/doc/models/update-metadata-request.md +++ b/doc/models/update-metadata-request.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `Metadata` | [`UpdateMetadata`](../../doc/models/update-metadata.md) | Optional | - | UpdateMetadata getMetadata() | setMetadata(UpdateMetadata metadata) | -## Example (as JSON) - -```json -{ - "metadata": { - "current_name": "current_name0", - "name": "name6", - "value": "value8" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateMetadata; +import com.maxio.advancedbilling.models.UpdateMetadataRequest; + +UpdateMetadataRequest updateMetadataRequest = new UpdateMetadataRequest.Builder() + .metadata(new UpdateMetadata.Builder() + .currentName("current_name0") + .name("name6") + .value("value8") + .build()) + .build(); ``` diff --git a/doc/models/update-metadata.md b/doc/models/update-metadata.md index 0afefef3..d4b3ead1 100644 --- a/doc/models/update-metadata.md +++ b/doc/models/update-metadata.md @@ -13,13 +13,15 @@ | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Value` | `String` | Optional | - | String getValue() | setValue(String value) | -## Example (as JSON) - -```json -{ - "current_name": "current_name4", - "name": "name0", - "value": "value2" -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateMetadata; + +UpdateMetadata updateMetadata = new UpdateMetadata.Builder() + .currentName("current_name8") + .name("name4") + .value("value6") + .build(); ``` diff --git a/doc/models/update-metafield.md b/doc/models/update-metafield.md index e41a2c3d..3ecad3bf 100644 --- a/doc/models/update-metafield.md +++ b/doc/models/update-metafield.md @@ -12,26 +12,34 @@ | `CurrentName` | `String` | Optional | - | String getCurrentName() | setCurrentName(String currentName) | | `Name` | `String` | Optional | - | String getName() | setName(String name) | | `Scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | MetafieldScope getScope() | setScope(MetafieldScope scope) | -| `InputType` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | MetafieldInput getInputType() | setInputType(MetafieldInput inputType) | +| `InputType` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | MetafieldInput getInputType() | setInputType(MetafieldInput inputType) | | `Enum` | `List` | Optional | Only applicable when input_type is radio or dropdown. | List getEnum() | setEnum(List mEnum) | -## Example (as JSON) - -```json -{ - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "input_type": "balance_tracker", - "enum": [ - "enum2" - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.IncludeOption; +import com.maxio.advancedbilling.models.MetafieldInput; +import com.maxio.advancedbilling.models.MetafieldScope; +import com.maxio.advancedbilling.models.UpdateMetafield; +import java.util.Arrays; + +UpdateMetafield updateMetafield = new UpdateMetafield.Builder() + .currentName("current_name6") + .name("name2") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .build()) + .inputType(MetafieldInput.RADIO) + .mEnum(Arrays.asList( + "enum8", + "enum9", + "enum0" + )) + .build(); ``` diff --git a/doc/models/update-metafields-request.md b/doc/models/update-metafields-request.md index d5ba4e94..8cf6fc1b 100644 --- a/doc/models/update-metafields-request.md +++ b/doc/models/update-metafields-request.md @@ -11,25 +11,35 @@ | --- | --- | --- | --- | --- | --- | | `Metafields` | [`UpdateMetafieldsRequestMetafields`](../../doc/models/containers/update-metafields-request-metafields.md) | Optional | This is a container for one-of cases. | UpdateMetafieldsRequestMetafields getMetafields() | setMetafields(UpdateMetafieldsRequestMetafields metafields) | -## Example (as JSON) - -```json -{ - "metafields": { - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "input_type": "balance_tracker", - "enum": [ - "enum2" - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.IncludeOption; +import com.maxio.advancedbilling.models.MetafieldInput; +import com.maxio.advancedbilling.models.MetafieldScope; +import com.maxio.advancedbilling.models.UpdateMetafield; +import com.maxio.advancedbilling.models.UpdateMetafieldsRequest; +import com.maxio.advancedbilling.models.containers.UpdateMetafieldsRequestMetafields; +import java.util.Arrays; + +UpdateMetafieldsRequest updateMetafieldsRequest = new UpdateMetafieldsRequest.Builder() + .metafields(UpdateMetafieldsRequestMetafields.fromUpdateMetafield( + new UpdateMetafield.Builder() + .currentName("current_name0") + .name("name6") + .scope(new MetafieldScope.Builder() + .csv(IncludeOption.EXCLUDE) + .invoices(IncludeOption.EXCLUDE) + .statements(IncludeOption.EXCLUDE) + .portal(IncludeOption.EXCLUDE) + .publicShow(IncludeOption.EXCLUDE) + .build()) + .inputType(MetafieldInput.BALANCE_TRACKER) + .mEnum(Arrays.asList( + "enum2" + )) + .build() + )) + .build(); ``` diff --git a/doc/models/update-payment-profile-request.md b/doc/models/update-payment-profile-request.md index 3edd4ba1..3d9dee51 100644 --- a/doc/models/update-payment-profile-request.md +++ b/doc/models/update-payment-profile-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | --- | --- | | `PaymentProfile` | [`UpdatePaymentProfile`](../../doc/models/update-payment-profile.md) | Required | - | UpdatePaymentProfile getPaymentProfile() | setPaymentProfile(UpdatePaymentProfile paymentProfile) | -## Example (as JSON) - -```json -{ - "payment_profile": { - "full_number": "5424000000000015", - "first_name": "first_name4", - "last_name": "last_name2", - "card_type": "bogus", - "expiration_month": "expiration_month0" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CardType; +import com.maxio.advancedbilling.models.UpdatePaymentProfile; +import com.maxio.advancedbilling.models.UpdatePaymentProfileRequest; + +UpdatePaymentProfileRequest updatePaymentProfileRequest = new UpdatePaymentProfileRequest.Builder( + new UpdatePaymentProfile.Builder() + .firstName("first_name4") + .lastName("last_name2") + .fullNumber("5424000000000015") + .cardType(CardType.BOGUS) + .expirationMonth("expiration_month0") + .build() +) +.build(); ``` diff --git a/doc/models/update-payment-profile.md b/doc/models/update-payment-profile.md index 92cc7ddf..6cc5d23f 100644 --- a/doc/models/update-payment-profile.md +++ b/doc/models/update-payment-profile.md @@ -13,25 +13,28 @@ | `LastName` | `String` | Optional | The last name of the card holder. | String getLastName() | setLastName(String lastName) | | `FullNumber` | `String` | Optional | The full credit card number | String getFullNumber() | setFullNumber(String fullNumber) | | `CardType` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | CardType getCardType() | setCardType(CardType cardType) | -| `ExpirationMonth` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 | String getExpirationMonth() | setExpirationMonth(String expirationMonth) | -| `ExpirationYear` | `String` | Optional | (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 | String getExpirationYear() | setExpirationYear(String expirationYear) | +| `ExpirationMonth` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, e.g., 5 | String getExpirationMonth() | setExpirationMonth(String expirationMonth) | +| `ExpirationYear` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, e.g., 2012 | String getExpirationYear() | setExpirationYear(String expirationYear) | | `CurrentVault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | AllVaults getCurrentVault() | setCurrentVault(AllVaults currentVault) | -| `BillingAddress` | `String` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | String getBillingAddress() | setBillingAddress(String billingAddress) | -| `BillingCity` | `String` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | String getBillingCity() | setBillingCity(String billingCity) | -| `BillingState` | `String` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | String getBillingState() | setBillingState(String billingState) | -| `BillingZip` | `String` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | String getBillingZip() | setBillingZip(String billingZip) | -| `BillingCountry` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | String getBillingCountry() | setBillingCountry(String billingCountry) | -| `BillingAddress2` | `String` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | - -## Example (as JSON) - -```json -{ - "full_number": "5424000000000015", - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "carnet", - "expiration_month": "expiration_month2" -} +| `BillingAddress` | `String` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | String getBillingAddress() | setBillingAddress(String billingAddress) | +| `BillingCity` | `String` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | String getBillingCity() | setBillingCity(String billingCity) | +| `BillingState` | `String` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | String getBillingState() | setBillingState(String billingState) | +| `BillingZip` | `String` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | String getBillingZip() | setBillingZip(String billingZip) | +| `BillingCountry` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | String getBillingCountry() | setBillingCountry(String billingCountry) | +| `BillingAddress2` | `String` | Optional | Second line of the customer’s billing address, e.g., Apt. 100 | String getBillingAddress2() | setBillingAddress2(String billingAddress2) | + +## Example + +```java +import com.maxio.advancedbilling.models.CardType; +import com.maxio.advancedbilling.models.UpdatePaymentProfile; + +UpdatePaymentProfile updatePaymentProfile = new UpdatePaymentProfile.Builder() + .firstName("first_name6") + .lastName("last_name4") + .fullNumber("5424000000000015") + .cardType(CardType.AMERICAN_EXPRESS) + .expirationMonth("expiration_month8") + .build(); ``` diff --git a/doc/models/update-price.md b/doc/models/update-price.md index d980a396..bf0c9a0f 100644 --- a/doc/models/update-price.md +++ b/doc/models/update-price.md @@ -15,15 +15,26 @@ | `Destroy` | `Boolean` | Optional | - | Boolean getDestroy() | setDestroy(Boolean destroy) | | `StartingQuantity` | [`UpdatePriceStartingQuantity`](../../doc/models/containers/update-price-starting-quantity.md) | Optional | This is a container for one-of cases. | UpdatePriceStartingQuantity getStartingQuantity() | setStartingQuantity(UpdatePriceStartingQuantity startingQuantity) | -## Example (as JSON) - -```json -{ - "id": 18, - "ending_quantity": 216, - "unit_price": 166.62, - "_destroy": false, - "starting_quantity": 242 -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdatePrice; +import com.maxio.advancedbilling.models.containers.UpdatePriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.UpdatePriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.UpdatePriceUnitPrice; + +UpdatePrice updatePrice = new UpdatePrice.Builder() + .id(206) + .endingQuantity(UpdatePriceEndingQuantity.fromNumber( + 28 + )) + .unitPrice(UpdatePriceUnitPrice.fromPrecision( + 181.3D + )) + .destroy(false) + .startingQuantity(UpdatePriceStartingQuantity.fromNumber( + 54 + )) + .build(); ``` diff --git a/doc/models/update-product-price-point-request.md b/doc/models/update-product-price-point-request.md index 44a9ce6f..e48079fa 100644 --- a/doc/models/update-product-price-point-request.md +++ b/doc/models/update-product-price-point-request.md @@ -11,14 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `PricePoint` | [`UpdateProductPricePoint`](../../doc/models/update-product-price-point.md) | Required | - | UpdateProductPricePoint getPricePoint() | setPricePoint(UpdateProductPricePoint pricePoint) | -## Example (as JSON) - -```json -{ - "price_point": { - "handle": "handle6", - "price_in_cents": 196 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateProductPricePoint; +import com.maxio.advancedbilling.models.UpdateProductPricePointRequest; + +UpdateProductPricePointRequest updateProductPricePointRequest = new UpdateProductPricePointRequest.Builder( + new UpdateProductPricePoint.Builder() + .handle("handle6") + .priceInCents(196L) + .build() +) +.build(); ``` diff --git a/doc/models/update-product-price-point.md b/doc/models/update-product-price-point.md index 456dc850..78a71552 100644 --- a/doc/models/update-product-price-point.md +++ b/doc/models/update-product-price-point.md @@ -12,12 +12,14 @@ | `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | | `PriceInCents` | `Long` | Optional | - | Long getPriceInCents() | setPriceInCents(Long priceInCents) | -## Example (as JSON) +## Example -```json -{ - "handle": "handle6", - "price_in_cents": 220 -} +```java +import com.maxio.advancedbilling.models.UpdateProductPricePoint; + +UpdateProductPricePoint updateProductPricePoint = new UpdateProductPricePoint.Builder() + .handle("handle2") + .priceInCents(154L) + .build(); ``` diff --git a/doc/models/update-reason-code-request.md b/doc/models/update-reason-code-request.md index f592bfa9..6bf0cc50 100644 --- a/doc/models/update-reason-code-request.md +++ b/doc/models/update-reason-code-request.md @@ -11,15 +11,19 @@ | --- | --- | --- | --- | --- | --- | | `ReasonCode` | [`UpdateReasonCode`](../../doc/models/update-reason-code.md) | Required | - | UpdateReasonCode getReasonCode() | setReasonCode(UpdateReasonCode reasonCode) | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateReasonCode; +import com.maxio.advancedbilling.models.UpdateReasonCodeRequest; + +UpdateReasonCodeRequest updateReasonCodeRequest = new UpdateReasonCodeRequest.Builder( + new UpdateReasonCode.Builder() + .code("code4") + .description("description6") + .position(14) + .build() +) +.build(); ``` diff --git a/doc/models/update-reason-code.md b/doc/models/update-reason-code.md index f3ffc2d9..e327f75a 100644 --- a/doc/models/update-reason-code.md +++ b/doc/models/update-reason-code.md @@ -13,13 +13,15 @@ | `Description` | `String` | Optional | The friendly summary of what the code signifies | String getDescription() | setDescription(String description) | | `Position` | `Integer` | Optional | The order that code appears in lists | Integer getPosition() | setPosition(Integer position) | -## Example (as JSON) - -```json -{ - "code": "code0", - "description": "description8", - "position": 118 -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateReasonCode; + +UpdateReasonCode updateReasonCode = new UpdateReasonCode.Builder() + .code("code4") + .description("description6") + .position(4) + .build(); ``` diff --git a/doc/models/update-segment-request.md b/doc/models/update-segment-request.md index cb769e74..4a92c57e 100644 --- a/doc/models/update-segment-request.md +++ b/doc/models/update-segment-request.md @@ -11,30 +11,48 @@ | --- | --- | --- | --- | --- | --- | | `Segment` | [`UpdateSegment`](../../doc/models/update-segment.md) | Required | - | UpdateSegment getSegment() | setSegment(UpdateSegment segment) | -## Example (as JSON) - -```json -{ - "segment": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.UpdateSegment; +import com.maxio.advancedbilling.models.UpdateSegmentRequest; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; +import java.util.Arrays; + +UpdateSegmentRequest updateSegmentRequest = new UpdateSegmentRequest.Builder( + new UpdateSegment.Builder( + PricingScheme.STAIRSTEP + ) + .prices(Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + )) + .build() +) +.build(); ``` diff --git a/doc/models/update-segment.md b/doc/models/update-segment.md index 44810967..3d4b63bb 100644 --- a/doc/models/update-segment.md +++ b/doc/models/update-segment.md @@ -12,18 +12,44 @@ | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/create-or-update-segment-price.md) | Optional | - | List getPrices() | setPrices(List prices) | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.CreateOrUpdateSegmentPrice; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.UpdateSegment; +import com.maxio.advancedbilling.models.containers.CreateOrUpdateSegmentPriceUnitPrice; +import java.util.Arrays; + +UpdateSegment updateSegment = new UpdateSegment.Builder( + PricingScheme.STAIRSTEP +) +.prices(Arrays.asList( + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build(), + new CreateOrUpdateSegmentPrice.Builder( + CreateOrUpdateSegmentPriceUnitPrice.fromString( + "String3" + ) + ) + .startingQuantity(64) + .endingQuantity(38) + .build() + )) +.build(); ``` diff --git a/doc/models/update-subscription-component.md b/doc/models/update-subscription-component.md index 529ed0e1..d37251ac 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -12,30 +12,55 @@ | `ComponentId` | `Integer` | Optional | - | Integer getComponentId() | setComponentId(Integer componentId) | | `CustomPrice` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | ComponentCustomPrice getCustomPrice() | setCustomPrice(ComponentCustomPrice customPrice) | -## Example (as JSON) - -```json -{ - "component_id": 244, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.ComponentCustomPrice; +import com.maxio.advancedbilling.models.IntervalUnit; +import com.maxio.advancedbilling.models.Price; +import com.maxio.advancedbilling.models.PricingScheme; +import com.maxio.advancedbilling.models.UpdateSubscriptionComponent; +import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; +import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; +import com.maxio.advancedbilling.models.containers.PriceUnitPrice; +import java.util.Arrays; + +UpdateSubscriptionComponent updateSubscriptionComponent = new UpdateSubscriptionComponent.Builder() + .componentId(118) + .customPrice(new ComponentCustomPrice.Builder( + Arrays.asList( + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build(), + new Price.Builder( + PriceStartingQuantity.fromNumber( + 242 + ), + PriceUnitPrice.fromPrecision( + 23.26D + ) + ) + .endingQuantity(PriceEndingQuantity.fromNumber( + 40 + )) + .build() + ) + ) + .taxIncluded(false) + .pricingScheme(PricingScheme.STAIRSTEP) + .interval(66) + .intervalUnit(IntervalUnit.DAY) + .listPricePointId(174) + .build()) + .build(); ``` diff --git a/doc/models/update-subscription-group-request.md b/doc/models/update-subscription-group-request.md index 742b67b3..e6493358 100644 --- a/doc/models/update-subscription-group-request.md +++ b/doc/models/update-subscription-group-request.md @@ -11,16 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `SubscriptionGroup` | [`UpdateSubscriptionGroup`](../../doc/models/update-subscription-group.md) | Required | - | UpdateSubscriptionGroup getSubscriptionGroup() | setSubscriptionGroup(UpdateSubscriptionGroup subscriptionGroup) | -## Example (as JSON) - -```json -{ - "subscription_group": { - "member_ids": [ - 164, - 165 - ] - } -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateSubscriptionGroup; +import com.maxio.advancedbilling.models.UpdateSubscriptionGroupRequest; +import java.util.Arrays; + +UpdateSubscriptionGroupRequest updateSubscriptionGroupRequest = new UpdateSubscriptionGroupRequest.Builder( + new UpdateSubscriptionGroup.Builder() + .memberIds(Arrays.asList( + 164, + 165 + )) + .build() +) +.build(); ``` diff --git a/doc/models/update-subscription-group.md b/doc/models/update-subscription-group.md index 1cf810c1..4dc4d3d5 100644 --- a/doc/models/update-subscription-group.md +++ b/doc/models/update-subscription-group.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `MemberIds` | `List` | Optional | - | List getMemberIds() | setMemberIds(List memberIds) | -## Example (as JSON) - -```json -{ - "member_ids": [ - 52, - 53, - 54 - ] -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateSubscriptionGroup; +import java.util.Arrays; + +UpdateSubscriptionGroup updateSubscriptionGroup = new UpdateSubscriptionGroup.Builder() + .memberIds(Arrays.asList( + 248, + 249, + 250 + )) + .build(); ``` diff --git a/doc/models/update-subscription-note-request.md b/doc/models/update-subscription-note-request.md index 5e3dc3f2..1a879ace 100644 --- a/doc/models/update-subscription-note-request.md +++ b/doc/models/update-subscription-note-request.md @@ -13,14 +13,19 @@ Updatable fields for Subscription Note | --- | --- | --- | --- | --- | --- | | `Note` | [`UpdateSubscriptionNote`](../../doc/models/update-subscription-note.md) | Required | Updatable fields for Subscription Note | UpdateSubscriptionNote getNote() | setNote(UpdateSubscriptionNote note) | -## Example (as JSON) - -```json -{ - "note": { - "body": "body0", - "sticky": false - } -} +## Example + +```java +import com.maxio.advancedbilling.models.UpdateSubscriptionNote; +import com.maxio.advancedbilling.models.UpdateSubscriptionNoteRequest; + +UpdateSubscriptionNoteRequest updateSubscriptionNoteRequest = new UpdateSubscriptionNoteRequest.Builder( + new UpdateSubscriptionNote.Builder( + "body0", + false + ) + .build() +) +.build(); ``` diff --git a/doc/models/update-subscription-note.md b/doc/models/update-subscription-note.md index 69a1494e..dd4d6c75 100644 --- a/doc/models/update-subscription-note.md +++ b/doc/models/update-subscription-note.md @@ -14,12 +14,15 @@ Updatable fields for Subscription Note | `Body` | `String` | Required | - | String getBody() | setBody(String body) | | `Sticky` | `boolean` | Required | - | boolean getSticky() | setSticky(boolean sticky) | -## Example (as JSON) +## Example -```json -{ - "body": "body8", - "sticky": false -} +```java +import com.maxio.advancedbilling.models.UpdateSubscriptionNote; + +UpdateSubscriptionNote updateSubscriptionNote = new UpdateSubscriptionNote.Builder( + "body2", + false +) +.build(); ``` diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index 0af2f0f1..ea7ae6c8 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -11,23 +11,28 @@ | --- | --- | --- | --- | --- | --- | | `Subscription` | [`UpdateSubscription`](../../doc/models/update-subscription.md) | Required | - | UpdateSubscription getSubscription() | setSubscription(UpdateSubscription subscription) | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" - }, - "product_handle": "product_handle6", - "product_id": 206, - "product_change_delayed": false, - "next_product_id": "next_product_id6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.CreditCardAttributes; +import com.maxio.advancedbilling.models.UpdateSubscription; +import com.maxio.advancedbilling.models.UpdateSubscriptionRequest; + +UpdateSubscriptionRequest updateSubscriptionRequest = new UpdateSubscriptionRequest.Builder( + new UpdateSubscription.Builder() + .creditCardAttributes(new CreditCardAttributes.Builder() + .fullNumber("full_number2") + .expirationMonth("expiration_month6") + .expirationYear("expiration_year2") + .build()) + .productHandle("product_handle6") + .productId(206) + .productChangeDelayed(false) + .nextProductId("next_product_id6") + .deferSignup(false) + .dunningCommunicationDelayTimeZone("\"Eastern Time (US & Canada)\"") + .build() +) +.build(); ``` diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index 3fb4d61a..e5b17402 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -10,15 +10,16 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `CreditCardAttributes` | [`CreditCardAttributes`](../../doc/models/credit-card-attributes.md) | Optional | - | CreditCardAttributes getCreditCardAttributes() | setCreditCardAttributes(CreditCardAttributes creditCardAttributes) | -| `ProductHandle` | `String` | Optional | Set to the handle of a different product to change the subscription's product | String getProductHandle() | setProductHandle(String productHandle) | -| `ProductId` | `Integer` | Optional | Set to the id of a different product to change the subscription's product | Integer getProductId() | setProductId(Integer productId) | +| `ProductHandle` | `String` | Optional | Set to the handle of a different product to change the subscription's product. | String getProductHandle() | setProductHandle(String productHandle) | +| `ProductId` | `Integer` | Optional | Set to the id of a different product to change the subscription's product. | Integer getProductId() | setProductId(Integer productId) | | `ProductChangeDelayed` | `Boolean` | Optional | - | Boolean getProductChangeDelayed() | setProductChangeDelayed(Boolean productChangeDelayed) | | `NextProductId` | `String` | Optional | Set to an empty string to cancel a delayed product change. | String getNextProductId() | setNextProductId(String nextProductId) | | `NextProductPricePointId` | `String` | Optional | - | String getNextProductPricePointId() | setNextProductPricePointId(String nextProductPricePointId) | | `SnapDay` | [`UpdateSubscriptionSnapDay`](../../doc/models/containers/update-subscription-snap-day.md) | Optional | This is a container for one-of cases. | UpdateSubscriptionSnapDay getSnapDay() | setSnapDay(UpdateSubscriptionSnapDay snapDay) | -| `InitialBillingAt` | `ZonedDateTime` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | ZonedDateTime getInitialBillingAt() | setInitialBillingAt(ZonedDateTime initialBillingAt) | +| `InitialBillingAt` | `ZonedDateTime` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed, etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | ZonedDateTime getInitialBillingAt() | setInitialBillingAt(ZonedDateTime initialBillingAt) | | `DeferSignup` | `Boolean` | Optional | (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting Signup Date. Use this when you want to update a subscription that has an unknown initial billing date. When the first billing date is known, update a subscription to set the `initial_billing_at` date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | Boolean getDeferSignup() | setDeferSignup(Boolean deferSignup) | | `NextBillingAt` | `ZonedDateTime` | Optional | - | ZonedDateTime getNextBillingAt() | setNextBillingAt(ZonedDateTime nextBillingAt) | +| `BrandingThemeId` | `Integer` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | Integer getBrandingThemeId() | setBrandingThemeId(Integer brandingThemeId) | | `ExpiresAt` | `ZonedDateTime` | Optional | Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. | ZonedDateTime getExpiresAt() | setExpiresAt(ZonedDateTime expiresAt) | | `PaymentCollectionMethod` | `String` | Optional | - | String getPaymentCollectionMethod() | setPaymentCollectionMethod(String paymentCollectionMethod) | | `ReceivesInvoiceEmails` | `Boolean` | Optional | - | Boolean getReceivesInvoiceEmails() | setReceivesInvoiceEmails(Boolean receivesInvoiceEmails) | @@ -32,21 +33,24 @@ | `ProductPricePointId` | `Integer` | Optional | Set to change the current product's price point. | Integer getProductPricePointId() | setProductPricePointId(Integer productPricePointId) | | `ProductPricePointHandle` | `String` | Optional | Set to change the current product's price point. | String getProductPricePointHandle() | setProductPricePointHandle(String productPricePointHandle) | -## Example (as JSON) - -```json -{ - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" - }, - "product_handle": "product_handle2", - "product_id": 114, - "product_change_delayed": false, - "next_product_id": "next_product_id8" -} +## Example + +```java +import com.maxio.advancedbilling.models.CreditCardAttributes; +import com.maxio.advancedbilling.models.UpdateSubscription; + +UpdateSubscription updateSubscription = new UpdateSubscription.Builder() + .creditCardAttributes(new CreditCardAttributes.Builder() + .fullNumber("full_number2") + .expirationMonth("expiration_month6") + .expirationYear("expiration_year2") + .build()) + .productHandle("product_handle0") + .productId(16) + .productChangeDelayed(false) + .nextProductId("next_product_id0") + .deferSignup(false) + .dunningCommunicationDelayTimeZone("\"Eastern Time (US & Canada)\"") + .build(); ``` diff --git a/doc/models/upgrade-charge-credit-type.md b/doc/models/upgrade-charge-credit-type.md index 3bc95abc..2f562635 100644 --- a/doc/models/upgrade-charge-credit-type.md +++ b/doc/models/upgrade-charge-credit-type.md @@ -21,3 +21,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```java +import com.maxio.advancedbilling.models.UpgradeChargeCreditType; + +UpgradeChargeCreditType upgradeChargeCreditType = UpgradeChargeCreditType.FULL; +``` + diff --git a/doc/models/upsert-prepaid-configuration-request.md b/doc/models/upsert-prepaid-configuration-request.md index a348554d..f7371f82 100644 --- a/doc/models/upsert-prepaid-configuration-request.md +++ b/doc/models/upsert-prepaid-configuration-request.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | --- | --- | | `PrepaidConfiguration` | [`UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Required | - | UpsertPrepaidConfiguration getPrepaidConfiguration() | setPrepaidConfiguration(UpsertPrepaidConfiguration prepaidConfiguration) | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```java +import com.maxio.advancedbilling.models.UpsertPrepaidConfiguration; +import com.maxio.advancedbilling.models.UpsertPrepaidConfigurationRequest; + +UpsertPrepaidConfigurationRequest upsertPrepaidConfigurationRequest = new UpsertPrepaidConfigurationRequest.Builder( + new UpsertPrepaidConfiguration.Builder() + .initialFundingAmountInCents(74L) + .replenishToAmountInCents(76L) + .autoReplenish(false) + .replenishThresholdAmountInCents(20L) + .build() +) +.build(); ``` diff --git a/doc/models/upsert-prepaid-configuration.md b/doc/models/upsert-prepaid-configuration.md index 5b0a8a62..4f01b694 100644 --- a/doc/models/upsert-prepaid-configuration.md +++ b/doc/models/upsert-prepaid-configuration.md @@ -14,14 +14,16 @@ | `AutoReplenish` | `Boolean` | Optional | - | Boolean getAutoReplenish() | setAutoReplenish(Boolean autoReplenish) | | `ReplenishThresholdAmountInCents` | `Long` | Optional | - | Long getReplenishThresholdAmountInCents() | setReplenishThresholdAmountInCents(Long replenishThresholdAmountInCents) | -## Example (as JSON) - -```json -{ - "initial_funding_amount_in_cents": 40, - "replenish_to_amount_in_cents": 42, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 242 -} +## Example + +```java +import com.maxio.advancedbilling.models.UpsertPrepaidConfiguration; + +UpsertPrepaidConfiguration upsertPrepaidConfiguration = new UpsertPrepaidConfiguration.Builder() + .initialFundingAmountInCents(244L) + .replenishToAmountInCents(246L) + .autoReplenish(false) + .replenishThresholdAmountInCents(190L) + .build(); ``` diff --git a/doc/models/usage-response.md b/doc/models/usage-response.md index be1ba30f..108e502f 100644 --- a/doc/models/usage-response.md +++ b/doc/models/usage-response.md @@ -11,17 +11,25 @@ | --- | --- | --- | --- | --- | --- | | `Usage` | [`Usage`](../../doc/models/usage.md) | Required | - | Usage getUsage() | setUsage(Usage usage) | -## Example (as JSON) - -```json -{ - "usage": { - "id": 150, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 28, - "quantity": 28 - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Usage; +import com.maxio.advancedbilling.models.UsageResponse; +import com.maxio.advancedbilling.models.containers.UsageQuantity; + +UsageResponse usageResponse = new UsageResponse.Builder( + new Usage.Builder() + .id(150L) + .memo("memo2") + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .pricePointId(28) + .quantity(UsageQuantity.fromNumber( + 28 + )) + .build() +) +.build(); ``` diff --git a/doc/models/usage.md b/doc/models/usage.md index 927fd689..2cd27cb3 100644 --- a/doc/models/usage.md +++ b/doc/models/usage.md @@ -19,15 +19,21 @@ | `ComponentHandle` | `String` | Optional | - | String getComponentHandle() | setComponentHandle(String componentHandle) | | `SubscriptionId` | `Integer` | Optional | - | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | -## Example (as JSON) - -```json -{ - "id": 252, - "memo": "memo8", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 126, - "quantity": 130 -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Usage; +import com.maxio.advancedbilling.models.containers.UsageQuantity; + +Usage usage = new Usage.Builder() + .id(150L) + .memo("memo2") + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .pricePointId(28) + .quantity(UsageQuantity.fromNumber( + 28 + )) + .build(); ``` diff --git a/doc/models/void-invoice-event-data.md b/doc/models/void-invoice-event-data.md index 60373866..738b920f 100644 --- a/doc/models/void-invoice-event-data.md +++ b/doc/models/void-invoice-event-data.md @@ -18,22 +18,27 @@ Example schema for an `void_invoice` event | `IsAdvanceInvoice` | `boolean` | Required | If true, the invoice is an advance invoice. | boolean getIsAdvanceInvoice() | setIsAdvanceInvoice(boolean isAdvanceInvoice) | | `Reason` | `String` | Required | The reason for the void. | String getReason() | setReason(String reason) | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason8" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.VoidInvoiceEventData; + +VoidInvoiceEventData voidInvoiceEventData = new VoidInvoiceEventData.Builder( + new CreditNote.Builder() + .uid("uid2") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number("number0") + .build(), + "memo6", + "applied_amount6", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + false, + "reason8" +) +.build(); ``` diff --git a/doc/models/void-invoice-event.md b/doc/models/void-invoice-event.md index 35744497..a69ea9dc 100644 --- a/doc/models/void-invoice-event.md +++ b/doc/models/void-invoice-event.md @@ -15,38 +15,47 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.VOID_INVOICE` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`VoidInvoiceEventData`](../../doc/models/void-invoice-event-data.md) | Required | Example schema for an `void_invoice` event | VoidInvoiceEventData getEventData() | setEventData(VoidInvoiceEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 16, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "void_invoice", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason2" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.VoidInvoiceEvent; +import com.maxio.advancedbilling.models.VoidInvoiceEventData; + +VoidInvoiceEvent voidInvoiceEvent = new VoidInvoiceEvent.Builder( + 236L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.VOID_INVOICE, + new VoidInvoiceEventData.Builder( + new CreditNote.Builder() + .uid("uid2") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number("number0") + .build(), + "memo0", + "applied_amount2", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + false, + "reason2" + ) + .build() +) +.build(); ``` diff --git a/doc/models/void-invoice-request.md b/doc/models/void-invoice-request.md index 47389b5a..c013f033 100644 --- a/doc/models/void-invoice-request.md +++ b/doc/models/void-invoice-request.md @@ -11,13 +11,18 @@ | --- | --- | --- | --- | --- | --- | | `Void` | [`VoidInvoice`](../../doc/models/void-invoice.md) | Required | - | VoidInvoice getVoid() | setVoid(VoidInvoice mVoid) | -## Example (as JSON) - -```json -{ - "void": { - "reason": "reason6" - } -} +## Example + +```java +import com.maxio.advancedbilling.models.VoidInvoice; +import com.maxio.advancedbilling.models.VoidInvoiceRequest; + +VoidInvoiceRequest voidInvoiceRequest = new VoidInvoiceRequest.Builder( + new VoidInvoice.Builder( + "reason6" + ) + .build() +) +.build(); ``` diff --git a/doc/models/void-invoice.md b/doc/models/void-invoice.md index 3c4e84d8..501dacbf 100644 --- a/doc/models/void-invoice.md +++ b/doc/models/void-invoice.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | --- | --- | | `Reason` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getReason() | setReason(String reason) | -## Example (as JSON) +## Example -```json -{ - "reason": "reason2" -} +```java +import com.maxio.advancedbilling.models.VoidInvoice; + +VoidInvoice voidInvoice = new VoidInvoice.Builder( + "reason8" +) +.build(); ``` diff --git a/doc/models/void-remainder-event-data.md b/doc/models/void-remainder-event-data.md index e50e6c29..2ebaf2cb 100644 --- a/doc/models/void-remainder-event-data.md +++ b/doc/models/void-remainder-event-data.md @@ -16,20 +16,25 @@ Example schema for an `void_remainder` event | `AppliedAmount` | `String` | Required | The amount of the void. | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | | `TransactionTime` | `ZonedDateTime` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | ZonedDateTime getTransactionTime() | setTransactionTime(ZonedDateTime transactionTime) | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo6", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.VoidRemainderEventData; + +VoidRemainderEventData voidRemainderEventData = new VoidRemainderEventData.Builder( + new CreditNote.Builder() + .uid("uid2") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number("number0") + .build(), + "memo6", + "applied_amount6", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") +) +.build(); ``` diff --git a/doc/models/void-remainder-event.md b/doc/models/void-remainder-event.md index efd20adb..d92529d1 100644 --- a/doc/models/void-remainder-event.md +++ b/doc/models/void-remainder-event.md @@ -15,36 +15,45 @@ | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.VOID_REMAINDER` | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`VoidRemainderEventData`](../../doc/models/void-remainder-event-data.md) | Required | Example schema for an `void_remainder` event | VoidRemainderEventData getEventData() | setEventData(VoidRemainderEventData eventData) | -## Example (as JSON) - -```json -{ - "id": 128, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "void_remainder", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.Invoice; +import com.maxio.advancedbilling.models.InvoiceEventType; +import com.maxio.advancedbilling.models.VoidRemainderEvent; +import com.maxio.advancedbilling.models.VoidRemainderEventData; + +VoidRemainderEvent voidRemainderEvent = new VoidRemainderEvent.Builder( + 198L, + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z"), + new Invoice.Builder() + .id(166L) + .uid("uid6") + .siteId(92) + .customerId(204) + .subscriptionId(20) + .issueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .dueDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .paidDate(DateTimeHelper.fromSimpleDate("2024-01-01")) + .publicUrlExpiresOn(DateTimeHelper.fromSimpleDate("2024-01-21")) + .build(), + InvoiceEventType.VOID_REMAINDER, + new VoidRemainderEventData.Builder( + new CreditNote.Builder() + .uid("uid2") + .siteId(72) + .customerId(184) + .subscriptionId(0) + .number("number0") + .build(), + "memo0", + "applied_amount2", + DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z") + ) + .build() +) +.build(); ``` diff --git a/doc/models/webhook-order.md b/doc/models/webhook-order.md index 528b979f..ab5b7558 100644 --- a/doc/models/webhook-order.md +++ b/doc/models/webhook-order.md @@ -12,3 +12,11 @@ | `NEWEST_FIRST` | | `OLDEST_FIRST` | +## Example + +```java +import com.maxio.advancedbilling.models.WebhookOrder; + +WebhookOrder webhookOrder = WebhookOrder.NEWEST_FIRST; +``` + diff --git a/doc/models/webhook-response.md b/doc/models/webhook-response.md index 3464dffa..713aa090 100644 --- a/doc/models/webhook-response.md +++ b/doc/models/webhook-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | --- | --- | | `Webhook` | [`Webhook`](../../doc/models/webhook.md) | Optional | - | Webhook getWebhook() | setWebhook(Webhook webhook) | -## Example (as JSON) - -```json -{ - "webhook": { - "event": "event2", - "id": 18, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error4", - "last_error_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Webhook; +import com.maxio.advancedbilling.models.WebhookResponse; + +WebhookResponse webhookResponse = new WebhookResponse.Builder() + .webhook(new Webhook.Builder() + .event("event2") + .id(18L) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .lastError("last_error4") + .lastErrorAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build()) + .build(); ``` diff --git a/doc/models/webhook-status.md b/doc/models/webhook-status.md index 9202a9bf..750181ef 100644 --- a/doc/models/webhook-status.md +++ b/doc/models/webhook-status.md @@ -14,3 +14,11 @@ | `PENDING` | | `PAUSED` | +## Example + +```java +import com.maxio.advancedbilling.models.WebhookStatus; + +WebhookStatus webhookStatus = WebhookStatus.SUCCESSFUL; +``` + diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index 85990e59..08aa2919 100644 --- a/doc/models/webhook-subscription.md +++ b/doc/models/webhook-subscription.md @@ -39,6 +39,7 @@ | `SUBSCRIPTION_CARD_UPDATE` | | `SUBSCRIPTION_GROUP_CARD_UPDATE` | | `SUBSCRIPTION_PRODUCT_CHANGE` | +| `SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED` | | `SUBSCRIPTION_STATE_CHANGE` | | `TRIAL_END_NOTICE` | | `UPCOMING_RENEWAL_NOTICE` | @@ -48,3 +49,11 @@ | `SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED` | | `SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED` | +## Example + +```java +import com.maxio.advancedbilling.models.WebhookSubscription; + +WebhookSubscription webhookSubscription = WebhookSubscription.DIRECT_DEBIT_PAYMENT_PENDING; +``` + diff --git a/doc/models/webhook.md b/doc/models/webhook.md index 6ef44a82..3777c909 100644 --- a/doc/models/webhook.md +++ b/doc/models/webhook.md @@ -10,27 +10,30 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Event` | `String` | Optional | A string describing which event type produced the given webhook | String getEvent() | setEvent(String event) | -| `Id` | `Long` | Optional | The unique identifier for the webhooks (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | Long getId() | setId(Long id) | +| `Id` | `Long` | Optional | The unique identifier for the webhook (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | Long getId() | setId(Long id) | | `CreatedAt` | `ZonedDateTime` | Optional | Timestamp indicating when the webhook was created | ZonedDateTime getCreatedAt() | setCreatedAt(ZonedDateTime createdAt) | | `LastError` | `String` | Optional | Text describing the status code and/or error from the last failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared. | String getLastError() | setLastError(String lastError) | | `LastErrorAt` | `ZonedDateTime` | Optional | Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. | ZonedDateTime getLastErrorAt() | setLastErrorAt(ZonedDateTime lastErrorAt) | | `AcceptedAt` | `ZonedDateTime` | Optional | Timestamp indicating when the webhook was accepted by the merchant endpoint. When a webhook is explicitly replayed by the merchant, this value will be cleared until it is accepted again. | ZonedDateTime getAcceptedAt() | setAcceptedAt(ZonedDateTime acceptedAt) | | `LastSentAt` | `ZonedDateTime` | Optional | Timestamp indicating when the most recent attempt was made to send the webhook | ZonedDateTime getLastSentAt() | setLastSentAt(ZonedDateTime lastSentAt) | | `LastSentUrl` | `String` | Optional | The url that the endpoint was last sent to. | String getLastSentUrl() | setLastSentUrl(String lastSentUrl) | -| `Successful` | `Boolean` | Optional | A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds) | Boolean getSuccessful() | setSuccessful(Boolean successful) | +| `Successful` | `Boolean` | Optional | “A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, e.g., 15 seconds.)” | Boolean getSuccessful() | setSuccessful(Boolean successful) | | `Body` | `String` | Optional | The data sent within the webhook post | String getBody() | setBody(String body) | | `Signature` | `String` | Optional | The calculated webhook signature | String getSignature() | setSignature(String signature) | | `SignatureHmacSha256` | `String` | Optional | The calculated HMAC-SHA-256 webhook signature | String getSignatureHmacSha256() | setSignatureHmacSha256(String signatureHmacSha256) | -## Example (as JSON) +## Example -```json -{ - "event": "event6", - "id": 154, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error8", - "last_error_at": "2016-03-13T12:52:32.123Z" -} +```java +import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.Webhook; + +Webhook webhook = new Webhook.Builder() + .event("event2") + .id(18L) + .createdAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .lastError("last_error4") + .lastErrorAt(DateTimeHelper.fromRfc8601DateTime("2016-03-13T12:52:32.123Z")) + .build(); ``` diff --git a/pom.xml b/pom.xml index e4bd772a..fa1b278a 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ 4.0.0 com.maxio advanced-billing-sdk - 9.1.0 + 10.0.0 jar Advanced Billing SDK Ultimate billing and pricing flexibility for B2B SaaS. diff --git a/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java b/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java index 429718bb..23faec53 100644 --- a/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java +++ b/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java @@ -101,7 +101,7 @@ public final class AdvancedBillingClient implements Configuration { private static final CompatibilityFactory compatibilityFactory = new CompatibilityFactoryImpl(); - private static String userAgent = "AB SDK Java:9.1.0 on OS {os-info}"; + private static String userAgent = "AB SDK Java:10.0.0 on OS {os-info}"; /** * Current API environment. diff --git a/src/main/java/com/maxio/advancedbilling/Environment.java b/src/main/java/com/maxio/advancedbilling/Environment.java index dcec193e..05a48cf3 100644 --- a/src/main/java/com/maxio/advancedbilling/Environment.java +++ b/src/main/java/com/maxio/advancedbilling/Environment.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * Environment to be used. */ @@ -27,7 +26,6 @@ public enum Environment { */ EU; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/Server.java b/src/main/java/com/maxio/advancedbilling/Server.java index 9e9bf2fb..90e91d57 100644 --- a/src/main/java/com/maxio/advancedbilling/Server.java +++ b/src/main/java/com/maxio/advancedbilling/Server.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * Server to be used. */ @@ -21,7 +20,6 @@ public enum Server { EBB; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java b/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java index 3fe3db07..ef9e1c70 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java @@ -180,8 +180,8 @@ private ApiCall, ApiException> prepareListExportedSubscriptio } /** - * Creates a proforma invoices export and returns a batch job object. It is only available for - * Relationship Invoicing architecture. + * Creates a proforma invoices export and returns a batch job object. Proforma invoices are only + * available on Relationship Invoicing sites. * @return Returns the BatchJobResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -292,7 +292,8 @@ private ApiCall prepareExportSubscriptionsReques } /** - * Returns a batch job object for a proforma invoices export. + * Returns a batch job object for a proforma invoices export. Proforma invoices are only + * available on Relationship Invoicing sites. * @param batchId Required parameter: Id of a Batch Job. * @return Returns the BatchJobResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java b/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java index 8efeb272..535ff585 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java @@ -34,17 +34,17 @@ public AdvanceInvoiceController(GlobalConfiguration globalConfig) { } /** - * Generate an invoice in advance for a subscription's next renewal date. [See our - * docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) - * for more information on advance invoices, including eligibility for generating one; for the - * most part, they function like any other invoice, except they are issued early and have - * special behavior upon being voided. A subscription may only have one advance invoice per - * billing period. Attempting to issue an advance invoice when one already exists will return an - * error. That said, regeneration of the invoice may be forced with the params `force: true`, - * which will void an advance invoice if one exists and generate a new one. If no advance - * invoice exists, a new one will be generated. We recommend using either the create or preview - * endpoints for proforma invoices to preview this advance invoice before using this endpoint to - * generate it. + * Issues an invoice in advance for a subscription's next renewal date. For the most part, + * advance invoices function like any other invoice, except they are issued early and have + * special behavior upon being voided. For more information on advance invoices, including + * eligibility for generating one, see [Issue Invoice In + * Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance). + * A subscription can only have one advance invoice per billing period. Attempting to issue an + * advance invoice when one already exists returns an error. Regeneration of the invoice can be + * forced with the params `force: true`, which voids an advance invoice if one exists and + * generates a new one. If no advance invoice exists, a new one is generated. Consider using + * either the create or preview endpoints for proforma invoices to preview this advance invoice + * before using this endpoint to generate it. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param body Optional parameter: * @return Returns the Invoice response from the API call @@ -135,11 +135,10 @@ private ApiCall prepareReadAdvanceInvoiceRequest( } /** - * Void a subscription's existing advance invoice. Once voided, it can later be regenerated if - * desired. A `reason` is required in order to void, and the invoice must have an open status. - * Voiding will cause any prepayments and credits that were applied to the invoice to be - * returned to the subscription. For a full overview of the impact of voiding, [see our help - * docs]($m/Invoice). + * Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if + * desired. A `reason` is required to void, and the invoice must have an open status. Voiding + * causes any prepayments and credits that were applied to the invoice to be returned to the + * subscription. For a full overview of the impact of voiding, see [Invoice]($m/Invoice). * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param body Optional parameter: * @return Returns the Invoice response from the API call diff --git a/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java b/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java index 86386366..7e34fe1a 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java @@ -38,23 +38,18 @@ public BillingPortalController(GlobalConfiguration globalConfig) { /** * Enables Billing Portal access for a customer, with an option to send an invitation email at - * the same time. ## Billing Portal Documentation Full documentation on how the Billing Portal - * operates within the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). - * This documentation is focused on how to configure the Billing Portal Settings, as well as - * Subscriber Interaction and Merchant Management of the Billing Portal. You can use this - * endpoint to enable Billing Portal access for a Customer, with the option of sending the - * Customer an Invitation email at the same time. ## Billing Portal Security If your customer - * has been invited to the Billing Portal, then they will receive a link to manage their - * subscription (the “Management URL”) automatically at the bottom of their statements, - * invoices, and receipts. **This link changes periodically for security and is only valid for - * 65 days.** If you need to provide your customer their Management URL through other means, you - * can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it - * is not possible for merchants to generate the URL without requesting it from Advanced - * Billing. In order to prevent abuse & overuse, we ask that you request a new URL only when - * absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously - * generated one as much as possible. If you use the URL frequently (such as to display on your - * website), **do not** make an API request to Advanced Billing every time. + * the same time. ## Billing Portal Security If your customer has been invited to the Billing + * Portal, they receive a link to manage their subscription (the “Management URL”) automatically + * at the bottom of their statements, invoices, and receipts. **This link changes periodically + * for security and is only valid for 65 days.** If you need to provide your customer their + * Management URL through other means, you can retrieve it [via the + * API]($e/Billing%20Portal/readBillingPortalLink). Because the URL is cryptographically signed + * with a timestamp, merchants cannot generate the URL without requesting it through the API. To + * prevent abuse and overuse, request a new URL only when absolutely necessary. Management URLs + * are good for 65 days, so you should re-use a previously generated one as much as possible. If + * you use the URL frequently (such as to display on your website), **do not** make an API + * request every time. For more information configuring the Billing Portal, see [Billing Portal + * Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). * @param customerId Required parameter: The Chargify id of the customer * @param autoInvite Optional parameter: When set to 1, an Invitation email will be sent to * the Customer. When set to 0, or not sent, an email will not be sent. Use in query: @@ -101,13 +96,13 @@ private ApiCall prepareEnableBillingPortalForCus } /** - * Returns the exact URL required for a subscriber to access the Billing Portal. ## Rules for - * Management Link API + When retrieving a management URL, multiple requests for the same - * customer in a short period will return the **same** URL + We will not generate a new URL for - * 15 days + You must cache and remember this URL if you are going to need it again within 15 - * days + Only request a new URL after the `new_link_available_at` date + You are limited to 15 - * requests for the same URL. If you make more than 15 requests before `new_link_available_at`, - * you will be blocked from further Management URL requests (with a response code `429`). + * Returns the exact URL required for a subscriber to access the Billing Portal. ## Management + * Link Request Rules + When retrieving a management URL, multiple requests for the same + * customer in a short period return the **same** URL + A new URL is not generated for 15 days + + * You must cache and remember this URL if you are going to need it again within 15 days + Only + * request a new URL after the `new_link_available_at` date + You are limited to 15 requests for + * the same URL. If you make more than 15 requests before `new_link_available_at`, you are + * blocked from further Management URL requests (with a response code `429`). * @param customerId Required parameter: The Chargify id of the customer * @return Returns the PortalManagementLink response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ComponentPricePointsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ComponentPricePointsController.java index 48d01ef3..35e8e3e2 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ComponentPricePointsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ComponentPricePointsController.java @@ -152,12 +152,9 @@ private ApiCall prepareCreateComponen /** * Lists the price points associated with a component. You may specify the component by using - * either the numeric id or the `handle:gold` syntax. When fetching a component's price points, - * if you have defined multiple currencies at the site level, you can optionally pass the - * `?currency_prices=true` query param to include an array of currency price data in the - * response. If the price point is set to `use_site_exchange_rate: true`, it will return pricing - * based on the current exchange rate. If the flag is set to false, it will return all of the - * defined prices for each currency. + * either the numeric id or the `handle:gold` syntax. If the price point is set to + * `use_site_exchange_rate: true`, it will return pricing based on the current exchange rate. If + * the flag is set to false, it will return all of the defined prices for each currency. * @param input ListComponentPricePointsInput object containing request parameters * @return Returns the ComponentPricePointsResponse response from the API call * @throws ApiException Represents error response from the server. @@ -382,7 +379,7 @@ private ApiCall prepareUpdateComponen * @param pricePointId Required parameter: The id or handle of the price point. When using the * handle, it must be prefixed with `handle:`. Example: `123` for an integer ID, or * `handle:example-price_point-handle` for a string handle. - * @param currencyPrices Optional parameter: Include an array of currency price data + * @param currencyPrices Optional parameter: Include an array of currency price data. * @return Returns the ComponentPricePointCurrencyOverageResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java index 52bbbf33..095b8622 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java @@ -49,9 +49,18 @@ public ComponentsController(GlobalConfiguration globalConfig) { * usage-based billing and many other pricing schemes. Note that this is different from * recurring quantity-based components, which DO NOT reset to zero at the start of every billing * period. If you want to bill for a quantity of something that does not change unless you - * change it, then you want quantity components, instead. For more information on components, - * see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + * change it, then you want quantity components, instead. #### Hybrid Pricing A `volume`, + * `tiered`, or `stairstep` metered component can combine its primary pricing with a secondary + * pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item + * instead of two. This does not apply to metered components configured for event-based billing + * (metric, meter, or formula). See [Hybrid + * Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration + * details. For more information on components, see our documentation + * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If + * you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` + * returns `422`. * @param productFamilyId Required parameter: Either the product family's id or its handle * prefixed with `handle:` * @param body Optional parameter: @@ -104,7 +113,7 @@ private ApiCall prepareCreateMeteredComponentRe /** * Creates a Quantity Based component definition under the specified product family. A Quantity * Based component can then be added and “allocated” for a subscription. When defining a - * Quantity Based component, you can choose one of 2 types: #### Recurring Recurring + * Quantity Based component, you can choose one of two types: #### Recurring Recurring * quantity-based components are used to bill for the number of some unit (think monthly * software user licenses or the number of pairs of socks in a box-a-month club). This is most * commonly associated with billing for user licenses, number of users, number of employees, @@ -112,8 +121,18 @@ private ApiCall prepareCreateMeteredComponentRe * that do not recur. For example, at the time of signup, you might want to charge your customer * a one-time fee for onboarding or other services. The allocated quantity for one-time * quantity-based components immediately gets reset back to zero after the allocation is made. - * For more information on components, see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + * For more information, see [Components + * Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + * #### Hybrid Pricing A `volume`, `tiered`, or `stairstep` component can combine its primary + * pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a + * single invoice line item instead of two. See [Hybrid + * Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration + * details. For more information on components, see our documentation + * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If + * you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` + * returns `422`. * @param productFamilyId Required parameter: Either the product family's id or its handle * prefixed with `handle:` * @param body Optional parameter: @@ -168,7 +187,11 @@ private ApiCall prepareCreateQuantityBasedCompo * component can then be added and “allocated” for a subscription. On/off components are used * for any flat fee, recurring add on (think $99/month for tech support or a flat add on * shipping fee). For more information on components, see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If + * you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` + * returns `422`. * @param productFamilyId Required parameter: Either the product family's id or its handle * prefixed with `handle:` * @param body Optional parameter: @@ -224,9 +247,13 @@ private ApiCall prepareCreateOnOffComponentRequ * customers to pre-purchase units that can be used up over time on their subscription. In a * sense, they are the mirror image of metered components; while metered components charge at * the end of the period for the amount of units used, prepaid components are charged for at the - * time of purchase, and we subsequently keep track of the usage against the amount purchased. - * For more information on components, see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + * time of purchase, and usage is subsequently tracked against the amount purchased. For more + * information, see [Components + * Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If + * you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, taxable components must include a non-blank `tax_code`; sending a blank value + * results in a validation error. * @param productFamilyId Required parameter: Either the product family's id or its handle * prefixed with `handle:` * @param body Optional parameter: @@ -285,8 +312,12 @@ private ApiCall prepareCreatePrepaidUsageCompon * with the actual quantity used in computing what and how much will be billed each period for * each subscription. So, instead of reporting usage directly for each component (as you would * with metered components), the usage is derived from analysis of your events. For more - * information on components, see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + * information, see [Components + * Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). If + * you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, taxable components must include a non-blank `tax_code`; sending a blank value + * results in a validation error. * @param productFamilyId Required parameter: Either the product family's id or its handle * prefixed with `handle:` * @param body Optional parameter: @@ -422,7 +453,11 @@ private ApiCall prepareReadComponentRequest( /** * Updates a component from a specific product family. You may read the component by either the - * component's id or handle. When using the handle, it must be prefixed with `handle:`. + * component's id or handle. When using the handle, it must be prefixed with `handle:`. If you + * have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` + * returns `422`. * @param productFamilyId Required parameter: The Advanced Billing id of the product family to * which the component belongs * @param componentId Required parameter: Either the Advanced Billing id of the component or @@ -579,7 +614,10 @@ private ApiCall, ApiException> prepareListComponentsRequ /** * Updates a component. You may read the component by either the component's id or handle. When - * using the handle, it must be prefixed with `handle:`. + * using the handle, it must be prefixed with `handle:`. If you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` + * returns `422`. * @param componentId Required parameter: The id or handle of the component * @param body Optional parameter: * @return Returns the ComponentResponse response from the API call diff --git a/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java b/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java index 981dc565..a6198161 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java @@ -45,13 +45,8 @@ public CouponsController(GlobalConfiguration globalConfig) { /** * Creates a coupon under the specified product family. You can create either a flat amount - * coupon by specifying amount_in_cents, or a percentage coupon by specifying percentage You can - * restrict a coupon to only apply to specific products / components by optionally passing in - * `restricted_products` and/or `restricted_components` objects in the format: `{ - * "<product_id/component_id>": boolean_value }` Coupons can be administered in the Advanced - * Billing application or created via API. See [creating - * coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) - * for more information. See [Apply Coupons to + * coupon, by specifying `amount_in_cents`, or percentage coupon by specifying `percentage`. See + * [Apply Coupons to * Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) * for information on applying a coupon to a subscription in the Advanced Billing UI. * @param productFamilyId Required parameter: The Advanced Billing id of the product family to @@ -147,18 +142,15 @@ private ApiCall, ApiException> prepareListCouponsForProduct } /** - * Searches for a coupon by code, returning a 404 if no coupon is found. By passing a code - * parameter, the find will attempt to locate a coupon that matches that code. If you have more - * than one product family and if the coupon you are trying to find does not belong to the - * default product family in your site, then you will need to specify (either in the url or as a - * query string param) the product family id. + * Searches for a coupon by code. If you have more than one product family and if the coupon you + * are trying to find does not belong to the default product family in your site, you need to + * specify (either in the URL or as a query string param) the `product_family_id`. * @param productFamilyId Optional parameter: The Advanced Billing id of the product family to * which the coupon belongs * @param code Optional parameter: The code of the coupon - * @param currencyPrices Optional parameter: When fetching coupons, if you have defined - * multiple currencies at the site level, you can optionally pass the - * `?currency_prices=true` query param to include an array of currency price data in the - * response. + * @param currencyPrices Optional parameter: (Optional) If you have defined multiple + * currencies at the site level, you can pass `?currency_prices=true` to include an + * array of currency price data in the response. * @return Returns the CouponResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -202,21 +194,17 @@ private ApiCall prepareFindCouponRequest( } /** - * Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this - * call by the ID parameter that Advanced Billing assigns. If instead you would like to find a - * Coupon using a Coupon code, see the Coupon Find method. When fetching a coupon, if you have - * defined multiple currencies at the site level, you can optionally pass the - * `?currency_prices=true` query param to include an array of currency price data in the - * response. If the coupon is set to `use_site_exchange_rate: true`, it will return pricing - * based on the current exchange rate. If the flag is set to false, it will return all of the - * defined prices for each currency. + * Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the + * ID parameter assigned to it. If instead you would like to find a Coupon using a Coupon code, + * use the [Find Coupon]($e/Coupons/findCoupon) endpoint. If the coupon is set to + * `use_site_exchange_rate: true`, it returns pricing based on the current exchange rate. If the + * flag is set to false, it returns all of the defined prices for each currency. * @param productFamilyId Required parameter: The Advanced Billing id of the product family to * which the coupon belongs * @param couponId Required parameter: The Advanced Billing id of the coupon - * @param currencyPrices Optional parameter: When fetching coupons, if you have defined - * multiple currencies at the site level, you can optionally pass the - * `?currency_prices=true` query param to include an array of currency price data in the - * response. + * @param currencyPrices Optional parameter: (Optional) If you have defined multiple + * currencies at the site level, you can pass `?currency_prices=true` to include an + * array of currency price data in the response. * @return Returns the CouponResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -450,17 +438,13 @@ private ApiCall, ApiException> prepareReadCouponUsageRequest( /** * Verifies whether a specific coupon code is valid. This method is useful for validating coupon - * codes that are entered by a customer. If the coupon is found and is valid, the coupon will be - * returned with a 200 status code. If the coupon is invalid, the status code will be 404 and - * the response will say why it is invalid. If the coupon is valid, the status code will be 200 - * and the coupon will be returned. The following reasons for invalidity are supported: + Coupon - * not found + Coupon is invalid + Coupon expired If you have more than one product family and - * if the coupon you are validating does not belong to the first product family in your site, - * then you will need to specify the product family, either in the url or as a query string - * param. This can be done by supplying the id or the handle in the `handle:my-family` format. - * Eg. ``` + * codes that are entered by a customer. If you have more than one product family and if the + * coupon you are validating does not belong to the first product family in your site, you need + * to specify the product family, either in the URL or as a query string param. This can be done + * by supplying the id or the handle in the `handle:my-family` format. Supplying the + * `product_family_handle` in the URL: ``` * https://<subdomain>.chargify.com/product_families/handle:<product_family_handle>/coupons/validate.<format>?code=<coupon_code> - * ``` Or: ``` + * ``` Supplying the `product_family_id` as a query parameter: ``` * https://<subdomain>.chargify.com/coupons/validate.<format>?code=<coupon_code>&product_family_id=<id> * ```. * @param code Required parameter: The code of the coupon @@ -559,25 +543,20 @@ private ApiCall prepareCreateOrUpdateCoupo } /** - * Creates subcodes for an existing coupon. ## Coupon Subcodes Intro Coupon Subcodes allow you - * to create a set of unique codes that allow you to expand the use of one coupon. For example: - * Master Coupon Code: + SPRING2020 Coupon Subcodes: + SPRING90210 + DP80302 + SPRINGBALTIMORE - * Coupon subcodes can be administered in the Admin Interface or via the API. When creating a - * coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon - * subcodes are all capital letters, contain only letters and numbers, and do not have any - * spaces. Lowercase letters will be capitalized before the subcode is created. ## Coupon - * Subcodes Documentation Full documentation on how to create coupon subcodes in the Advanced - * Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). - * Additionally, for documentation on how to apply a coupon to a Subscription within the - * Advanced Billing UI, see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). - * ## Create Coupon Subcode This request allows you to create specific subcodes underneath an - * existing coupon code. *Note*: If you are using any of the allowed special characters ("%", - * "{@literal @}", "+", "-", "_", and "."), you must encode them for use in the URL. % to %25 {@literal @} to %40 + to - * %2B - to %2D _ to %5F . to %2E So, if the coupon subcode is `20%OFF`, the URL to delete this - * coupon subcode would be: - * `https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>`. + * Creates subcodes for an existing coupon. Coupon Subcodes allow you to create a set of unique + * codes that allow you to expand the use of one coupon. For example: Master Coupon Code: + + * SPRING2020 Coupon Subcodes: + SPRING90210 + DP80302 + SPRINGBALTIMORE When creating a coupon + * subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes + * are all capital letters, contain only letters and numbers, and do not have any spaces. + * Lowercase letters are capitalized before the subcode is created. Note: If you are using any + * of the allowed special characters ("%", "{@literal @}", "+", "-", "_", and "."), you must encode them + * for use in the URL. % to %25 {@literal @} to %40 + to %2B - to %2D _ to %5F . to %2E So, if the coupon + * subcode is `20%OFF`, the URL to delete this coupon subcode would be: + * `https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>`. For more information + * on coupon codes and applying coupons to subscriptions, see [Coupon + * Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes) and [Coupons + * and + * Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). * @param couponId Required parameter: The Advanced Billing id of the coupon * @param body Optional parameter: * @return Returns the CouponSubcodesResponse response from the API call diff --git a/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java b/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java index 01d24b17..1f16f4e1 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java @@ -38,26 +38,23 @@ public CustomersController(GlobalConfiguration globalConfig) { /** * Creates a new customer; can also be created alongside a new subscription. The only validation - * restriction is that you may only create one customer for a given reference value. If + * restriction is that you can only create one customer for a given reference value. If * provided, the `reference` value must be unique. It represents a unique identifier for the * customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given - * customer via a piece of shared information. Alternatively, you may choose to leave - * `reference` blank, and store Advanced Billing’s unique ID for the customer, which is in the - * `id` attribute. Full documentation on how to locate, create and edit Customers in the - * Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). ## - * Required Country Format Advanced Billing requires that you use the ISO Standard Country codes - * when formatting country attribute of the customer. Countries should be formatted as 2 - * characters. For more information, see the following wikipedia article on - * [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) ## Required State Format - * Advanced Billing requires that you use the ISO Standard State codes when formatting state - * attribute of the customer. + US States (2 characters): - * [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) + States Outside the US (2-3 - * characters): To find the correct state codes outside of the US, go to - * [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in - * the “ISO 3166-2 codes” column next to country you wish to populate. ## Locale Advanced - * Billing allows you to attribute a language/region to your customer to deliver invoices in any - * required language. For more: [Customer + * customer via a piece of shared information. Alternatively, you can choose to leave + * `reference` blank, and store the system-assigned unique ID for the customer, which is in the + * `id` attribute. For more information, see [Customer + * Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). ## + * Required Country Format Format the country attribute of the customer using the ISO Standard + * Country codes. Countries should be formatted as two characters. For more information, see + * [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). ## Required State Format + * Format the state attribute of the customer using the ISO Standard State codes. + US States + * (two characters): see [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). + States + * Outside the US (two to three characters): To find the correct state codes outside the US, go + * to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link + * in the “ISO 3166-2 codes” column next to the country you wish to populate. ## Locale You can + * attribute a language/region to the customer to deliver invoices in any required language. For + * more information, see [Customer * Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale). * @param body Optional parameter: * @return Returns the CustomerResponse response from the API call @@ -317,7 +314,11 @@ private ApiCall prepareReadCustomerByReferenceRe } /** - * Lists all subscriptions that belong to a customer. + * Lists all subscriptions that belong to a customer. If you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, subscriptions no longer require an associated product. For subscriptions without an + * associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are + * returned as 'null'. * @param customerId Required parameter: The Chargify id of the customer * @return Returns the List of SubscriptionResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java b/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java index ea427e59..c86f64a2 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java @@ -153,8 +153,8 @@ private ApiCall prepareListSegmentsForPriceP } /** - * Updates a single segment for a component with a segmented metric. It allows you to update the - * pricing for the segment. You may specify component and/or price point by using either the + * Updates a single segment for a component with a segmented metric. You can also update the + * pricing for the segment. You can specify component and/or price point by using either the * numeric ID or the `handle:gold` syntax. * @param componentId Required parameter: ID or Handle of the Component * @param pricePointId Required parameter: ID or Handle of the Price Point belonging to the diff --git a/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java b/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java index d999419f..57045134 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java @@ -36,32 +36,38 @@ public EventsController(GlobalConfiguration globalConfig) { } /** - * Lists events for a site. ## Events Intro Advanced Billing Events include various activity - * that happens around a Site. This information is **especially** useful to track down issues - * that arise when subscriptions are not created due to errors. Within the Advanced Billing UI, - * "Events" are referred to as "Site Activity". Full documentation on how to view Events / Site - * Activity in the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). ## List - * Events for a Site This method will retrieve a list of events for a site. Use query string - * filters to narrow down results. You may use the `key` filter as part of your query string to - * narrow down results. ### Legacy Filters The following keys are no longer supported. + + * Lists events for a site. Events include various activity that happens around a Site. This + * information is **especially** useful to track down issues that arise when subscriptions are + * not created due to errors. Within the UI, Events are referred to as Site Activity. For more + * information, see [Site + * Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). Use + * query string filters to narrow down results. You can use the `filter` parameter to filter by + * event key. ### Legacy Filters The following keys are no longer supported. + * `payment_failure_recreated` + `payment_success_recreated` + `renewal_failure_recreated` + * `renewal_success_recreated` + `zferral_revenue_post_failure` - (Specific to the deprecated * Zferral integration) + `zferral_revenue_post_success` - (Specific to the deprecated Zferral - * integration) ## Event Key The event type is identified by the key property. You can check - * supported keys [here]($m/Event%20Key). ## Event Specific Data Different event types may - * include additional data in `event_specific_data` property. While some events share the same - * schema for `event_specific_data`, others may not include it at all. For precise mappings from - * key to event_specific_data, refer to [Event]($m/Event). ### Example Here’s an example event - * for the `subscription_product_change` event: ``` { "event": { "id": 351, "key": - * "subscription_product_change", "message": "Product changed on Marky Mark's subscription from - * 'Basic' to 'Pro'", "subscription_id": 205, "event_specific_data": { "new_product_id": 3, - * "previous_product_id": 2 }, "created_at": "2012-01-30T10:43:31-05:00" } } ``` Here’s an - * example event for the `subscription_state_change` event: ``` { "event": { "id": 353, "key": - * "subscription_state_change", "message": "State changed on Marky Mark's subscription to Pro - * from trialing to active", "subscription_id": 205, "event_specific_data": { - * "new_subscription_state": "active", "previous_subscription_state": "trialing" }, - * "created_at": "2012-01-30T10:43:33-05:00" } } ```. + * integration) ## Event Key The event type is identified by the key property. See [Event + * Key]($m/Event%20Key) for a complete list of supported keys. ## Event Specific Data Different + * event types may include additional data in `event_specific_data` property. While some events + * share the same schema for `event_specific_data`, others may not include it at all. For + * precise mappings from key to event_specific_data, refer to [Event]($m/Event). ### Example + * Here’s an example event for the `subscription_product_change` event: ``` { "event": { "id": + * 351, "key": "subscription_product_change", "message": "Product changed on Mark Alan's + * subscription from 'Basic' to 'Pro'", "subscription_id": 205, "event_specific_data": { + * "new_product_id": 3, "previous_product_id": 2 }, "created_at": "2012-01-30T10:43:31-05:00" } + * } ``` Here’s an example event for the `subscription_state_change` event: ``` { "event": { + * "id": 353, "key": "subscription_state_change", "message": "State changed on Mark Alan's + * subscription to Pro from trialing to active", "subscription_id": 205, "event_specific_data": + * { "new_subscription_state": "active", "previous_subscription_state": "trialing" }, + * "created_at": "2012-01-30T10:43:33-05:00" } } ``` ## Enhanced Catalog Experience If you’re + * using the [enhanced Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), + * you’ll see updated naming in webhook events and messages. Event name changes: - + * subscription_product_change → subscription_plan_change - component_allocation_change → + * allocation_change - component_billing_date_change → product_billing_date_change Message + * updates: - “Plan changed on Subscription from previous plan to new plan” - “Successful + * payment for allocation changes to Product on Subscription” - “Failed payment for allocation + * changes to Product on Subscription”. * @param input ListEventsInput object containing request parameters * @return Returns the List of EventResponse response from the API call * @throws ApiException Represents error response from the server. @@ -120,10 +126,18 @@ private ApiCall, ApiException> prepareListEventsRequest( /** * Lists events for a subscription. ## Event Key The event type is identified by the key - * property. You can check supported keys [here]($m/Event%20Key). ## Event Specific Data - * Different event types may include additional data in `event_specific_data` property. While - * some events share the same schema for `event_specific_data`, others may not include it at - * all. For precise mappings from key to event_specific_data, refer to [Event]($m/Event). + * property. See [Event Key]($m/Event%20Key) for a complete list of supported keys. ## Event + * Specific Data Different event types may include additional data in `event_specific_data` + * property. While some events share the same schema for `event_specific_data`, others may not + * include it at all. For precise mappings from key to event_specific_data, refer to + * [Event]($m/Event). ## Enhanced Catalog Experience If you’re using the [enhanced Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), + * you’ll see updated naming in webhook events and messages. Event name changes: - + * subscription_product_change → subscription_plan_change - component_allocation_change → + * allocation_change - component_billing_date_change → product_billing_date_change Message + * updates: - “Successful payment for allocation changes to Product on Subscription” - “Failed + * payment for allocation changes to Product on Subscription” - “Plan changed on Subscription + * from previous plan to new plan”. * @param input ListSubscriptionEventsInput object containing request parameters * @return Returns the List of EventResponse response from the API call * @throws ApiException Represents error response from the server. @@ -173,7 +187,14 @@ private ApiCall, ApiException> prepareListSubscriptionEvents } /** - * Returns the total count of events for a given site. + * Returns the total count of events for a given site. If you’re using the [enhanced Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), + * you’ll see updated naming in webhook events and messages. Event name changes: - + * subscription_product_change → subscription_plan_change - component_allocation_change → + * allocation_change - component_billing_date_change → product_billing_date_change Message + * updates: - “Successful payment for allocation changes to Product on Subscription” - “Failed + * payment for allocation changes to Product on Subscription” - “Plan changed on Subscription + * from previous plan to new plan”. * @param input ReadEventsCountInput object containing request parameters * @return Returns the CountResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java b/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java index dc892b21..46f534d2 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java @@ -79,9 +79,9 @@ private ApiCall prepareReadSiteStatsRequest() { * @deprecated * * @param atTime Optional parameter: submit a timestamp in ISO8601 format to request MRR for a - * historic time + * historic time. * @param subscriptionId Optional parameter: submit the id of a subscription in order to limit - * results + * results. * @return Returns the MRRResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -180,8 +180,7 @@ private ApiCall prepareListMrrMovementsRequest( } /** - * This endpoint returns your site's current MRR, including plan and usage breakouts split per - * subscription. + * Lists your site's current MRR, including plan and usage breakouts split per subscription. * @deprecated * * @param input ListMrrPerSubscriptionInput object containing request parameters diff --git a/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java b/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java index c860b31f..615a28fb 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java @@ -34,6 +34,7 @@ import com.maxio.advancedbilling.models.RecordPaymentResponse; import com.maxio.advancedbilling.models.RefundInvoiceRequest; import com.maxio.advancedbilling.models.SendInvoiceRequest; +import com.maxio.advancedbilling.models.UpdateInvoiceRequest; import com.maxio.advancedbilling.models.VoidInvoiceRequest; import io.apimatic.core.ApiCall; import io.apimatic.core.ErrorCase; @@ -55,7 +56,7 @@ public InvoicesController(GlobalConfiguration globalConfig) { } /** - * Refund an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated + * Refunds an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated * Invoice A refund less than the total of a consolidated invoice will be split across its * segments. For a $50.00 refund on a $100.00 consolidated invoice with one $60.00 segment and * one $40.00 segment, the refunded amount will be applied as 50% of each ($30.00 and $20.00, @@ -107,10 +108,10 @@ private ApiCall prepareRefundInvoiceRequest( } /** - * By default, invoices returned on the index will only include totals, not detailed breakdowns - * for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. - * To include breakdowns, pass the specific field as a key in the query with a value set to - * `true`. + * Lists invoices for a site. By default, invoices returned on the index will only include + * totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, + * `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as + * a key in the query with a value set to `true`. * @param input ListInvoicesInput object containing request parameters * @return Returns the ListInvoicesResponse response from the API call * @throws ApiException Represents error response from the server. @@ -191,9 +192,9 @@ private ApiCall prepareListInvoicesRequest( } /** - * Use this endpoint to retrieve the details for an invoice. ## PDF Invoice retrieval Individual - * PDF Invoices can be retrieved by using the "Accept" header application/pdf or appending .pdf - * as the format portion of the URL: ```curl -u <api_key>:x -H Accept:application/pdf -H + * Returns the details for an invoice. ## PDF Invoice retrieval Individual PDF Invoices can be + * retrieved by using the "Accept" header application/pdf or appending .pdf as the format + * portion of the URL: ```curl -u <api_key>:x -H Accept:application/pdf -H * https://acme.chargify.com/invoices/inv_8gd8tdhtd3hgr.pdf > output_file.pdf URL: * `https://<subdomain>.chargify.com/invoices/<uid>.<format>` Method: GET Required parameters: * `uid` Response: A single Invoice. ```. @@ -234,10 +235,10 @@ private ApiCall prepareReadInvoiceRequest( } /** - * This endpoint returns a list of invoice events. Each event contains event "data" (such as an - * applied payment) as well as a snapshot of the `invoice` at the time of event completion. - * Exposed event types are: + issue_invoice + apply_credit_note + apply_payment + refund_invoice - * + void_invoice + void_remainder + backport_invoice + change_invoice_status + + * Lists invoice events for a site. Each event contains event "data" (such as an applied + * payment) as well as a snapshot of the `invoice` at the time of event completion. Exposed + * event types are: + issue_invoice + apply_credit_note + apply_payment + refund_invoice + + * void_invoice + void_remainder + backport_invoice + change_invoice_status + * change_invoice_collection_method + remove_payment + failed_payment + apply_debit_note + * create_debit_note + change_chargeback_status Invoice events are returned in ascending order. * If both a `since_date` and `since_id` are provided in request parameters, the `since_date` @@ -292,7 +293,8 @@ private ApiCall prepareListInvoiceEvent /** * Applies a payment of a given type against a specific invoice. If you would like to apply a - * payment across multiple invoices, you can use the Bulk Payment endpoint. + * payment across multiple invoices, you can use the [Record Payment for Multiple + * Invoices]($e/Invoices/recordPaymentForMultipleInvoices) endpoint. * @param uid Required parameter: The unique identifier for the invoice, this does not refer * to the public facing invoice number. * @param body Optional parameter: @@ -340,14 +342,10 @@ private ApiCall prepareRecordPaymentForInvoiceRequest( } /** - * This API call should be used when you want to record an external payment against multiple - * invoices. To apply a payment to multiple invoices, at minimum, specify the `amount` and - * `applications` (i.e., `invoice_uid` and `amount`) details. ``` { "payment": { "memo": "to pay - * the bills", "details": "check number 8675309", "method": "check", "amount": "250.00", - * "applications": [ { "invoice_uid": "inv_8gk5bwkct3gqt", "amount": "100.00" }, { - * "invoice_uid": "inv_7bc6bwkct3lyt", "amount": "150.00" } ] } } ``` Note that the invoice - * payment amounts must be greater than 0. Total amount must be greater or equal to invoices - * payment amount sum. + * Records an external payment against multiple invoices. To apply a payment to multiple + * invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and + * `amount`) details. Note that the invoice payment amounts must be greater than 0. Total amount + * must be greater or equal to invoices payment amount sum. * @param body Optional parameter: * @return Returns the MultiInvoicePaymentResponse response from the API call * @throws ApiException Represents error response from the server. @@ -389,10 +387,10 @@ private ApiCall prepareRecordPaymentF } /** - * Credit Notes are like inverse invoices. They reduce the amount a customer owes. By default, - * the credit notes returned by this endpoint will exclude the arrays of `line_items`, - * `discounts`, `taxes`, `applications`, or `refunds`. To include these arrays, pass the - * specific field as a key in the query with a value set to `true`. + * Lists credit notes for a site. Credit Notes are like inverse invoices. They reduce the amount + * a customer owes. By default, the credit notes returned by this endpoint will exclude the + * arrays of `line_items`, `discounts`, `taxes`, `applications`, or `refunds`. To include these + * arrays, pass the specific field as a key in the query with a value set to `true`. * @param input ListCreditNotesInput object containing request parameters * @return Returns the ListCreditNotesResponse response from the API call * @throws ApiException Represents error response from the server. @@ -443,7 +441,7 @@ private ApiCall prepareListCreditNotesReq } /** - * Use this endpoint to retrieve the details for a credit note. + * Returns the details for a credit note. * @param uid Required parameter: The unique identifier of the credit note * @return Returns the CreditNote response from the API call * @throws ApiException Represents error response from the server. @@ -480,9 +478,9 @@ private ApiCall prepareReadCreditNoteRequest( } /** - * Record an external payment made against a subscription that will pay partially or in full one - * or more invoices. Payment will be applied starting with the oldest open invoice and then next - * oldest, and so on until the amount of the payment is fully consumed. Excess payment will + * Records an external payment made against a subscription that will pay partially or in full + * one or more invoices. Payment will be applied starting with the oldest open invoice and then + * next oldest, and so on until the amount of the payment is fully consumed. Excess payment will * result in the creation of a prepayment on the Invoice Account. Only ungrouped or primary * subscriptions may be paid using the "bulk" payment request. * @param subscriptionId Required parameter: The Chargify id of the subscription. @@ -531,18 +529,17 @@ private ApiCall prepareRecordPaymentForSubs } /** - * This endpoint allows you to reopen any invoice with the "canceled" status. Invoices enter - * "canceled" status if they were open at the time the subscription was canceled (whether - * through dunning or an intentional cancellation). Invoices with "canceled" status are no - * longer considered to be due. Once reopened, they are considered due for payment. Payment may - * then be captured in one of the following ways: - Reactivating the subscription, which will - * capture all open invoices (See note below about automatic reopening of invoices.) - Recording - * a payment directly against the invoice A note about reactivations: any canceled invoices from - * the most recent active period are automatically opened as a part of the reactivation process. - * Reactivating via this endpoint prior to reactivation is only necessary when you wish to - * capture older invoices from previous periods during the reactivation. ### Reopening - * Consolidated Invoices When reopening a consolidated invoice, all of its canceled segments - * will also be reopened. + * Reopens any invoice with the "canceled" status. Invoices enter "canceled" status if they were + * open at the time the subscription was canceled (whether through dunning or an intentional + * cancellation). Invoices with "canceled" status are no longer considered to be due. Once + * reopened, they are considered due for payment. Payment may then be captured in one of the + * following ways: - Reactivating the subscription, which will capture all open invoices (See + * note below about automatic reopening of invoices.) - Recording a payment directly against the + * invoice A note about reactivations: any canceled invoices from the most recent active period + * are automatically opened as a part of the reactivation process. Reactivating via this + * endpoint prior to reactivation is only necessary when you wish to capture older invoices from + * previous periods during the reactivation. ### Reopening Consolidated Invoices When reopening + * a consolidated invoice, all of its canceled segments will also be reopened. * @param uid Required parameter: The unique identifier for the invoice, this does not refer * to the public facing invoice number. * @return Returns the Invoice response from the API call @@ -586,9 +583,8 @@ private ApiCall prepareReopenInvoiceRequest( } /** - * This endpoint allows you to void any invoice with the "open" or "canceled" status. It will - * also allow voiding of an invoice with the "pending" status if it is not a consolidated - * invoice. + * Voids any invoice with the "open" or "canceled" status. It will also allow voiding of an + * invoice with the "pending" status if it is not a consolidated invoice. * @param uid Required parameter: The unique identifier for the invoice, this does not refer * to the public facing invoice number. * @param body Optional parameter: @@ -639,8 +635,9 @@ private ApiCall prepareVoidInvoiceRequest( } /** - * Invoice segments returned on the index will only include totals, not detailed breakdowns for - * `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. + * Lists segments for a consolidated invoice. Invoice segments returned on the index will only + * include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, + * `payments`, or `custom_fields`. * @param input ListConsolidatedInvoiceSegmentsInput object containing request parameters * @return Returns the ConsolidatedInvoice response from the API call * @throws ApiException Represents error response from the server. @@ -683,31 +680,31 @@ private ApiCall prepareListConsolidatedInvoic } /** - * This endpoint will allow you to create an ad hoc invoice. ### Basic Behavior You can create a - * basic invoice by sending an array of line items to this endpoint. Each line item, at a - * minimum, must include a title, a quantity and a unit price. Example: ```json { "invoice": { - * "line_items": [ { "title": "A Product", "quantity": 12, "unit_price": "150.00" } ] } } ``` - * ### Catalog items Instead of creating custom products like in above example, You can pass - * existing items like products, components. ```json { "invoice": { "line_items": [ { - * "product_id": "handle:gold-product", "quantity": 2, } ] } } ``` The price for each line item - * will be calculated as well as a total due amount for the invoice. Multiple line items can be - * sent. ### Line item types When defining a line item, You can choose one of 3 types for a line - * item: #### Custom item As shown in the basic behavior example, You can pass `title` and - * `unit_price` for custom item. #### Product id Product handle (with handle: prefix) or id from - * the scope of current subscription's site can be provided with `product_id`. By default - * `unit_price` is taken from product's default price point, but can be overwritten by passing - * `unit_price` or `product_price_point_id`. If `product_id` is used, following fields cannot be - * used: `title`, `component_id`. #### Component id Component handle (with handle: prefix) or id - * from the scope of current subscription's site can be provided with `component_id`. If - * `component_id` is used, following fields cannot be used: `title`, `product_id`. By default - * `unit_price` is taken from product's default price point, but can be overwritten by passing - * `unit_price` or `price_point_id`. At this moment price points are supported only for quantity - * based, on/off and metered components. For prepaid and event based billing components - * `unit_price` is required. ### Coupons When creating ad hoc invoice, new discounts can be - * applied in following way: ```json { "invoice": { "line_items": [ { "product_id": - * "handle:gold-product", "quantity": 1 } ], "coupons": [ { "code": "COUPONCODE", "percentage": - * 50.0 } ] } } ``` If You want to use existing coupon for discount creation, only `code` and - * optional `product_family_id` is needed ```json ... "coupons": [ { "code": "FREESETUP", + * Creates an ad hoc invoice. ### Basic Behavior You can create a basic invoice by sending an + * array of line items to this endpoint. Each line item, at a minimum, must include a title, a + * quantity and a unit price. Example: ```json { "invoice": { "line_items": [ { "title": "A + * Product", "quantity": 12, "unit_price": "150.00" } ] } } ``` ### Catalog items Instead of + * creating custom products like in above example, You can pass existing items like products, + * components. ```json { "invoice": { "line_items": [ { "product_id": "handle:gold-product", + * "quantity": 2, } ] } } ``` The price for each line item will be calculated as well as a total + * due amount for the invoice. Multiple line items can be sent. ### Line item types When + * defining a line item, You can choose one of 3 types for a line item: #### Custom item As + * shown in the basic behavior example, You can pass `title` and `unit_price` for custom item. + * #### Product id Product handle (with handle: prefix) or id from the scope of current + * subscription's site can be provided with `product_id`. By default `unit_price` is taken from + * product's default price point, but can be overwritten by passing `unit_price` or + * `product_price_point_id`. If `product_id` is used, following fields cannot be used: `title`, + * `component_id`. #### Component id Component handle (with handle: prefix) or id from the scope + * of current subscription's site can be provided with `component_id`. If `component_id` is + * used, following fields cannot be used: `title`, `product_id`. By default `unit_price` is + * taken from product's default price point, but can be overwritten by passing `unit_price` or + * `price_point_id`. At this moment price points are supported only for quantity based, on/off + * and metered components. For prepaid and event based billing components `unit_price` is + * required. ### Coupons When creating ad hoc invoice, new discounts can be applied in following + * way: ```json { "invoice": { "line_items": [ { "product_id": "handle:gold-product", + * "quantity": 1 } ], "coupons": [ { "code": "COUPONCODE", "percentage": 50.0 } ] } } ``` If You + * want to use existing coupon for discount creation, only `code` and optional + * `product_family_id` is needed ```json ... "coupons": [ { "code": "FREESETUP", * "product_family_id": 1 } ] ... ``` #### Using Coupon Subcodes You can also use coupon * subcodes to apply existing coupons with specific subcodes: ```json ... "coupons": [ { * "subcode": "SUB1", "product_family_id": 1 } ] ... ``` **Important:** You cannot specify both @@ -808,19 +805,150 @@ private ApiCall prepareCreateInvoiceRequest( } /** - * This endpoint allows for invoices to be programmatically delivered via email. This endpoint - * supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this - * endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind - * carbon-copy (bcc) recipients. **File Attachments**: You can attach files to invoice emails - * using `attachment_urls[]` parameter by providing URLs to the files you want to attach. When - * using attachments, the request must use `multipart/form-data` content type. Max 10 files, - * 10MB per file. If no recipient email addresses are specified in the request, then the - * subscription's default email configuration will be used. For example, if `recipient_emails` - * is left blank, then the invoice will be delivered to the subscription's customer email - * address. On success, a 204 no-content response will be returned. The response does not - * indicate that email(s) have been delivered, but instead indicates that emails have been - * successfully queued for delivery. If _any_ invalid or malformed email address is found in the - * request body, the entire request will be rejected and a 422 response will be returned. + * Updates an ad hoc invoice while it is in the `draft` state. **Important: only invoices with + * the `adhoc` role and `draft` status can be updated.** Any other invoice — issued, or with a + * different role (e.g. `renewal`, `signup`) — cannot be updated through this endpoint and the + * request returns a `422` error. If the invoice does not belong to the provided subscription, a + * `404` error is returned. Only the attributes submitted in the request are changed — omitted + * attributes keep their current values. ### Line Items The `line_items` array describes changes + * to the invoice's line items. Line items not referenced in the array remain unchanged. #### + * Adding a line item A line item without a `uid` is added to the invoice. The same line item + * types and options as on invoice creation are supported (custom items, `product_id`, + * `component_id`, price points, period date ranges, taxes). #### Updating a line item A line + * item with the `uid` of an existing line item updates that line item with the submitted + * attributes. Amounts and taxes are recalculated. #### Removing a line item A line item with a + * `uid` and `"_destroy": true` is removed from the invoice. Other line items remain unchanged. + * Referencing a `uid` which does not exist on the invoice returns a `422` error. ### Coupons + * When the `coupons` key is present, the submitted coupons replace all discounts currently + * applied to the invoice. Send an empty array to remove all discounts. Coupon options are the + * same as on invoice creation. ### Invoice Options #### Issue Date and Net Terms The + * `issue_date` parameter can be sent to change the invoice's issue date. Only today or dates in + * the past are accepted. The date is interpreted and validated in your site's time zone, using + * the `YYYY-MM-DD` format. The `net_terms` parameter indicates the number of days after the + * issue date on which the invoice is due. The due date is recalculated whenever the issue date + * or net terms change. #### Addresses The seller, shipping and billing addresses can be sent to + * replace the addresses on the invoice. Each address requires to send a `first_name` at a + * minimum in order to work. Taxes are recalculated after an address change. #### Memo and + * Payment Instructions A custom memo can be sent with the `memo` parameter. Likewise, custom + * payment instructions can be sent with the `payment_instructions` parameter. + * @param subscriptionId Required parameter: The Chargify id of the subscription. + * @param uid Required parameter: The unique identifier for the invoice, this does not refer + * to the public facing invoice number. + * @param body Optional parameter: + * @return Returns the InvoiceResponse response from the API call + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public InvoiceResponse updateInvoice( + final int subscriptionId, + final String uid, + final UpdateInvoiceRequest body) throws ApiException, IOException { + return prepareUpdateInvoiceRequest(subscriptionId, uid, body).execute(); + } + + /** + * Builds the ApiCall object for updateInvoice. + */ + private ApiCall prepareUpdateInvoiceRequest( + final int subscriptionId, + final String uid, + final UpdateInvoiceRequest body) { + return new ApiCall.Builder() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.PRODUCTION.value()) + .path("/subscriptions/{subscription_id}/invoices/{uid}.json") + .bodyParam(param -> param.value(body).isRequired(false)) + .bodySerializer(() -> ApiHelper.serialize(body)) + .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) + .shouldEncode(true)) + .templateParam(param -> param.key("uid").value(uid) + .shouldEncode(true)) + .headerParam(param -> param.key("Content-Type") + .value("application/json").isRequired(false)) + .headerParam(param -> param.key("accept").value("application/json")) + .withAuth(auth -> auth + .add("BasicAuth")) + .arraySerializationFormat(ArraySerializationFormat.CSV) + .httpMethod(HttpMethod.PUT)) + .responseHandler(responseHandler -> responseHandler + .deserializer( + response -> ApiHelper.deserialize(response, InvoiceResponse.class)) + .nullify404(false) + .localErrorCase("404", + ErrorCase.setTemplate("Not Found:'{$response.body}'", + (reason, context) -> new ErrorListResponseException(reason, context))) + .localErrorCase("422", + ErrorCase.setTemplate("HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.", + (reason, context) -> new ErrorArrayMapResponseException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Deletes an ad hoc invoice while it is in the `draft` state. **Important: only invoices with + * the `adhoc` role and `draft` status can be deleted.** Any other invoice — issued, or with a + * different role (e.g. `renewal`, `signup`) — cannot be deleted through this endpoint and the + * request returns a `422` error. Issued invoices should be voided instead. If the invoice does + * not belong to the provided subscription, a `404` error is returned. A successful deletion + * returns a `204 No Content` response and the invoice is permanently removed. + * @param subscriptionId Required parameter: The Chargify id of the subscription. + * @param uid Required parameter: The unique identifier for the invoice, this does not refer + * to the public facing invoice number. + * @throws ApiException Represents error response from the server. + * @throws IOException Signals that an I/O exception of some sort has occurred. + */ + public void deleteInvoice( + final int subscriptionId, + final String uid) throws ApiException, IOException { + prepareDeleteInvoiceRequest(subscriptionId, uid).execute(); + } + + /** + * Builds the ApiCall object for deleteInvoice. + */ + private ApiCall prepareDeleteInvoiceRequest( + final int subscriptionId, + final String uid) { + return new ApiCall.Builder() + .globalConfig(getGlobalConfiguration()) + .requestBuilder(requestBuilder -> requestBuilder + .server(Server.PRODUCTION.value()) + .path("/subscriptions/{subscription_id}/invoices/{uid}.json") + .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) + .shouldEncode(true)) + .templateParam(param -> param.key("uid").value(uid) + .shouldEncode(true)) + .withAuth(auth -> auth + .add("BasicAuth")) + .arraySerializationFormat(ArraySerializationFormat.CSV) + .httpMethod(HttpMethod.DELETE)) + .responseHandler(responseHandler -> responseHandler + .nullify404(false) + .localErrorCase("404", + ErrorCase.setTemplate("Not Found:'{$response.body}'", + (reason, context) -> new ErrorListResponseException(reason, context))) + .localErrorCase("422", + ErrorCase.setTemplate("HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.", + (reason, context) -> new ErrorListResponseException(reason, context))) + .globalErrorCase(GLOBAL_ERROR_CASES)) + .build(); + } + + /** + * Sends an invoice to the customer via email. This endpoint supports the delivery of both + * ad-hoc and automatically generated invoices. Additionally, this endpoint supports email + * delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) + * recipients. **File Attachments**: You can attach files to invoice emails using + * `attachment_urls[]` parameter by providing URLs to the files you want to attach. When using + * attachments, the request must use `multipart/form-data` content type. Max 10 files, 10MB per + * file. If no recipient email addresses are specified in the request, then the subscription's + * default email configuration will be used. For example, if `recipient_emails` is left blank, + * then the invoice will be delivered to the subscription's customer email address. On success, + * a 204 no-content response will be returned. The response does not indicate that email(s) have + * been delivered, but instead indicates that emails have been successfully queued for delivery. + * If _any_ invalid or malformed email address is found in the request body, the entire request + * will be rejected and a 422 response will be returned. * @param uid Required parameter: The unique identifier for the invoice, this does not refer * to the public facing invoice number. * @param body Optional parameter: @@ -864,11 +992,11 @@ private ApiCall prepareSendInvoiceRequest( } /** - * Customer information may change after an invoice is issued, which may lead to a mismatch - * between customer information that is present on an open invoice and actual customer - * information. This endpoint allows you to preview these differences, if any. The endpoint - * doesn't accept a request body. Customer information differences are calculated on the - * application side. + * Previews the effect of customer information changes on an open invoice. Customer information + * may change after an invoice is issued, which may lead to a mismatch between customer + * information that is present on an open invoice and actual customer information. This endpoint + * allows you to preview these differences, if any. The endpoint doesn't accept a request body. + * Customer information differences are calculated on the application side. * @param uid Required parameter: The unique identifier for the invoice, this does not refer * to the public facing invoice number. * @return Returns the CustomerChangesPreviewResponse response from the API call @@ -912,8 +1040,8 @@ private ApiCall preparePreviewCust } /** - * This endpoint updates customer information on an open invoice and returns the updated - * invoice. If you would like to preview changes that will be applied, use the + * Updates customer information on an open invoice and returns the updated invoice. If you would + * like to preview changes that will be applied, use the * `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't * accept a request body. Customer information differences are calculated on the application * side. @@ -960,26 +1088,25 @@ private ApiCall prepareUpdateCustomerInformationRequest( } /** - * This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For - * example, you can issue an invoice that was created when allocating new quantity on a - * component and using "accrue charges" option. You cannot issue a pending child invoice that - * was created for a member subscription in a group. For Remittance subscriptions, the invoice - * will go into "open" status and payment won't be attempted. The value for `on_failed_payment` - * would be rejected if sent. Any prepayments or service credits that exist on the subscription - * will be automatically applied. Additionally, if the setting is enabled, an email will be sent - * for the issued invoice. For Automatic subscriptions, prepayments and service credits will - * apply to the invoice before payment is attempted. On successful payment, the invoice will go - * into "paid" status and email will be sent to the customer (if setting applies). When payment - * fails, the next event depends on the `on_failed_payment` value: - `leave_open_invoice` - - * prepayments and credits applied to invoice; invoice status set to "open"; email sent to the - * customer for the issued invoice (if setting applies); payment failure recorded in the invoice - * history. This is the default option. - `rollback_to_pending` - prepayments and credits not - * applied; invoice remains in "pending" status; no email sent to the customer; payment failure - * recorded in the invoice history. - `initiate_dunning` - prepayments and credits applied to - * the invoice; invoice status set to "open"; email sent to the customer for the issued invoice - * (if setting applies); payment failure recorded in the invoice history; subscription will most - * likely go into "past_due" or "canceled" state (depending upon net terms and dunning - * settings). + * Issues an invoice that is in "pending" or "draft" status. For example, you can issue an + * invoice that was created when allocating new quantity on a component and using "accrue + * charges" option. You cannot issue a pending child invoice that was created for a member + * subscription in a group. For Remittance subscriptions, the invoice will go into "open" status + * and payment won't be attempted. The value for `on_failed_payment` would be rejected if sent. + * Any prepayments or service credits that exist on the subscription will be automatically + * applied. Additionally, if the setting is enabled, an email will be sent for the issued + * invoice. For Automatic subscriptions, prepayments and service credits will apply to the + * invoice before payment is attempted. On successful payment, the invoice will go into "paid" + * status and email will be sent to the customer (if setting applies). When payment fails, the + * next event depends on the `on_failed_payment` value: - `leave_open_invoice` - prepayments and + * credits applied to invoice; invoice status set to "open"; email sent to the customer for the + * issued invoice (if setting applies); payment failure recorded in the invoice history. This is + * the default option. - `rollback_to_pending` - prepayments and credits not applied; invoice + * remains in "pending" status; no email sent to the customer; payment failure recorded in the + * invoice history. - `initiate_dunning` - prepayments and credits applied to the invoice; + * invoice status set to "open"; email sent to the customer for the issued invoice (if setting + * applies); payment failure recorded in the invoice history; subscription will most likely go + * into "past_due" or "canceled" state (depending upon net terms and dunning settings). * @param uid Required parameter: The unique identifier for the invoice, this does not refer * to the public facing invoice number. * @param body Optional parameter: diff --git a/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java b/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java index 3a346028..22dd815a 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java @@ -36,15 +36,15 @@ public OffersController(GlobalConfiguration globalConfig) { } /** - * Creates an offer within your Advanced Billing site. ## Documentation Offers allow you to - * package complicated combinations of products, components and coupons into a convenient - * package which can then be subscribed to just like products. Once an offer is defined it can - * be used as an alternative to the product when creating subscriptions. Full documentation on - * how to use offers in the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview). ## Using - * a Product Price Point You can optionally pass in a `product_price_point_id` that corresponds - * with the `product_id` and the offer will use that price point. If a `product_price_point_id` - * is not passed in, the product's default price point will be used. + * Creates an offer within your site. Offers allow you to package complicated combinations of + * products, components and coupons into a convenient package which can then be subscribed to + * just like products. Once an offer is defined it can be used as an alternative to the product + * when creating subscriptions. For more information, see + * [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview) in the + * product documentation. ## Using a Product Price Point You can optionally pass in a + * `product_price_point_id` that corresponds with the `product_id` and the offer will use that + * price point. If a `product_price_point_id` is not passed in, the product's default price + * point will be used. * @param body Optional parameter: * @return Returns the OfferResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java b/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java index b85bbb39..814fd606 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java @@ -137,8 +137,8 @@ private ApiCall prepareCreatePaymentProfil } /** - * Returns all active payment profiles for a site, or for one customer within a site. If no - * payment profiles are found, this endpoint will return an empty array, not a 404. + * Lists all active payment profiles for a site, or for one customer within a site. If no + * payment profiles are found, this endpoint returns an empty array. * @param input ListPaymentProfilesInput object containing request parameters * @return Returns the List of PaymentProfileResponse response from the API call * @throws ApiException Represents error response from the server. @@ -302,7 +302,7 @@ private ApiCall prepareUpdatePaymentProfil /** * Deletes an unused payment profile. If the payment profile is in use by one or more - * subscriptions or groups, a 422 and error message will be returned. + * subscriptions or groups, an error message is returned. * @param paymentProfileId Required parameter: The Chargify id of the payment profile * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -341,13 +341,13 @@ private ApiCall prepareDeleteUnusedPaymentProfileRequest( } /** - * Deletes a payment profile belonging to the customer on the subscription. + If the customer - * has multiple subscriptions, the payment profile will be removed from all of them. + If you - * delete the default payment profile for a subscription, you will need to specify another - * payment profile to be the default through the api, or either prompt the user to enter a card - * in the billing portal or on the self-service page, or visit the Payment Details tab on the - * subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment - * Method” link, (depending on whether there are other cards present). + * Deletes a payment profile belonging to the customer on the subscription. If the customer has + * multiple subscriptions, the payment profile is removed from all of them. If you delete the + * default payment profile for a subscription, you need to specify another payment profile to be + * the default through the API, or either prompt the user to enter a card in the billing portal + * or on the self-service page, or visit the Payment Details tab on the subscription in the + * Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending + * on whether there are other cards present). * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param paymentProfileId Required parameter: The Chargify id of the payment profile * @throws ApiException Represents error response from the server. @@ -527,11 +527,11 @@ private ApiCall prepareChangeSubscriptionD } /** - * This will change the default payment profile on the subscription group to the existing - * payment profile with the id specified. You must elect to change the existing payment profile - * to a new payment profile ID in order to receive a satisfactory response from this endpoint. - * The new payment profile must belong to the subscription group's customer, otherwise you will - * receive an error. + * Changes the default payment profile on the subscription group to the existing payment profile + * with the specified ID. You must elect to change the existing payment profile to a new payment + * profile ID in order to receive a satisfactory response from this endpoint. The new payment + * profile must belong to the subscription group's customer, otherwise you will receive an + * error. * @param uid Required parameter: The uid of the subscription group * @param paymentProfileId Required parameter: The Chargify id of the payment profile * @return Returns the PaymentProfileResponse response from the API call @@ -577,10 +577,11 @@ private ApiCall prepareChangeSubscriptionG } /** - * One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or - * Stripe only) data for a customer. You can use One Time Tokens while creating a subscription - * or payment profile instead of passing all bank account or credit card data directly to a - * given API endpoint. To obtain a One Time Token you have to use + * Returns the one-time token data, including credit card or ACH details, associated with the + * provided token ID. One Time Tokens aka Advanced Billing Tokens house the credit card or ACH + * (Authorize.Net or Stripe only) data for a customer. You can use One Time Tokens while + * creating a subscription or payment profile instead of passing all bank account or credit card + * data directly to a given API endpoint. To obtain a One Time Token you have to use * [Chargify.js](https://docs.maxio.com/hc/en-us/articles/38163190843789-Chargify-js-Overview#chargify-js-overview-0-0). * @param chargifyToken Required parameter: Advanced Billing Token * @return Returns the GetOneTimeTokenRequest response from the API call @@ -621,17 +622,16 @@ private ApiCall prepareReadOneTimeTokenReq } /** - * You can send a "request payment update" email to the customer associated with the - * subscription. If you attempt to send a "request payment update" email more than five times - * within a 30-minute period, you will receive a `422` response with an error message in the - * body. This error message will indicate that the request has been rejected due to excessive - * attempts, and will provide instructions on how to resubmit the request. Additionally, if you - * attempt to send a "request payment update" email for a subscription that does not exist, you - * will receive a `404` error response. This error message will indicate that the subscription - * could not be found, and will provide instructions on how to correct the error and resubmit - * the request. These error responses are designed to prevent excessive or invalid requests, and - * to provide clear and helpful information to users who encounter errors during the request - * process. + * Sends a "request payment update" email to the customer associated with the subscription. If + * you attempt to send a "request payment update" email more than five times within a 30-minute + * period, you will receive a `422` response with an error message in the body. This error + * message will indicate that the request has been rejected due to excessive attempts, and will + * provide instructions on how to resubmit the request. Additionally, if you attempt to send a + * "request payment update" email for a subscription that does not exist, you will receive a + * `404` error response. This error message will indicate that the subscription could not be + * found, and will provide instructions on how to correct the error and resubmit the request. + * These error responses are designed to prevent excessive or invalid requests, and to provide + * clear and helpful information to users who encounter errors during the request process. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java index faed6dfa..8ad06b63 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java @@ -99,9 +99,9 @@ private ApiCall, ApiException> prepareListProductsForProdu } /** - * Creates a Product Family within your Advanced Billing site. Create a Product Family to act as - * a container for your products, components, and coupons. Full documentation on how Product - * Families operate within the Advanced Billing UI can be located + * Creates a Product Family within your site. Create a Product Family to act as a container for + * your products, components, and coupons. Full documentation on how Product Families operate + * within the Advanced Billing UI can be located * [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). * @param body Optional parameter: * @return Returns the ProductFamilyResponse response from the API call @@ -144,7 +144,7 @@ private ApiCall prepareCreateProductFamilyR } /** - * Returns a list of Product Families for a site. + * Lists Product Families for a site. * @param input ListProductFamiliesInput object containing request parameters * @return Returns the List of ProductFamilyResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java index c4d3b7ea..d9e7e4ac 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java @@ -211,12 +211,12 @@ private ApiCall prepareUpdateProductPri * @param pricePointId Required parameter: The id or handle of the price point. When using the * handle, it must be prefixed with `handle:`. Example: `123` for an integer ID, or * `handle:example-product-price-point-handle` for a string handle. - * @param currencyPrices Optional parameter: When fetching a product's price points, if you - * have defined multiple currencies at the site level, you can optionally pass the - * ?currency_prices=true query param to include an array of currency price data in the - * response. If the product price point is set to use_site_exchange_rate: true, it will - * return pricing based on the current exchange rate. If the flag is set to false, it - * will return all of the defined prices for each currency. + * @param currencyPrices Optional parameter: (Optional) If you have defined multiple + * currencies at the site level, you can pass ?currency_prices=true to include an array + * of currency price data in the response. If the product price point is set to + * use_site_exchange_rate: true, it will return pricing based on the current exchange + * rate. If the flag is set to false, it will return all of the defined prices for each + * currency. * @return Returns the ProductPricePointResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java index a190372b..d7f99334 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java @@ -36,10 +36,13 @@ public ProductsController(GlobalConfiguration globalConfig) { } /** - * Creates a product in your Advanced Billing site. See the following product documentation for - * more information: + [Products - * Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) - * + [Changing a Subscription's + * Creates a product in your site. If you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, the `auto_create_signup_page` parameter is not supported. If + * `auto_create_signup_page` is included (with any value) an error is returned. For more + * information, see: + [Products + * Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + + * [Changing a Subscription's * Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). * @param productFamilyId Required parameter: Either the product family's id or its handle * prefixed with `handle:` diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java index ca87056e..2a8a5ee4 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java @@ -42,13 +42,12 @@ public ProformaInvoicesController(GlobalConfiguration globalConfig) { } /** - * Creates a consolidated proforma invoice asynchronously. It will return a 201 with no message, - * or a 422 with any errors. To find and view the new consolidated proforma invoice, you may - * poll the subscription group listing for proforma invoices; only one consolidated proforma - * invoice may be created per group at a time. If the information becomes outdated, simply void - * the old consolidated proforma invoice and generate a new one. ## Restrictions Proforma - * invoices are only available on Relationship Invoicing sites. To create a proforma invoice, - * the subscription must not be prepaid, and must be in a live state. + * Creates a consolidated proforma invoice asynchronously. To find and view the new consolidated + * proforma invoice, you can poll the subscription group listing for proforma invoices; only one + * consolidated proforma invoice can be created per group at a time. If the information becomes + * outdated, simply void the old consolidated proforma invoice and generate a new one. ## + * Restrictions Proforma invoices are only available on Relationship Invoicing sites. To create + * a proforma invoice, the subscription must not be prepaid, and must be in a live state. * @param uid Required parameter: The uid of the subscription group * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -399,10 +398,10 @@ private ApiCall prepareVoidProformaInvoiceRequest } /** - * Returns a preview of the data that will be included on a given subscription's proforma - * invoice if one were to be generated. It will have similar line items and totals as a renewal - * preview, but the response will be presented in the format of a proforma invoice. Consequently - * it will include additional information such as the name and addresses that will appear on the + * Previews the data that will be included on a given subscription's proforma invoice if one + * were to be generated. It will have similar line items and totals as a renewal preview, but + * the response will be presented in the format of a proforma invoice. Consequently it will + * include additional information such as the name and addresses that will appear on the * proforma invoice. The preview endpoint is subject to all the same conditions as the proforma * invoice endpoint. For example, previews are only available on the Relationship Invoicing * architecture, and previews cannot be made for end-of-life subscriptions. If all the data diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java index 6dc279ec..77c936e2 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java @@ -37,15 +37,12 @@ public ReasonCodesController(GlobalConfiguration globalConfig) { } /** - * Creates a reason code for a given site. # Reason Codes Intro Reason Codes are a way to gain a - * high-level view of why your customers are cancelling the subscription to your product or - * service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing - * Portal. As your subscribers decide to cancel their subscription, learn why they decided to - * cancel. ## Reason Code Documentation Full documentation on how Reason Codes operate within - * Advanced Billing can be located under the following links. [Churn Reason - * Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes) ## - * Create Reason Code This method gives a merchant the option to create reason codes for a given - * site. + * Creates a reason code for a given site. Reason Codes are a way to gain a high-level view of + * why your customers are cancelling the subscription to your product or service. Add a set of + * churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your + * subscribers decide to cancel their subscription, learn why they decided to cancel. For more + * information, see [Churn Reason + * Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes). * @param body Optional parameter: * @return Returns the ReasonCodeResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java index 272c5ef3..1751d9db 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java @@ -33,12 +33,10 @@ public ReferralCodesController(GlobalConfiguration globalConfig) { /** * Validates whether a referral code is valid and applicable within your site. This method is - * useful for validating referral codes that are entered by a customer. ## Referrals - * Documentation Full documentation on how to use the referrals feature in the Advanced Billing - * UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referrals). ## Server - * Response If the referral code is valid the status code will be `200` and the referral code - * will be returned. If the referral code is invalid, a `404` response will be returned. + * useful for validating referral codes that are entered by a customer. For more information, + * see [Understanding + * Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Understanding-Referrals) + * in the product documentation. * @param code Required parameter: The referral code you are trying to validate * @return Returns the ReferralValidationResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java index 724aa713..76080049 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java @@ -91,12 +91,12 @@ private ApiCall, ApiException> prepareListSalesCommissionS } /** - * Returns a sales rep list with details. ## Modified Authentication Process The Sales - * Commission API differs from other Chargify API endpoints. This resource is associated with - * the seller itself. Up to now all available resources were at the level of the site, therefore - * creating the API Key per site was a sufficient solution. To share resources at the seller - * level, a new authentication method was introduced, which is user authentication. Creating an - * API Key for a user is a required step to correctly use the Sales Commission API, more details + * Lists sales reps with details. ## Modified Authentication Process The Sales Commission API + * differs from other Chargify API endpoints. This resource is associated with the seller + * itself. Up to now all available resources were at the level of the site, therefore creating + * the API Key per site was a sufficient solution. To share resources at the seller level, a new + * authentication method was introduced, which is user authentication. Creating an API Key for a + * user is a required step to correctly use the Sales Commission API, more details * [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication). * Access to the Sales Commission API endpoints is available to users with financial access, * where the seller has the Advanced Analytics component enabled. For further information on diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java b/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java index 9053aa1c..6b05e875 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java @@ -33,14 +33,14 @@ public SitesController(GlobalConfiguration globalConfig) { } /** - * Retrieves site data. Full documentation on Sites in the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). Specifically, the - * [Clearing Site + * Retrieves site data. For more information, see + * [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) in the product + * documentation. Specifically, the [Clearing Site * Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section - * is relevant to this endpoint documentation. #### Relationship invoicing enabled If the site - * has RI enabled then you will see more settings like: "customer_hierarchy_enabled": true, - * "whopays_enabled": true, "whopays_default_payer": "self" You can read more about these - * settings here: [Who Pays & Customer + * is relevant to this endpoint. #### Relationship invoicing enabled If the site has + * Relationship invoicing enabled, additional properties are returned in the response: ``` + * "customer_hierarchy_enabled": true, "whopays_enabled": true, "whopays_default_payer": "self" + * ``` For more information, see [Who Pays & Customer * Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). * @return Returns the SiteResponse response from the API call * @throws ApiException Represents error response from the server. @@ -113,7 +113,7 @@ private ApiCall prepareClearSiteRequest( } /** - * Returns public keys used for Maxio.js (formerly Chargify.js). + * Lists public keys used for Maxio.js (formerly Chargify.js). * @param input ListChargifyJsPublicKeysInput object containing request parameters * @return Returns the ListPublicKeysResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java index 476d4a5a..a63991b1 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java @@ -328,9 +328,9 @@ private ApiCall prepareAllocateComponentReques } /** - * Returns the 50 most recent Allocations, ordered by most recent first. ## On/Off Components - * When a subscription's on/off component has been toggled to on (`1`) or off (`0`), usage will - * be logged in this response. + * Lists the 50 most recent Allocations, ordered by most recent first. ## On/Off Components When + * a subscription's on/off component has been toggled to on (`1`) or off (`0`), usage will be + * logged in this response. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param componentId Required parameter: The Advanced Billing id of the component * @param page Optional parameter: Result records are organized in pages. By default, the @@ -729,8 +729,8 @@ private ApiCall prepareCreateUsageRequest( } /** - * Returns a list of usages associated with a subscription for a particular metered component. - * This will display the previously recorded components for a subscription. This endpoint is not + * Lists usages associated with a subscription for a particular metered component. This will + * display the previously recorded components for a subscription. This endpoint is not * compatible with quantity-based components. ## Since Date and Until Date Usage Note: The * `since_date` and `until_date` attributes each default to midnight on the date specified. For * example, in order to list usages for January 20th, you would need to append the following to @@ -789,16 +789,15 @@ private ApiCall, ApiException> prepareListUsagesRequest( } /** - * Activates an event-based component for a single subscription. In order to bill your - * subscribers on your Events data under the Events-Based Billing feature, the components must - * be activated for the subscriber. Learn more about the role of activation in the [Events-Based - * Billing - * docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). + * Activates an event-based component for a single subscription. To bill your subscribers on + * your Events data under the Events-Based Billing feature, the components must be activated for + * the subscriber. For more information, see [Design Your + * Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). * Use this endpoint to activate an event-based component for a single subscription. Activating - * an event-based component causes Advanced Billing to bill for events when the subscription is - * renewed. *Note: it is possible to stream events for a subscription at any time, regardless of - * component activation status. The activation status only determines if the subscription should - * be billed for event-based component usage at renewal.*. + * an event-based component causes billing for events when the subscription is renewed. Note: it + * is possible to stream events for a subscription at any time, regardless of component + * activation status. The activation status only determines if the subscription should be billed + * for event-based component usage at renewal. * @param subscriptionId Required parameter: The Advanced Billing id of the subscription * @param componentId Required parameter: The Advanced Billing id of the component * @param body Optional parameter: @@ -882,21 +881,21 @@ private ApiCall prepareDeactivateEventBasedComponentRequest( } /** - * Records a single event for Events-Based Billing. ## Documentation Events-Based Billing is an - * evolved form of metered billing that is based on data-rich events streamed in real-time from - * your system to Advanced Billing. These events can then be transformed, enriched, or analyzed - * to form the computed totals of usage charges billed to your customers. This API allows you to - * stream events into the Advanced Billing data ingestion engine. Learn more about the feature - * in general in the [Events-Based Billing help - * docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). - * ## Record Event Use this endpoint to record a single event. *Note: this endpoint differs from - * the standard Chargify API endpoints in that the URL subdomain will be `events` and your site - * subdomain will be included in the URL path. For example:* ``` + * Records a single event for Events-Based Billing. Events-Based Billing is an evolved form of + * metered billing that is based on data-rich events streamed in real-time from your system to + * Advanced Billing. These events can then be transformed, enriched, or analyzed to form the + * computed totals of usage charges billed to your customers. This API allows you to stream + * events into the Advanced Billing data ingestion engine. For more information, see [Design + * Your + * Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). + * Note: this endpoint differs from the standard URL for this API in that `events` and your site + * subdomain are included in the path. For example: ``` * https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle ```. * @param apiHandle Required parameter: Identifies the Stream for which the event should be * published. * @param storeUid Optional parameter: If you've attached your own Keen project as an Advanced - * Billing event data-store, use this parameter to indicate the data-store. + * Billing event data-store, use this parameter to indicate the data-store. This applies + * to Legacy Metering sites only — it has no effect on Maxio Metering sites. * @param body Optional parameter: * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. @@ -939,14 +938,15 @@ private ApiCall prepareRecordEventRequest( } /** - * Records a collection of events. *Note: this endpoint differs from the standard Chargify API - * endpoints in that the subdomain will be `events` and your site subdomain will be included in - * the URL path.* A maximum of 1000 events can be published in a single request. A 422 will be - * returned if this limit is exceeded. + * Records a collection of events. Note: this endpoint differs from the standard URL for this + * API in that `events` and your site subdomain are included in the path. A maximum of 1000 + * events can be published in a single request. A 422 will be returned if this limit is + * exceeded. * @param apiHandle Required parameter: Identifies the Stream for which the events should be * published. * @param storeUid Optional parameter: If you've attached your own Keen project as an Advanced - * Billing event data-store, use this parameter to indicate the data-store. + * Billing event data-store, use this parameter to indicate the data-store. This applies + * to Legacy Metering sites only — it has no effect on Maxio Metering sites. * @param body Optional parameter: * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java index e85b0913..49f8cb95 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java @@ -142,11 +142,10 @@ private ApiCall prepareCreateSubscripti } /** - * Returns an array of subscription groups for the site. The response is paginated and will - * return a `meta` key with pagination information. #### Account Balance Information Account - * balance information for the subscription groups is not returned by default. If this - * information is desired, the `include[]=account_balances` parameter must be provided with the - * request. + * Lists subscription groups for the site. The response is paginated and will return a `meta` + * key with pagination information. #### Account Balance Information Account balance information + * for the subscription groups is not returned by default. If this information is desired, the + * `include[]=account_balances` parameter must be provided with the request. * @param input ListSubscriptionGroupsInput object containing request parameters * @return Returns the ListSubscriptionGroupsResponse response from the API call * @throws ApiException Represents error response from the server. @@ -323,7 +322,7 @@ private ApiCall prepareDeleteSubs /** * Finds the subscription group associated with a subscription. If the subscription is not in a - * group, the endpoint will return a 404 code. + * group, this endpoint returns an error. * @param subscriptionId Required parameter: The Advanced Billing id of the subscription * associated with the subscription group * @return Returns the FullSubscriptionGroupResponse response from the API call @@ -364,7 +363,8 @@ private ApiCall prepareFindSubscrip } /** - * For sites making use of the [Relationship + * Adds an existing subscription to a subscription group. For sites making use of the + * [Relationship * Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) * and [Customer * Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) @@ -428,7 +428,8 @@ private ApiCall prepareAddSubscriptionT } /** - * For sites making use of the [Relationship + * Removes an existing subscription from a subscription group. For sites making use of the + * [Relationship * Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) * and [Customer * Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java index 58610c1e..1f144260 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java @@ -35,11 +35,12 @@ public SubscriptionNotesController(GlobalConfiguration globalConfig) { } /** - * Creates a note for a subscription. ## How to Use Subscription Notes Notes allow you to record - * information about a particular Subscription in a free text format. If you have structured - * data such as birth date, color, etc., consider using Metadata instead. Full documentation on - * how to use Notes in the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscription-Summary-Overview). + * Creates a note for a subscription. Notes allow you to record information about a particular + * Subscription in a free text format. If you have structured data such as birth date, color, + * etc., consider using [Metadata]($e/Custom%20Fields/createMetadata) instead. For more + * information, see [Adding + * Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understanding-the-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) + * in the product documentation. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param body Optional parameter: * @return Returns the SubscriptionNoteResponse response from the API call diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java index c3222148..e8fd1e9c 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java @@ -35,19 +35,18 @@ public SubscriptionProductsController(GlobalConfiguration globalConfig) { } /** - * Migrates a subscription to a different product. In order to create a migration, you must pass - * the `product_id` or `product_handle` in the object when you send a POST request. You may also + * Migrates a subscription to a different product. To create a migration, you must pass the + * `product_id` or `product_handle` in the object when you send a POST request. You can also * pass either a `product_price_point_id` or `product_price_point_handle` to choose which price - * point the subscription is moved to. If no price point identifier is passed the subscription - * will be moved to the products default price point. The response will be the updated - * subscription. ## Valid Subscriptions Subscriptions should be in the `active` or `trialing` - * state in order to be migrated. (For backwards compatibility reasons, it is possible to - * migrate a subscription that is in the `trial_ended` state via the API, however this is not - * recommended. Since `trial_ended` is an end-of-life state, the subscription should be - * canceled, the product changed, and then the subscription can be reactivated.) ## Migrations - * Documentation Full documentation on how to record Migrations in the Advanced Billing UI can - * be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Migration-to-Advanced-Billing). + * point the subscription is moved to. If no price point identifier is passed, the subscription + * is moved to the product's default price point. The response is the updated subscription. ## + * Valid Subscriptions Subscriptions should be in the `active` or `trialing` state to be + * migrated. (For backwards compatibility reasons, it is possible to migrate a subscription that + * is in the `trial_ended` state via the API, however this is not recommended. Since + * `trial_ended` is an end-of-life state, the subscription should be canceled, the product + * changed, and then the subscription can be reactivated.) For more information, see [Product + * Changes and + * Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). * ## Failed Migrations Important note: One of the most common ways that a migration can fail is * when the attempt is made to migrate a subscription to its current product. ## 3D Secure (3DS) * Authentication post-authentication flow When a payment requires 3DS Authentication to adhere diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionRenewalsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionRenewalsController.java index 7874e169..11a22f45 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionRenewalsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionRenewalsController.java @@ -323,7 +323,7 @@ private ApiCall prepareLock } /** - * Returns a scheduled renewal configuration to an editable state. + * Restores a scheduled renewal configuration to an editable state. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param id Required parameter: The renewal id. * @return Returns the ScheduledRenewalConfigurationResponse response from the API call @@ -413,7 +413,11 @@ private ApiCall prepareCanc } /** - * Adds product and component line items to the scheduled renewal. + * Adds product and component line items to the scheduled renewal. If your site has list vs + * sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, + * validates and persists it; omitted value follows existing/default behavior; with list vs + * sales pricing disabled, parameter is ignored (no validation/behavioral impact). This + * functionality is supported in the API, but is not currently supported in SDKs. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param scheduledRenewalsConfigurationId Required parameter: The scheduled renewal * configuration id. @@ -467,7 +471,11 @@ private ApiCall prepare } /** - * Updates an existing configuration item’s pricing and quantity. + * Updates an existing configuration item’s pricing and quantity. If you site has list vs sales + * pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, + * validates and persists it; omitted value follows existing/default behavior; with list vs + * sales pricing disabled, parameter is ignored (no validation/behavioral impact). This + * functionality is supported in the API, but is not currently supported in SDKs. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param scheduledRenewalsConfigurationId Required parameter: The scheduled renewal * configuration id. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java index 5e2cf14a..844f8886 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java @@ -549,23 +549,23 @@ private ApiCall prepareCancelDunningRequest( * a subscription’s next assessment. You can retrieve it to see a snapshot of how much your * customer will be charged on their next renewal. The "Next Billing" amount and "Next Billing" * date are already represented in the UI on each Subscriber's Summary. For more information, - * see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). - * ## Optional Component Fields This endpoint is particularly useful due to the fact that it - * will return the computed billing amount for the base product and the components which are in - * use by a subscriber. By default, the preview will include billing details for all components - * _at their **current** quantities_. This means: * Current `allocated_quantity` for - * quantity-based components * Current enabled/disabled status for on/off components * Current - * metered usage `unit_balance` for metered components * Current metric quantity value for - * events recorded thus far for events-based components In the above statements, "current" means - * the quantity or value as of the call to the renewal preview endpoint. We do not predict - * end-of-period values for components, so metered or events-based usage may be less than it - * will eventually be at the end of the period. Optionally, **you may provide your own custom - * quantities** for any component to see a billing preview for non-current quantities. This is - * accomplished by sending a request body with data under the `components` key. See the request - * body documentation below. ## Subscription Side Effects You can request a `POST` to obtain - * this data from the endpoint without any side effects. This method allows you to preview data, - * but does not log any changes against a subscription. + * see [Subscriber Interface + * Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). + * ## Optional Component Fields This endpoint is particularly useful because it returns the + * computed billing amount for the base product and the components which are in use by a + * subscriber. By default, the preview includes billing details for all components _at their + * **current** quantities_. This means: * Current `allocated_quantity` for quantity-based + * components * Current enabled/disabled status for on/off components * Current metered usage + * `unit_balance` for metered components * Current metric quantity value for events recorded + * thus far for events-based components In the above statements, "current" means the quantity or + * value as of the call to the renewal preview endpoint. End-of-period values for components are + * not predicted, so metered or events-based usage may be less than it will eventually be at the + * end of the period. Optionally, **you can provide your own custom quantities** for any + * component to see a billing preview for non-current quantities. This is accomplished by + * sending a request body with data under the `components` key. See the request body + * documentation below. ## Preview Behavior Sending a `POST` request to this endpoint returns + * preview data without modifying the subscription. This method previews data, but does not log + * any changes against a subscription. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param body Optional parameter: * @return Returns the RenewalPreviewResponse response from the API call diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java index 3d0be6d6..7100d69d 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java @@ -57,7 +57,40 @@ public SubscriptionsController(GlobalConfiguration globalConfig) { * `customer_reference`. Optionally, include an existing payment profile using * `payment_profile_id`. To create a new customer, pass customer_attributes. Select an option * from the **Request Examples** drop-down on the right side of the portal to see examples of - * common scenarios for creating subscriptions. See the [Subscription + * common scenarios for creating subscriptions. ## List vs Sales Pricing When a subscription + * uses custom pricing as the sales price, you can optionally provide a list price for any item. + * If omitted, the list price defaults to the sales price. The difference between the list price + * and sales price is used to calculate implicit discounts, which appear on Invoices and in + * reporting. List price can also support revenue allocations in [Advanced + * Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-and-Configure-RevenueBooks). + * If your site has list pricing enabled, the API accepts `custom_price.list_price_point_id` for + * custom pricing, validates and persists it, and returns list price metadata in subscription + * responses. If list pricing is disabled, this input is ignored and related response fields are + * omitted. When list pricing is enabled: - Subscription → Product + * `product_price_point_list_price_point_id` (integer) - + * `product_price_point_list_price_point_handle` (string) - Subscription Components (when + * components are included in the response, such as with subscriptions built from components or + * component serialization paths) `component_id` (integer) - `price_point_id` (integer) - + * `list_price_point_id` (integer) When list pricing is disabled: - Subscription → Product + * `product_price_point_list_price_point_id`: omitted - + * `product_price_point_list_price_point_handle`: omitted - Subscription Components + * `list_price_point_id`: omitted This functionality is supported in the API, but is not + * currently supported in SDKs. ## Subscriptions can now work independently from the catalog If + * you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, you can create subscriptions without a `product_id` or `product_handle` using POST + * /subscriptions, building them entirely from components. A valid subscription must include at + * least one active component with: - a positive `allocated_quantity`, - a positive + * `unit_balance`, or - 'enabled: true' (for on/off components) - a configured metered component + * `component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and + * `trial_interval_unit` are included, they are applied at creation. In the response, product + * and product price point fields are null, and component details are returned instead. This + * functionality is supported in the API, but is not currently supported in SDKs. ## Payment + * information Payment information may be required to create a subscription, depending on the + * options for the Product being subscribed. See [product + * options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more + * information. See the [Payments Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint + * for details on payment parameters. See the [Subscription * Signups](page:introduction/basic-concepts/subscription-signup) article for more information * on working with subscriptions in Advanced Billing. ## Payment information Payment information * may be required to create a subscription, depending on the options for the Product being @@ -120,12 +153,16 @@ private ApiCall prepareCreateSubscriptionReq } /** - * Returns an array of subscriptions from a Site. Pay close attention to query string filters - * and pagination in order to control responses from the server. ## Search for a subscription - * Use the query strings below to search for a subscription using the criteria available. The - * return value will be an array. ## Self-Service Page token Self-Service Page token for the - * subscriptions is not returned by default. If this information is desired, the - * include[]=self_service_page_token parameter must be provided with the request. + * Lists subscriptions for a site. Use the query string filters and pagination to control + * responses from the server. If you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, some subscriptions may not have an associated product. For subscriptions without an + * associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are + * returned as 'null'. ## Search for a subscription Use the query strings below to search for a + * subscription using the criteria available. The return value will be an array. ## Self-Service + * Page token Self-Service Page token for the subscriptions is not returned by default. If this + * information is desired, the include[]=self_service_page_token parameter must be provided with + * the request. * @param input ListSubscriptionsInput object containing request parameters * @return Returns the List of SubscriptionResponse response from the API call * @throws ApiException Represents error response from the server. @@ -150,16 +187,30 @@ private ApiCall, ApiException> prepareListSubscriptio .value(input.getPage()).isRequired(false)) .queryParam(param -> param.key("per_page") .value(input.getPerPage()).isRequired(false)) + .queryParam(param -> param.key("sort") + .value((input.getSort() != null) ? input.getSort().value() : "signup_date").isRequired(false)) + .queryParam(param -> param.key("direction") + .value((input.getDirection() != null) ? input.getDirection().value() : null).isRequired(false)) .queryParam(param -> param.key("state") .value((input.getState() != null) ? input.getState().value() : null).isRequired(false)) .queryParam(param -> param.key("product") .value(input.getProduct()).isRequired(false)) + .queryParam(param -> param.key("q") + .value(input.getQ()).isRequired(false)) + .queryParam(param -> param.key("q_scope") + .value((input.getQScope() != null) ? input.getQScope().value() : null).isRequired(false)) + .queryParam(param -> param.key("customer_id") + .value(input.getCustomerId()).isRequired(false)) .queryParam(param -> param.key("product_price_point_id") .value(input.getProductPricePointId()).isRequired(false)) .queryParam(param -> param.key("coupon") .value(input.getCoupon()).isRequired(false)) .queryParam(param -> param.key("coupon_code") .value(input.getCouponCode()).isRequired(false)) + .queryParam(param -> param.key("collection_method") + .value((input.getCollectionMethod() != null) ? input.getCollectionMethod().value() : null).isRequired(false)) + .queryParam(param -> param.key("branding_theme_id") + .value(input.getBrandingThemeId()).isRequired(false)) .queryParam(param -> param.key("date_field") .value((input.getDateField() != null) ? input.getDateField().value() : null).isRequired(false)) .queryParam(param -> param.key("start_date") @@ -172,10 +223,14 @@ private ApiCall, ApiException> prepareListSubscriptio .value(DateTimeHelper.toRfc8601DateTime(input.getEndDatetime())).isRequired(false)) .queryParam(param -> param.key("metadata") .value(input.getMetadata()).isRequired(false)) - .queryParam(param -> param.key("direction") - .value((input.getDirection() != null) ? input.getDirection().value() : null).isRequired(false)) - .queryParam(param -> param.key("sort") - .value((input.getSort() != null) ? input.getSort().value() : "signup_date").isRequired(false)) + .queryParam(param -> param.key("group_status") + .value((input.getGroupStatus() != null) ? input.getGroupStatus().value() : null).isRequired(false)) + .queryParam(param -> param.key("dunning_exemption") + .value(input.getDunningExemption()).isRequired(false)) + .queryParam(param -> param.key("payment_gateways") + .value(input.getPaymentGateways()).isRequired(false)) + .queryParam(param -> param.key("currencies") + .value(input.getCurrencies()).isRequired(false)) .queryParam(param -> param.key("include") .value(SubscriptionListInclude.toValue(input.getInclude())).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) @@ -237,9 +292,14 @@ private ApiCall, ApiException> prepareListSubscriptio * Billing, setting the next billing date is a bit different. Send the `snap_day` attribute to * change the calendar billing date for **a subscription using a product eligible for calendar * billing**. > Note: If you change the product associated with a subscription that contains a - * `snap_day` and immediately `READ/GET` the subscription data, it will still contain original - * `snap_day`. The `snap_day` will reset to null on the next billing cycle. This is because a - * product change is instantaneous and only affects the product associated with a subscription. + * `snap_day` and immediately READ/GET the subscription data, it will still contain the original + * `snap_day`. The `snap_day` will be reset to `null` on the next billing cycle. This is because + * a product change is instantaneous and only affects the product associated with a + * subscription. If you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, some subscriptions may not have an associated product. For subscriptions without an + * associated product, `product`, `product_price_point_id`, and `product_price_point_type` are + * returned as `null`. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param body Optional parameter: * @return Returns the SubscriptionResponse response from the API call @@ -286,8 +346,12 @@ private ApiCall prepareUpdateSubscriptionReq } /** - * Retrieves subscription details. ## Self-Service Page token Self-Service Page token for the - * subscription is not returned by default. If this information is desired, the + * Retrieves subscription details. If you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, some subscriptions may not have an associated product. For subscriptions without an + * associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are + * returned as 'null'. ## Self-Service Page token Self-Service Page token for the subscription + * is not returned by default. If this information is desired, the * include[]=self_service_page_token parameter must be provided with the request. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param include Optional parameter: Allows including additional data in the response. Use in @@ -435,7 +499,7 @@ private ApiCall prepareFindSubscriptionReque /** * Purges an individual subscription for sites in test mode. Provide the subscription ID in the - * url. To confirm, supply the customer ID in the query string `ack` parameter. You may also + * URL. To confirm, supply the customer ID in the query string `ack` parameter. You may also * delete the customer record and/or payment profiles by passing `cascade` parameters. For * example, to delete just the customer record, the query params would be: * `?ack={customer_id}&cascade[]=customer` If you need to remove subscriptions from a live site, @@ -539,26 +603,35 @@ private ApiCall prepareUpdatePrepaid /** * Previews a subscription by POSTing the same JSON or XML as for a subscription creation. The - * "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. A - * subscription will not be created by utilizing this endpoint; it is meant to serve as a - * prediction. For more information, see our documentation - * [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). - * ## Taxable Subscriptions This endpoint will preview taxes applicable to a purchase. In order - * for taxes to be previewed, the following conditions must be met: + Taxes must be configured - * on the subscription + The preview must be for the purchase of a taxable product or component, - * or combination of the two. + The subscription payload must contain a full billing or shipping - * address in order to calculate tax For more information about creating taxable previews, see - * our documentation guide on how to create [taxable - * subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) You do - * **not** need to include a card number to generate tax information when you are previewing a + * "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. + * This endpoint does not create a subscription; it is meant to serve as a prediction. For more + * information, see [Subscriber Interface + * Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). + * ## Subscriptions can now work independently from the catalog If you have the new [Catalog + * experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) + * enabled, you can create subscriptions without a `product_id` or `product_handle` using POST + * /subscriptions, building them entirely from components. A valid subscription must include at + * least one active component with: - a positive `allocated_quantity`, - a positive + * `unit_balance`, or - 'enabled: true' (for on/off components) `component_id` can be provided + * as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are + * included, they are applied at creation. In the response, product and product price point + * fields are null, and component details are returned instead. This functionality is supported + * in the API, but is not currently supported in SDKs. ## Taxable Subscriptions This endpoint + * previews taxes applicable to a purchase. For taxes to be previewed, the following conditions + * must be met: + Taxes must be configured on the subscription + The preview must be for the + * purchase of a taxable product or component, or combination of the two. + The subscription + * payload must contain a full billing or shipping address to calculate tax For more information + * about creating taxable previews, see + * [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). You do **not** + * need to include a card number to generate tax information when you are previewing a * subscription. However, when you actually want to create the subscription, you must include - * the credit card information if you want the billing address to be stored in Advanced Billing. - * The billing address and the credit card information are stored together within the payment - * profile object. Also, you may not send a billing address to Advanced Billing without payment - * profile information, as the address is stored on the card. You can pass shipping and billing - * addresses and still decide not to calculate taxes. To do that, pass - * `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions If you'd like to - * calculate subscriptions that do not include tax you may leave off the billing information. + * the credit card information if you want the billing address to be stored. The billing address + * and the credit card information are stored together within the payment profile object. Also, + * you cannot send a billing address without payment profile information, as the address is + * stored on the card. You can pass shipping and billing addresses and still decide not to + * calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## + * Non-taxable Subscriptions If you'd like to calculate subscriptions that do not include tax, + * you can leave off the billing information. * @param body Optional parameter: * @return Returns the SubscriptionPreviewResponse response from the API call * @throws ApiException Represents error response from the server. @@ -660,8 +733,8 @@ private ApiCall prepareApplyCouponsToSubscri /** * Removes a coupon from an existing subscription. For more information on the expected behavior - * of removing a coupon from a subscription, see our documentation - * [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon). + * of removing a coupon from a subscription, see [Coupons and + * Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon). * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param couponCode Optional parameter: The coupon code * @return Returns the String response from the API call @@ -706,18 +779,16 @@ private ApiCall prepareRemoveCouponFromSubscriptionRequest /** * Activates awaiting signup and trialing subscriptions. This feature is only available on the - * Relationship Invoicing architecture. Subscriptions in a group may not be activated - * immediately. For details on how the activation works, and how to activate subscriptions - * through the application, see [activation](#). The `revert_on_failure` parameter controls the - * behavior upon activation failure. - If set to `true` and something goes wrong i.e. payment - * fails, then Advanced Billing will not change the subscription's state. The subscription’s - * billing period will also remain the same. - If set to `false` and something goes wrong i.e. - * payment fails, then Advanced Billing will continue through with the activation and enter an - * end of life state. For trialing subscriptions, that will either be trial ended (if the trial - * is no obligation), past due (if the trial has an obligation), or canceled (if the site has no + * Relationship Invoicing architecture. Subscriptions in a group cannot be activated + * immediately. The `revert_on_failure` parameter controls the behavior upon activation failure. + * - If set to `true` and something goes wrong i.e. payment fails, the subscription's state does + * not change. The subscription’s billing period also remains the same. - If set to `false` and + * something goes wrong i.e. payment fails, the activation continues and enters an end of life + * state. For trialing subscriptions, that is either trial ended (if the trial is no + * obligation), past due (if the trial has an obligation), or canceled (if the site has no * dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup - * subscriptions, that will always be canceled. The default activation failure behavior can be - * configured per activation attempt, or you may set a default value under Config > Settings > + * subscriptions, that is always canceled. The default activation failure behavior can be + * configured per activation attempt, or you can set a default value under Config > Settings > * Subscription Activation Settings. ## Activation Scenarios ### Activate Awaiting Signup * subscription - Given you have a product without trial - Given you have a site without dunning * strategy ```mermaid flowchart LR AS[Awaiting Signup] --> A{Activate} A -->|Success| Active A @@ -725,11 +796,11 @@ private ApiCall prepareRemoveCouponFromSubscriptionRequest * have a product with trial - Given you have a site with dunning strategy ```mermaid flowchart * LR AS[Awaiting Signup] --> A{Activate} A -->|Success| Trialing A -->|Failure| * ROF{revert_on_failure} ROF -->|true| AS ROF -->|false| PD[Past Due] ``` ### Activate Trialing - * subscription You can read more about the behavior of trialing subscriptions - * [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). - * When the `revert_on_failure` parameter is set to `true`, the subscription's state will remain - * as Trialing, we will void the invoice from activation and return any prepayments and credits - * applied to the invoice back to the subscription. + * subscription For more information about the behavior of trialing subscriptions, see [Trialing + * Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). + * When the `revert_on_failure` parameter is set to `true`, the subscription's state remains + * Trialing; the invoice from activation is voided, and any prepayments and credits applied to + * the invoice are returned to the subscription. * @param subscriptionId Required parameter: The Chargify id of the subscription. * @param body Optional parameter: * @return Returns the SubscriptionResponse response from the API call diff --git a/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java b/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java index b7a69eae..ed7605c4 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java @@ -216,7 +216,7 @@ private ApiCall prepareCreateEndpointRequest( } /** - * Returns created endpoints for a site. + * Lists endpoints configured for a site. * @return Returns the List of Endpoint response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. diff --git a/src/main/java/com/maxio/advancedbilling/models/ActivateSubscriptionRequest.java b/src/main/java/com/maxio/advancedbilling/models/ActivateSubscriptionRequest.java index fac869e1..2ae8d03f 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ActivateSubscriptionRequest.java +++ b/src/main/java/com/maxio/advancedbilling/models/ActivateSubscriptionRequest.java @@ -48,8 +48,8 @@ protected ActivateSubscriptionRequest(OptionalNullable revertOnFailure) * Internal Getter for RevertOnFailure. * You may choose how to handle the activation failure. `true` means do not change the * subscription’s state and billing period. `false` means to continue through with the - * activation and enter an end of life state. If this parameter is omitted or `null` is passed - * it will default to value set in the site settings (default: `true`) + * activation and enter an end-of-life state. If this parameter is omitted or `null` is passed + * it will default to the value set in the site settings (default: `true`). * @return Returns the Internal Boolean */ @JsonGetter("revert_on_failure") @@ -63,8 +63,8 @@ protected OptionalNullable internalGetRevertOnFailure() { * Getter for RevertOnFailure. * You may choose how to handle the activation failure. `true` means do not change the * subscription’s state and billing period. `false` means to continue through with the - * activation and enter an end of life state. If this parameter is omitted or `null` is passed - * it will default to value set in the site settings (default: `true`) + * activation and enter an end-of-life state. If this parameter is omitted or `null` is passed + * it will default to the value set in the site settings (default: `true`). * @return Returns the Boolean */ public Boolean getRevertOnFailure() { @@ -75,8 +75,8 @@ public Boolean getRevertOnFailure() { * Setter for RevertOnFailure. * You may choose how to handle the activation failure. `true` means do not change the * subscription’s state and billing period. `false` means to continue through with the - * activation and enter an end of life state. If this parameter is omitted or `null` is passed - * it will default to value set in the site settings (default: `true`) + * activation and enter an end-of-life state. If this parameter is omitted or `null` is passed + * it will default to the value set in the site settings (default: `true`). * @param revertOnFailure Value for Boolean */ @JsonSetter("revert_on_failure") @@ -88,8 +88,8 @@ public void setRevertOnFailure(Boolean revertOnFailure) { * UnSetter for RevertOnFailure. * You may choose how to handle the activation failure. `true` means do not change the * subscription’s state and billing period. `false` means to continue through with the - * activation and enter an end of life state. If this parameter is omitted or `null` is passed - * it will default to value set in the site settings (default: `true`) + * activation and enter an end-of-life state. If this parameter is omitted or `null` is passed + * it will default to the value set in the site settings (default: `true`). */ public void unsetRevertOnFailure() { revertOnFailure = null; diff --git a/src/main/java/com/maxio/advancedbilling/models/AgreementAcceptance.java b/src/main/java/com/maxio/advancedbilling/models/AgreementAcceptance.java index 864f79e1..bd8b7548 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AgreementAcceptance.java +++ b/src/main/java/com/maxio/advancedbilling/models/AgreementAcceptance.java @@ -77,7 +77,7 @@ public void setIpAddress(String ipAddress) { /** * Getter for TermsUrl. * Required when creating a subscription with Maxio Payments. Either terms_url or - * provacy_policy_url required when providing agreement_acceptance params. + * privacy_policy_url is required when providing agreement_acceptance params. * @return Returns the String */ @JsonGetter("terms_url") @@ -89,7 +89,7 @@ public String getTermsUrl() { /** * Setter for TermsUrl. * Required when creating a subscription with Maxio Payments. Either terms_url or - * provacy_policy_url required when providing agreement_acceptance params. + * privacy_policy_url is required when providing agreement_acceptance params. * @param termsUrl Value for String */ @JsonSetter("terms_url") diff --git a/src/main/java/com/maxio/advancedbilling/models/AllVaults.java b/src/main/java/com/maxio/advancedbilling/models/AllVaults.java index be8d4605..acec278a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllVaults.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllVaults.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * AllVaults to be used. */ @@ -85,7 +84,6 @@ public enum AllVaults { WIRECARD; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.java b/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.java index 9b7f2658..70cbe323 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.java @@ -256,7 +256,7 @@ public void unsetDowngradeCredit() { /** * Getter for PaymentCollectionMethod. * (Optional) If not passed, the allocation(s) will use the payment collection method on the - * subscription + * subscription. * @return Returns the CollectionMethod */ @JsonGetter("payment_collection_method") @@ -268,7 +268,7 @@ public CollectionMethod getPaymentCollectionMethod() { /** * Setter for PaymentCollectionMethod. * (Optional) If not passed, the allocation(s) will use the payment collection method on the - * subscription + * subscription. * @param paymentCollectionMethod Value for CollectionMethod */ @JsonSetter("payment_collection_method") diff --git a/src/main/java/com/maxio/advancedbilling/models/Allocation.java b/src/main/java/com/maxio/advancedbilling/models/Allocation.java index 0faa1239..a7f656df 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Allocation.java +++ b/src/main/java/com/maxio/advancedbilling/models/Allocation.java @@ -206,7 +206,7 @@ protected Allocation(Integer allocationId, Integer componentId, /** * Getter for AllocationId. - * The allocation unique id + * The allocation unique ID * @return Returns the Integer */ @JsonGetter("allocation_id") @@ -217,7 +217,7 @@ public Integer getAllocationId() { /** * Setter for AllocationId. - * The allocation unique id + * The allocation unique ID * @param allocationId Value for Integer */ @JsonSetter("allocation_id") @@ -228,7 +228,7 @@ public void setAllocationId(Integer allocationId) { /** * Getter for ComponentId. * The integer component ID for the allocation. This references a component that you have - * created in your Product setup + * created in your Product setup. * @return Returns the Integer */ @JsonGetter("component_id") @@ -240,7 +240,7 @@ public Integer getComponentId() { /** * Setter for ComponentId. * The integer component ID for the allocation. This references a component that you have - * created in your Product setup + * created in your Product setup. * @param componentId Value for Integer */ @JsonSetter("component_id") @@ -251,7 +251,7 @@ public void setComponentId(Integer componentId) { /** * Internal Getter for ComponentHandle. * The handle of the component. This references a component that you have created in your - * Product setup + * Product setup. * @return Returns the Internal String */ @JsonGetter("component_handle") @@ -264,7 +264,7 @@ protected OptionalNullable internalGetComponentHandle() { /** * Getter for ComponentHandle. * The handle of the component. This references a component that you have created in your - * Product setup + * Product setup. * @return Returns the String */ public String getComponentHandle() { @@ -274,7 +274,7 @@ public String getComponentHandle() { /** * Setter for ComponentHandle. * The handle of the component. This references a component that you have created in your - * Product setup + * Product setup. * @param componentHandle Value for String */ @JsonSetter("component_handle") @@ -285,7 +285,7 @@ public void setComponentHandle(String componentHandle) { /** * UnSetter for ComponentHandle. * The handle of the component. This references a component that you have created in your - * Product setup + * Product setup. */ public void unsetComponentHandle() { componentHandle = null; @@ -294,7 +294,7 @@ public void unsetComponentHandle() { /** * Getter for SubscriptionId. * The integer subscription ID for the allocation. This references a unique subscription in your - * Site + * Site. * @return Returns the Integer */ @JsonGetter("subscription_id") @@ -306,7 +306,7 @@ public Integer getSubscriptionId() { /** * Setter for SubscriptionId. * The integer subscription ID for the allocation. This references a unique subscription in your - * Site + * Site. * @param subscriptionId Value for Integer */ @JsonSetter("subscription_id") @@ -316,7 +316,7 @@ public void setSubscriptionId(Integer subscriptionId) { /** * Getter for Quantity. - * The allocated quantity set in to effect by the allocation. String for components supporting + * The allocated quantity set into effect by the allocation. String for components supporting * fractional quantities * @return Returns the AllocationQuantity */ @@ -328,7 +328,7 @@ public AllocationQuantity getQuantity() { /** * Setter for Quantity. - * The allocated quantity set in to effect by the allocation. String for components supporting + * The allocated quantity set into effect by the allocation. String for components supporting * fractional quantities * @param quantity Value for AllocationQuantity */ @@ -401,7 +401,7 @@ public void unsetMemo() { /** * Getter for Timestamp. - * The time that the allocation was recorded, in format and UTC timezone, i.e. + * The time that the allocation was recorded, in ISO 8601 format and UTC timezone, e.g., * 2012-11-20T22:00:37Z * @return Returns the ZonedDateTime */ @@ -414,7 +414,7 @@ public ZonedDateTime getTimestamp() { /** * Setter for Timestamp. - * The time that the allocation was recorded, in format and UTC timezone, i.e. + * The time that the allocation was recorded, in ISO 8601 format and UTC timezone, e.g., * 2012-11-20T22:00:37Z * @param timestamp Value for ZonedDateTime */ @@ -552,7 +552,7 @@ public void setPricePointHandle(String pricePointHandle) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -565,7 +565,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewDirection.java b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewDirection.java index 958d43d3..84b2375d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewDirection.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewDirection.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * AllocationPreviewDirection to be used. */ @@ -21,7 +20,6 @@ public enum AllocationPreviewDirection { DOWNGRADE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java index 77852ec7..f29ca8c3 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java @@ -467,7 +467,7 @@ public void setPricePointId(Integer pricePointId) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -480,7 +480,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItem.java b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItem.java index 2fb93f28..7145ffc6 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItem.java @@ -223,7 +223,7 @@ public void setComponentHandle(String componentHandle) { /** * Getter for Direction. - * Visible when using Fine-grained Component Control + * Visible when using Fine-grained Component Control. * @return Returns the AllocationPreviewDirection */ @JsonGetter("direction") @@ -234,7 +234,7 @@ public AllocationPreviewDirection getDirection() { /** * Setter for Direction. - * Visible when using Fine-grained Component Control + * Visible when using Fine-grained Component Control. * @param direction Value for AllocationPreviewDirection */ @JsonSetter("direction") diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItemKind.java b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItemKind.java index 2237ebd7..e3dc7300 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItemKind.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewLineItemKind.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * AllocationPreviewLineItemKind to be used. */ @@ -25,7 +24,6 @@ public enum AllocationPreviewLineItemKind { TAX; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ApplePayPaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/ApplePayPaymentProfile.java index d6b8aae9..7cee9c44 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ApplePayPaymentProfile.java +++ b/src/main/java/com/maxio/advancedbilling/models/ApplePayPaymentProfile.java @@ -246,7 +246,7 @@ public void setLastName(String lastName) { /** * Getter for CustomerId. - * The Chargify-assigned id for the customer record to which the Apple Pay account belongs + * The Chargify-assigned ID for the customer record to which the Apple Pay account belongs * @return Returns the Integer */ @JsonGetter("customer_id") @@ -257,7 +257,7 @@ public Integer getCustomerId() { /** * Setter for CustomerId. - * The Chargify-assigned id for the customer record to which the Apple Pay account belongs + * The Chargify-assigned ID for the customer record to which the Apple Pay account belongs * @param customerId Value for Integer */ @JsonSetter("customer_id") diff --git a/src/main/java/com/maxio/advancedbilling/models/ApplePayVault.java b/src/main/java/com/maxio/advancedbilling/models/ApplePayVault.java index 849ce41d..85d44d50 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ApplePayVault.java +++ b/src/main/java/com/maxio/advancedbilling/models/ApplePayVault.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * ApplePayVault to be used. */ public enum ApplePayVault { BRAINTREE_BLUE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java b/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java index 4cdf4b88..48ea9a49 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java +++ b/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java @@ -294,7 +294,7 @@ public void setRole(String role) { /** * Getter for ConsolidatedInvoice. - * Shows whether it was applied to consolidated invoice or not + * Shows whether it was applied to consolidated invoice or not. * @return Returns the Boolean */ @JsonGetter("consolidated_invoice") @@ -305,7 +305,7 @@ public Boolean getConsolidatedInvoice() { /** * Setter for ConsolidatedInvoice. - * Shows whether it was applied to consolidated invoice or not + * Shows whether it was applied to consolidated invoice or not. * @param consolidatedInvoice Value for Boolean */ @JsonSetter("consolidated_invoice") diff --git a/src/main/java/com/maxio/advancedbilling/models/AutoInvite.java b/src/main/java/com/maxio/advancedbilling/models/AutoInvite.java index 1b41e7b3..3f3d883c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AutoInvite.java +++ b/src/main/java/com/maxio/advancedbilling/models/AutoInvite.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * AutoInvite to be used. */ @@ -27,7 +26,6 @@ public enum AutoInvite { */ YES; - private static TreeMap valueMap = new TreeMap<>(); private Integer value; diff --git a/src/main/java/com/maxio/advancedbilling/models/BankAccountAttributes.java b/src/main/java/com/maxio/advancedbilling/models/BankAccountAttributes.java index 900fc8af..1f10e06e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/BankAccountAttributes.java +++ b/src/main/java/com/maxio/advancedbilling/models/BankAccountAttributes.java @@ -121,9 +121,9 @@ public void setBankName(String bankName) { /** * Getter for BankRoutingNumber. - * (Required when creating a subscription with ACH. Optional when creating a subscription with + * (Required when creating a subscription with ACH; optional when creating a subscription with * GoCardless). The routing number of the bank. It becomes bank_code while passing via - * GoCardless API + * GoCardless API. * @return Returns the String */ @JsonGetter("bank_routing_number") @@ -134,9 +134,9 @@ public String getBankRoutingNumber() { /** * Setter for BankRoutingNumber. - * (Required when creating a subscription with ACH. Optional when creating a subscription with + * (Required when creating a subscription with ACH; optional when creating a subscription with * GoCardless). The routing number of the bank. It becomes bank_code while passing via - * GoCardless API + * GoCardless API. * @param bankRoutingNumber Value for String */ @JsonSetter("bank_routing_number") @@ -191,7 +191,7 @@ public void setBankAccountType(BankAccountType bankAccountType) { /** * Getter for BankBranchCode. * (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN - * can be provided + * can be provided. * @return Returns the String */ @JsonGetter("bank_branch_code") @@ -203,7 +203,7 @@ public String getBankBranchCode() { /** * Setter for BankBranchCode. * (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN - * can be provided + * can be provided. * @param bankBranchCode Value for String */ @JsonSetter("bank_branch_code") @@ -214,7 +214,7 @@ public void setBankBranchCode(String bankBranchCode) { /** * Getter for BankIban. * (Optional when creating a subscription with GoCardless). International Bank Account Number. - * Alternatively, local bank details can be provided + * Alternatively, local bank details can be provided. * @return Returns the String */ @JsonGetter("bank_iban") @@ -226,7 +226,7 @@ public String getBankIban() { /** * Setter for BankIban. * (Optional when creating a subscription with GoCardless). International Bank Account Number. - * Alternatively, local bank details can be provided + * Alternatively, local bank details can be provided. * @param bankIban Value for String */ @JsonSetter("bank_iban") diff --git a/src/main/java/com/maxio/advancedbilling/models/BankAccountHolderType.java b/src/main/java/com/maxio/advancedbilling/models/BankAccountHolderType.java index 74816cf1..37d5931e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/BankAccountHolderType.java +++ b/src/main/java/com/maxio/advancedbilling/models/BankAccountHolderType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * BankAccountHolderType to be used. */ @@ -21,7 +20,6 @@ public enum BankAccountHolderType { BUSINESS; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/BankAccountPaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/BankAccountPaymentProfile.java index c04e7e25..d38e2c09 100644 --- a/src/main/java/com/maxio/advancedbilling/models/BankAccountPaymentProfile.java +++ b/src/main/java/com/maxio/advancedbilling/models/BankAccountPaymentProfile.java @@ -228,7 +228,7 @@ protected BankAccountPaymentProfile( * Getter for Id. * The Chargify-assigned ID of the stored bank account. This value can be used as an input to * payment_profile_id when creating a subscription, in order to re-use a stored payment profile - * for the same customer + * for the same customer. * @return Returns the Integer */ @JsonGetter("id") @@ -241,7 +241,7 @@ public Integer getId() { * Setter for Id. * The Chargify-assigned ID of the stored bank account. This value can be used as an input to * payment_profile_id when creating a subscription, in order to re-use a stored payment profile - * for the same customer + * for the same customer. * @param id Value for Integer */ @JsonSetter("id") @@ -293,7 +293,7 @@ public void setLastName(String lastName) { /** * Getter for CustomerId. - * The Chargify-assigned id for the customer record to which the bank account belongs + * The Chargify-assigned ID for the customer record to which the bank account belongs * @return Returns the Integer */ @JsonGetter("customer_id") @@ -304,7 +304,7 @@ public Integer getCustomerId() { /** * Setter for CustomerId. - * The Chargify-assigned id for the customer record to which the bank account belongs + * The Chargify-assigned ID for the customer record to which the bank account belongs * @param customerId Value for Integer */ @JsonSetter("customer_id") @@ -657,7 +657,7 @@ public void setBankName(String bankName) { /** * Internal Getter for MaskedBankRoutingNumber. * A string representation of the stored bank routing number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account + * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. * @return Returns the Internal String */ @JsonGetter("masked_bank_routing_number") @@ -670,7 +670,7 @@ protected OptionalNullable internalGetMaskedBankRoutingNumber() { /** * Getter for MaskedBankRoutingNumber. * A string representation of the stored bank routing number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account + * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. * @return Returns the String */ public String getMaskedBankRoutingNumber() { @@ -680,7 +680,7 @@ public String getMaskedBankRoutingNumber() { /** * Setter for MaskedBankRoutingNumber. * A string representation of the stored bank routing number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account + * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. * @param maskedBankRoutingNumber Value for String */ @JsonSetter("masked_bank_routing_number") @@ -691,7 +691,7 @@ public void setMaskedBankRoutingNumber(String maskedBankRoutingNumber) { /** * UnSetter for MaskedBankRoutingNumber. * A string representation of the stored bank routing number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account + * marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. */ public void unsetMaskedBankRoutingNumber() { maskedBankRoutingNumber = null; @@ -700,7 +700,7 @@ public void unsetMaskedBankRoutingNumber() { /** * Internal Getter for MaskedBankAccountNumber. * A string representation of the stored bank account number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111') + * marked with X's (i.e. 'XXXXXXX1111'). * @return Returns the Internal String */ @JsonGetter("masked_bank_account_number") @@ -713,7 +713,7 @@ protected OptionalNullable internalGetMaskedBankAccountNumber() { /** * Getter for MaskedBankAccountNumber. * A string representation of the stored bank account number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111') + * marked with X's (i.e. 'XXXXXXX1111'). * @return Returns the String */ public String getMaskedBankAccountNumber() { @@ -723,7 +723,7 @@ public String getMaskedBankAccountNumber() { /** * Setter for MaskedBankAccountNumber. * A string representation of the stored bank account number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111') + * marked with X's (i.e. 'XXXXXXX1111'). * @param maskedBankAccountNumber Value for String */ @JsonSetter("masked_bank_account_number") @@ -734,7 +734,7 @@ public void setMaskedBankAccountNumber(String maskedBankAccountNumber) { /** * UnSetter for MaskedBankAccountNumber. * A string representation of the stored bank account number with all but the last 4 digits - * marked with X's (i.e. 'XXXXXXX1111') + * marked with X's (i.e. 'XXXXXXX1111'). */ public void unsetMaskedBankAccountNumber() { maskedBankAccountNumber = null; @@ -802,8 +802,8 @@ public void setPaymentType(PaymentType paymentType) { /** * Getter for Verified. - * denotes whether a bank account has been verified by providing the amounts of two small - * deposits made into the account + * Denotes whether a bank account has been verified by providing the amounts of two small + * deposits made into the account. * @return Returns the Boolean */ @JsonGetter("verified") @@ -814,8 +814,8 @@ public Boolean getVerified() { /** * Setter for Verified. - * denotes whether a bank account has been verified by providing the amounts of two small - * deposits made into the account + * Denotes whether a bank account has been verified by providing the amounts of two small + * deposits made into the account. * @param verified Value for Boolean */ @JsonSetter("verified") diff --git a/src/main/java/com/maxio/advancedbilling/models/BankAccountType.java b/src/main/java/com/maxio/advancedbilling/models/BankAccountType.java index d5535e95..f8a45aff 100644 --- a/src/main/java/com/maxio/advancedbilling/models/BankAccountType.java +++ b/src/main/java/com/maxio/advancedbilling/models/BankAccountType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * BankAccountType to be used. */ @@ -21,7 +20,6 @@ public enum BankAccountType { SAVINGS; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/BankAccountVault.java b/src/main/java/com/maxio/advancedbilling/models/BankAccountVault.java index ef314c12..dbfebb3c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/BankAccountVault.java +++ b/src/main/java/com/maxio/advancedbilling/models/BankAccountVault.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * BankAccountVault to be used. */ @@ -33,7 +32,6 @@ public enum BankAccountVault { STRIPE_CONNECT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/BasicDateField.java b/src/main/java/com/maxio/advancedbilling/models/BasicDateField.java index eeb79967..ab74d07a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/BasicDateField.java +++ b/src/main/java/com/maxio/advancedbilling/models/BasicDateField.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * BasicDateField to be used. */ @@ -21,7 +20,6 @@ public enum BasicDateField { CREATED_AT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/BillingManifestLineItemKind.java b/src/main/java/com/maxio/advancedbilling/models/BillingManifestLineItemKind.java index 946b8a45..85c1ffe5 100644 --- a/src/main/java/com/maxio/advancedbilling/models/BillingManifestLineItemKind.java +++ b/src/main/java/com/maxio/advancedbilling/models/BillingManifestLineItemKind.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * BillingManifestLineItemKind to be used. */ @@ -29,7 +28,6 @@ public enum BillingManifestLineItemKind { TAX; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CancellationMethod.java b/src/main/java/com/maxio/advancedbilling/models/CancellationMethod.java index 640574d6..e9574279 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CancellationMethod.java +++ b/src/main/java/com/maxio/advancedbilling/models/CancellationMethod.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CancellationMethod to be used. */ @@ -29,7 +28,6 @@ public enum CancellationMethod { IMPORTED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CancellationOptions.java b/src/main/java/com/maxio/advancedbilling/models/CancellationOptions.java index 1c729bbb..487296d1 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CancellationOptions.java +++ b/src/main/java/com/maxio/advancedbilling/models/CancellationOptions.java @@ -144,7 +144,7 @@ public void setCancelAtEndOfPeriod(Boolean cancelAtEndOfPeriod) { /** * Internal Getter for ScheduledCancellationAt. - * Schedules the cancellation on the provided date. This is option is not applicable for prepaid + * Schedules the cancellation on the provided date. This option is not applicable for prepaid * subscriptions. To use this option, the Schedule Subscription Cancellation feature must be * enabled on your site. * @return Returns the Internal ZonedDateTime @@ -158,7 +158,7 @@ protected OptionalNullable internalGetScheduledCancellationAt() { /** * Getter for ScheduledCancellationAt. - * Schedules the cancellation on the provided date. This is option is not applicable for prepaid + * Schedules the cancellation on the provided date. This option is not applicable for prepaid * subscriptions. To use this option, the Schedule Subscription Cancellation feature must be * enabled on your site. * @return Returns the ZonedDateTime @@ -169,7 +169,7 @@ public ZonedDateTime getScheduledCancellationAt() { /** * Setter for ScheduledCancellationAt. - * Schedules the cancellation on the provided date. This is option is not applicable for prepaid + * Schedules the cancellation on the provided date. This option is not applicable for prepaid * subscriptions. To use this option, the Schedule Subscription Cancellation feature must be * enabled on your site. * @param scheduledCancellationAt Value for ZonedDateTime @@ -182,7 +182,7 @@ public void setScheduledCancellationAt(ZonedDateTime scheduledCancellationAt) { /** * UnSetter for ScheduledCancellationAt. - * Schedules the cancellation on the provided date. This is option is not applicable for prepaid + * Schedules the cancellation on the provided date. This option is not applicable for prepaid * subscriptions. To use this option, the Schedule Subscription Cancellation feature must be * enabled on your site. */ diff --git a/src/main/java/com/maxio/advancedbilling/models/CardType.java b/src/main/java/com/maxio/advancedbilling/models/CardType.java index 7882ab6e..20d0ad87 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CardType.java +++ b/src/main/java/com/maxio/advancedbilling/models/CardType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CardType to be used. */ @@ -89,7 +88,6 @@ public enum CardType { LASER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ChargebackStatus.java b/src/main/java/com/maxio/advancedbilling/models/ChargebackStatus.java index 112f97fb..717eb6e8 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ChargebackStatus.java +++ b/src/main/java/com/maxio/advancedbilling/models/ChargebackStatus.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ChargebackStatus to be used. */ @@ -25,7 +24,6 @@ public enum ChargebackStatus { CLOSED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CleanupScope.java b/src/main/java/com/maxio/advancedbilling/models/CleanupScope.java index f3999e98..461fc884 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CleanupScope.java +++ b/src/main/java/com/maxio/advancedbilling/models/CleanupScope.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CleanupScope to be used. */ @@ -21,7 +20,6 @@ public enum CleanupScope { CUSTOMERS; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CollectionMethod.java b/src/main/java/com/maxio/advancedbilling/models/CollectionMethod.java index fb0674bd..bc922951 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CollectionMethod.java +++ b/src/main/java/com/maxio/advancedbilling/models/CollectionMethod.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CollectionMethod to be used. */ @@ -25,7 +24,6 @@ public enum CollectionMethod { INVOICE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CollectionMethod1.java b/src/main/java/com/maxio/advancedbilling/models/CollectionMethod1.java new file mode 100644 index 00000000..05347d69 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/CollectionMethod1.java @@ -0,0 +1,94 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + +/** + * CollectionMethod1 to be used. + */ +public enum CollectionMethod1 { + AUTOMATIC, + + REMITTANCE, + + PREPAID; + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + AUTOMATIC.value = "automatic"; + REMITTANCE.value = "remittance"; + PREPAID.value = "prepaid"; + + valueMap.put("automatic", AUTOMATIC); + valueMap.put("remittance", REMITTANCE); + valueMap.put("prepaid", PREPAID); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static CollectionMethod1 constructFromString(String toConvert) throws IOException { + CollectionMethod1 enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static CollectionMethod1 fromString(String toConvert) { + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + return value.toString(); + } + + /** + * Convert list of CollectionMethod1 values to list of string values. + * @param toConvert The list of CollectionMethod1 values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (CollectionMethod1 enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/Component.java b/src/main/java/com/maxio/advancedbilling/models/Component.java index 0ad385d8..c02f47d7 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Component.java +++ b/src/main/java/com/maxio/advancedbilling/models/Component.java @@ -57,6 +57,7 @@ public class Component private Integer eventBasedBillingMetricId; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Default constructor. @@ -101,6 +102,7 @@ public Component() { * @param eventBasedBillingMetricId Integer value for eventBasedBillingMetricId. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ public Component( Integer id, @@ -137,7 +139,8 @@ public Component( String accountingCode, Integer eventBasedBillingMetricId, Integer interval, - IntervalUnit intervalUnit) { + IntervalUnit intervalUnit, + String unspscCode) { this.id = id; this.name = name; this.handle = OptionalNullable.of(handle); @@ -173,6 +176,7 @@ public Component( this.eventBasedBillingMetricId = eventBasedBillingMetricId; this.interval = interval; this.intervalUnit = OptionalNullable.of(intervalUnit); + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -212,6 +216,7 @@ public Component( * @param eventBasedBillingMetricId Integer value for eventBasedBillingMetricId. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ protected Component(Integer id, String name, OptionalNullable handle, @@ -231,7 +236,7 @@ protected Component(Integer id, String name, OptionalNullable handle, OptionalNullable itemCategory, OptionalNullable useSiteExchangeRate, OptionalNullable accountingCode, Integer eventBasedBillingMetricId, Integer interval, - OptionalNullable intervalUnit) { + OptionalNullable intervalUnit, OptionalNullable unspscCode) { this.id = id; this.name = name; this.handle = handle; @@ -267,6 +272,7 @@ protected Component(Integer id, String name, OptionalNullable handle, this.eventBasedBillingMetricId = eventBasedBillingMetricId; this.interval = interval; this.intervalUnit = intervalUnit; + this.unspscCode = unspscCode; } /** @@ -294,7 +300,7 @@ public void setId(Integer id) { /** * Getter for Name. - * The name of the Component, suitable for display on statements. i.e. Text Messages. + * The name of the Component, suitable for display on statements. e.g., Text Messages. * @return Returns the String */ @JsonGetter("name") @@ -305,7 +311,7 @@ public String getName() { /** * Setter for Name. - * The name of the Component, suitable for display on statements. i.e. Text Messages. + * The name of the Component, suitable for display on statements. e.g., Text Messages. * @param name Value for String */ @JsonSetter("name") @@ -389,7 +395,7 @@ public void unsetPricingScheme() { /** * Getter for UnitName. - * The name of the unit that the component’s usage is measured in. i.e. message + * The name of the unit that the component’s usage is measured in. e.g., message * @return Returns the String */ @JsonGetter("unit_name") @@ -400,7 +406,7 @@ public String getUnitName() { /** * Setter for UnitName. - * The name of the unit that the component’s usage is measured in. i.e. message + * The name of the unit that the component’s usage is measured in. e.g., message * @param unitName Value for String */ @JsonSetter("unit_name") @@ -516,7 +522,7 @@ public void setProductFamilyHandle(String productFamilyHandle) { /** * Internal Getter for PricePerUnitInCents. - * deprecated - use unit_price instead + * deprecated - use unit_price instead. * @return Returns the Internal Long */ @JsonGetter("price_per_unit_in_cents") @@ -528,7 +534,7 @@ protected OptionalNullable internalGetPricePerUnitInCents() { /** * Getter for PricePerUnitInCents. - * deprecated - use unit_price instead + * deprecated - use unit_price instead. * @return Returns the Long */ public Long getPricePerUnitInCents() { @@ -537,7 +543,7 @@ public Long getPricePerUnitInCents() { /** * Setter for PricePerUnitInCents. - * deprecated - use unit_price instead + * deprecated - use unit_price instead. * @param pricePerUnitInCents Value for Long */ @JsonSetter("price_per_unit_in_cents") @@ -547,7 +553,7 @@ public void setPricePerUnitInCents(Long pricePerUnitInCents) { /** * UnSetter for PricePerUnitInCents. - * deprecated - use unit_price instead + * deprecated - use unit_price instead. */ public void unsetPricePerUnitInCents() { pricePerUnitInCents = null; @@ -1273,8 +1279,8 @@ public void setEventBasedBillingMetricId(Integer eventBasedBillingMetricId) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this component's default price point would renew every 30 days. This property is only + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this component’s default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @return Returns the Integer */ @@ -1286,8 +1292,8 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this component's default price point would renew every 30 days. This property is only + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this component’s default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @param interval Value for Integer */ @@ -1339,6 +1345,53 @@ public void unsetIntervalUnit() { intervalUnit = null; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this Component into string format. * @return String representation of this class @@ -1362,7 +1415,8 @@ public String toString() { + itemCategory + ", useSiteExchangeRate=" + useSiteExchangeRate + ", accountingCode=" + accountingCode + ", eventBasedBillingMetricId=" + eventBasedBillingMetricId + ", interval=" + interval + ", intervalUnit=" - + intervalUnit + ", additionalProperties=" + getAdditionalProperties() + "]"; + + intervalUnit + ", unspscCode=" + unspscCode + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -1407,6 +1461,7 @@ public Builder toBuilder() { builder.useSiteExchangeRate = internalGetUseSiteExchangeRate(); builder.accountingCode = internalGetAccountingCode(); builder.intervalUnit = internalGetIntervalUnit(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -1449,6 +1504,7 @@ public static class Builder { private Integer eventBasedBillingMetricId; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; @@ -1955,6 +2011,25 @@ public Builder unsetIntervalUnit() { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link Component} object using the set fields. * @return {@link Component} @@ -1967,7 +2042,7 @@ public Component build() { recurring, upgradeCharge, downgradeCredit, createdAt, updatedAt, archivedAt, hideDateRangeOnInvoice, allowFractionalQuantities, itemCategory, useSiteExchangeRate, accountingCode, eventBasedBillingMetricId, interval, - intervalUnit); + intervalUnit, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ComponentCustomPrice.java b/src/main/java/com/maxio/advancedbilling/models/ComponentCustomPrice.java index 07f21a38..2e542190 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ComponentCustomPrice.java +++ b/src/main/java/com/maxio/advancedbilling/models/ComponentCustomPrice.java @@ -133,7 +133,7 @@ public void setTaxIncluded(Boolean taxIncluded) { /** * Getter for PricingScheme. - * Omit for On/Off components + * Omit for On/Off components. * @return Returns the PricingScheme */ @JsonGetter("pricing_scheme") @@ -144,7 +144,7 @@ public PricingScheme getPricingScheme() { /** * Setter for PricingScheme. - * Omit for On/Off components + * Omit for On/Off components. * @param pricingScheme Value for PricingScheme */ @JsonSetter("pricing_scheme") @@ -154,7 +154,7 @@ public void setPricingScheme(PricingScheme pricingScheme) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -167,7 +167,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer @@ -222,7 +222,7 @@ public void unsetIntervalUnit() { /** * Internal Getter for ListPricePointId. - * Optional id of the price point to use for list price calculations when overriding the + * (Optional) Id of the price point to use for list price calculations when overriding the * customer price. * @return Returns the Internal Integer */ @@ -235,7 +235,7 @@ protected OptionalNullable internalGetListPricePointId() { /** * Getter for ListPricePointId. - * Optional id of the price point to use for list price calculations when overriding the + * (Optional) Id of the price point to use for list price calculations when overriding the * customer price. * @return Returns the Integer */ @@ -245,7 +245,7 @@ public Integer getListPricePointId() { /** * Setter for ListPricePointId. - * Optional id of the price point to use for list price calculations when overriding the + * (Optional) Id of the price point to use for list price calculations when overriding the * customer price. * @param listPricePointId Value for Integer */ @@ -256,7 +256,7 @@ public void setListPricePointId(Integer listPricePointId) { /** * UnSetter for ListPricePointId. - * Optional id of the price point to use for list price calculations when overriding the + * (Optional) Id of the price point to use for list price calculations when overriding the * customer price. */ public void unsetListPricePointId() { diff --git a/src/main/java/com/maxio/advancedbilling/models/ComponentKind.java b/src/main/java/com/maxio/advancedbilling/models/ComponentKind.java index 7d83abe1..e5833311 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ComponentKind.java +++ b/src/main/java/com/maxio/advancedbilling/models/ComponentKind.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ComponentKind to be used. */ @@ -27,7 +26,6 @@ public enum ComponentKind { EVENT_BASED_COMPONENT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ComponentPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/ComponentPricePoint.java index bc2da494..44fe2c9c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ComponentPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/ComponentPricePoint.java @@ -237,7 +237,7 @@ public void setType(PricePointType type) { /** * Getter for Default. - * Note: Refer to type attribute instead + * Note: Refer to type attribute instead. * @return Returns the Boolean */ @JsonGetter("default") @@ -248,7 +248,7 @@ public Boolean getDefault() { /** * Setter for Default. - * Note: Refer to type attribute instead + * Note: Refer to type attribute instead. * @param mDefault Value for Boolean */ @JsonSetter("default") @@ -518,7 +518,7 @@ public void setTaxIncluded(Boolean taxIncluded) { /** * Internal Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Internal Integer @@ -532,7 +532,7 @@ protected OptionalNullable internalGetInterval() { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -543,7 +543,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer @@ -555,7 +555,7 @@ public void setInterval(Integer interval) { /** * UnSetter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. */ diff --git a/src/main/java/com/maxio/advancedbilling/models/ComponentPricePointItem.java b/src/main/java/com/maxio/advancedbilling/models/ComponentPricePointItem.java index c95f0269..7b36ea0e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ComponentPricePointItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/ComponentPricePointItem.java @@ -141,7 +141,7 @@ public void setPricingScheme(PricingScheme pricingScheme) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -154,7 +154,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/CompoundingStrategy.java b/src/main/java/com/maxio/advancedbilling/models/CompoundingStrategy.java index 72deeac9..00df582b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CompoundingStrategy.java +++ b/src/main/java/com/maxio/advancedbilling/models/CompoundingStrategy.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CompoundingStrategy to be used. */ @@ -21,7 +20,6 @@ public enum CompoundingStrategy { FULLPRICE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CouponPayload.java b/src/main/java/com/maxio/advancedbilling/models/CouponPayload.java index 0c73924a..2d1386b0 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CouponPayload.java +++ b/src/main/java/com/maxio/advancedbilling/models/CouponPayload.java @@ -117,7 +117,7 @@ public void setName(String name) { * Getter for Code. * Required when creating a new coupon. The code is limited to 255 characters. May contain * uppercase alphanumeric characters and these special characters (which allow for email - * addresses to be used): “%”, “{@literal @}”, “+”, “-”, “_”, and “.” + * addresses to be used): “%”, “{@literal @}”, “+”, “-”, “_”, and “.”. * @return Returns the String */ @JsonGetter("code") @@ -130,7 +130,7 @@ public String getCode() { * Setter for Code. * Required when creating a new coupon. The code is limited to 255 characters. May contain * uppercase alphanumeric characters and these special characters (which allow for email - * addresses to be used): “%”, “{@literal @}”, “+”, “-”, “_”, and “.” + * addresses to be used): “%”, “{@literal @}”, “+”, “-”, “_”, and “.”. * @param code Value for String */ @JsonSetter("code") @@ -164,7 +164,7 @@ public void setDescription(String description) { /** * Getter for Percentage. * Required when creating a new percentage coupon. Can't be used together with amount_in_cents. - * Percentage discount + * Percentage discount. * @return Returns the CouponPayloadPercentage */ @JsonGetter("percentage") @@ -176,7 +176,7 @@ public CouponPayloadPercentage getPercentage() { /** * Setter for Percentage. * Required when creating a new percentage coupon. Can't be used together with amount_in_cents. - * Percentage discount + * Percentage discount. * @param percentage Value for CouponPayloadPercentage */ @JsonSetter("percentage") @@ -187,7 +187,7 @@ public void setPercentage(CouponPayloadPercentage percentage) { /** * Getter for AmountInCents. * Required when creating a new flat amount coupon. Can't be used together with percentage. Flat - * USD discount + * USD discount. * @return Returns the Long */ @JsonGetter("amount_in_cents") @@ -199,7 +199,7 @@ public Long getAmountInCents() { /** * Setter for AmountInCents. * Required when creating a new flat amount coupon. Can't be used together with percentage. Flat - * USD discount + * USD discount. * @param amountInCents Value for Long */ @JsonSetter("amount_in_cents") diff --git a/src/main/java/com/maxio/advancedbilling/models/CouponRequest.java b/src/main/java/com/maxio/advancedbilling/models/CouponRequest.java index 8b59ca7f..530296f9 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CouponRequest.java +++ b/src/main/java/com/maxio/advancedbilling/models/CouponRequest.java @@ -64,7 +64,7 @@ public void setCoupon(CouponPayload coupon) { /** * Getter for RestrictedProducts. * An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values - * are booleans indicating if the coupon should be applicable to the product + * are booleans indicating if the coupon should be applicable to the product. * @return Returns the Map of String, Boolean */ @JsonGetter("restricted_products") @@ -76,7 +76,7 @@ public Map getRestrictedProducts() { /** * Setter for RestrictedProducts. * An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values - * are booleans indicating if the coupon should be applicable to the product + * are booleans indicating if the coupon should be applicable to the product. * @param restrictedProducts Value for Map of String, Boolean */ @JsonSetter("restricted_products") @@ -87,7 +87,7 @@ public void setRestrictedProducts(Map restrictedProducts) { /** * Getter for RestrictedComponents. * An object where the keys are component IDs or handles (prefixed with 'handle:'), and the - * values are booleans indicating if the coupon should be applicable to the component + * values are booleans indicating if the coupon should be applicable to the component. * @return Returns the Map of String, Boolean */ @JsonGetter("restricted_components") @@ -99,7 +99,7 @@ public Map getRestrictedComponents() { /** * Setter for RestrictedComponents. * An object where the keys are component IDs or handles (prefixed with 'handle:'), and the - * values are booleans indicating if the coupon should be applicable to the component + * values are booleans indicating if the coupon should be applicable to the component. * @param restrictedComponents Value for Map of String, Boolean */ @JsonSetter("restricted_components") diff --git a/src/main/java/com/maxio/advancedbilling/models/CouponUsage.java b/src/main/java/com/maxio/advancedbilling/models/CouponUsage.java index 625b1841..11276e41 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CouponUsage.java +++ b/src/main/java/com/maxio/advancedbilling/models/CouponUsage.java @@ -225,7 +225,7 @@ public void unsetSavingsInCents() { /** * Internal Getter for Revenue. - * Total revenue of the all subscriptions that have received a discount from this coupon. + * Total revenue of all subscriptions that have received a discount from this coupon. * @return Returns the Internal Integer */ @JsonGetter("revenue") @@ -237,7 +237,7 @@ protected OptionalNullable internalGetRevenue() { /** * Getter for Revenue. - * Total revenue of the all subscriptions that have received a discount from this coupon. + * Total revenue of all subscriptions that have received a discount from this coupon. * @return Returns the Integer */ public Integer getRevenue() { @@ -246,7 +246,7 @@ public Integer getRevenue() { /** * Setter for Revenue. - * Total revenue of the all subscriptions that have received a discount from this coupon. + * Total revenue of all subscriptions that have received a discount from this coupon. * @param revenue Value for Integer */ @JsonSetter("revenue") @@ -256,7 +256,7 @@ public void setRevenue(Integer revenue) { /** * UnSetter for Revenue. - * Total revenue of the all subscriptions that have received a discount from this coupon. + * Total revenue of all subscriptions that have received a discount from this coupon. */ public void unsetRevenue() { revenue = null; @@ -264,7 +264,7 @@ public void unsetRevenue() { /** * Getter for RevenueInCents. - * Total revenue of the all subscriptions that have received a discount from this coupon. + * Total revenue of all subscriptions that have received a discount from this coupon. * @return Returns the Long */ @JsonGetter("revenue_in_cents") @@ -275,7 +275,7 @@ public Long getRevenueInCents() { /** * Setter for RevenueInCents. - * Total revenue of the all subscriptions that have received a discount from this coupon. + * Total revenue of all subscriptions that have received a discount from this coupon. * @param revenueInCents Value for Long */ @JsonSetter("revenue_in_cents") diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java b/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java index 3a62a333..da488e51 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java @@ -139,7 +139,7 @@ protected CreateAllocation(double quantity, String decimalQuantity, Double previ * Getter for Quantity. * The allocated quantity to which to set the line-items allocated quantity. By default, this is * an integer. If decimal allocations are enabled for the component, it will be a decimal - * number. For On/Off components, use 1for on and 0 for off. + * number. For On/Off components, use 1 for on and 0 for off. * @return Returns the double */ @JsonGetter("quantity") @@ -151,7 +151,7 @@ public double getQuantity() { * Setter for Quantity. * The allocated quantity to which to set the line-items allocated quantity. By default, this is * an integer. If decimal allocations are enabled for the component, it will be a decimal - * number. For On/Off components, use 1for on and 0 for off. + * number. For On/Off components, use 1 for on and 0 for off. * @param quantity Value for double */ @JsonSetter("quantity") diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateComponentPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/CreateComponentPricePoint.java index b4430bd9..2d21a019 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateComponentPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateComponentPricePoint.java @@ -236,7 +236,7 @@ public void setTaxIncluded(Boolean taxIncluded) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this price point would renew every 30 days. This property is only available for sites * with Multifrequency enabled. * @return Returns the Integer @@ -249,7 +249,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this price point would renew every 30 days. This property is only available for sites * with Multifrequency enabled. * @param interval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateCustomer.java b/src/main/java/com/maxio/advancedbilling/models/CreateCustomer.java index 8d68b548..073d6ee2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateCustomer.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateCustomer.java @@ -34,9 +34,11 @@ public class CreateCustomer private String locale; private String vatNumber; private Boolean taxExempt; + private Boolean surcharging; private String taxExemptReason; private OptionalNullable parentId; private OptionalNullable salesforceId; + private OptionalNullable brandingThemeId; /** * Default constructor. @@ -62,9 +64,11 @@ public CreateCustomer() { * @param locale String value for locale. * @param vatNumber String value for vatNumber. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param taxExemptReason String value for taxExemptReason. * @param parentId Integer value for parentId. * @param salesforceId String value for salesforceId. + * @param brandingThemeId Integer value for brandingThemeId. */ public CreateCustomer( String firstName, @@ -83,9 +87,11 @@ public CreateCustomer( String locale, String vatNumber, Boolean taxExempt, + Boolean surcharging, String taxExemptReason, Integer parentId, - String salesforceId) { + String salesforceId, + Integer brandingThemeId) { this.firstName = firstName; this.lastName = lastName; this.email = email; @@ -102,9 +108,11 @@ public CreateCustomer( this.locale = locale; this.vatNumber = vatNumber; this.taxExempt = taxExempt; + this.surcharging = surcharging; this.taxExemptReason = taxExemptReason; this.parentId = OptionalNullable.of(parentId); this.salesforceId = OptionalNullable.of(salesforceId); + this.brandingThemeId = OptionalNullable.of(brandingThemeId); } /** @@ -125,16 +133,19 @@ public CreateCustomer( * @param locale String value for locale. * @param vatNumber String value for vatNumber. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param taxExemptReason String value for taxExemptReason. * @param parentId Integer value for parentId. * @param salesforceId String value for salesforceId. + * @param brandingThemeId Integer value for brandingThemeId. */ protected CreateCustomer(String firstName, String lastName, String email, String ccEmails, String organization, String reference, String address, String address2, String city, String state, String zip, String country, String phone, String locale, String vatNumber, - Boolean taxExempt, String taxExemptReason, OptionalNullable parentId, - OptionalNullable salesforceId) { + Boolean taxExempt, Boolean surcharging, String taxExemptReason, + OptionalNullable parentId, OptionalNullable salesforceId, + OptionalNullable brandingThemeId) { this.firstName = firstName; this.lastName = lastName; this.email = email; @@ -151,9 +162,11 @@ protected CreateCustomer(String firstName, String lastName, String email, String this.locale = locale; this.vatNumber = vatNumber; this.taxExempt = taxExempt; + this.surcharging = surcharging; this.taxExemptReason = taxExemptReason; this.parentId = parentId; this.salesforceId = salesforceId; + this.brandingThemeId = brandingThemeId; } /** @@ -459,6 +472,29 @@ public void setTaxExempt(Boolean taxExempt) { this.taxExempt = taxExempt; } + /** + * Getter for Surcharging. + * Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only + * applied on sites where surcharging control is enabled. + * @return Returns the Boolean + */ + @JsonGetter("surcharging") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getSurcharging() { + return surcharging; + } + + /** + * Setter for Surcharging. + * Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only + * applied on sites where surcharging control is enabled. + * @param surcharging Value for Boolean + */ + @JsonSetter("surcharging") + public void setSurcharging(Boolean surcharging) { + this.surcharging = surcharging; + } + /** * Getter for TaxExemptReason. * @return Returns the String @@ -556,6 +592,57 @@ public void unsetSalesforceId() { salesforceId = null; } + /** + * Internal Getter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @return Returns the Internal Integer + */ + @JsonGetter("branding_theme_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBrandingThemeId() { + return this.brandingThemeId; + } + + /** + * Getter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @return Returns the Integer + */ + public Integer getBrandingThemeId() { + return OptionalNullable.getFrom(brandingThemeId); + } + + /** + * Setter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @param brandingThemeId Value for Integer + */ + @JsonSetter("branding_theme_id") + public void setBrandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + } + + /** + * UnSetter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + */ + public void unsetBrandingThemeId() { + brandingThemeId = null; + } + /** * Converts this CreateCustomer into string format. * @return String representation of this class @@ -567,9 +654,10 @@ public String toString() { + ", reference=" + reference + ", address=" + address + ", address2=" + address2 + ", city=" + city + ", state=" + state + ", zip=" + zip + ", country=" + country + ", phone=" + phone + ", locale=" + locale + ", vatNumber=" + vatNumber - + ", taxExempt=" + taxExempt + ", taxExemptReason=" + taxExemptReason - + ", parentId=" + parentId + ", salesforceId=" + salesforceId - + ", additionalProperties=" + getAdditionalProperties() + "]"; + + ", taxExempt=" + taxExempt + ", surcharging=" + surcharging + ", taxExemptReason=" + + taxExemptReason + ", parentId=" + parentId + ", salesforceId=" + salesforceId + + ", brandingThemeId=" + brandingThemeId + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -592,9 +680,11 @@ public Builder toBuilder() { .locale(getLocale()) .vatNumber(getVatNumber()) .taxExempt(getTaxExempt()) + .surcharging(getSurcharging()) .taxExemptReason(getTaxExemptReason()); builder.parentId = internalGetParentId(); builder.salesforceId = internalGetSalesforceId(); + builder.brandingThemeId = internalGetBrandingThemeId(); return builder; } @@ -618,9 +708,11 @@ public static class Builder { private String locale; private String vatNumber; private Boolean taxExempt; + private Boolean surcharging; private String taxExemptReason; private OptionalNullable parentId; private OptionalNullable salesforceId; + private OptionalNullable brandingThemeId; /** * Initialization constructor. @@ -800,6 +892,16 @@ public Builder taxExempt(Boolean taxExempt) { return this; } + /** + * Setter for surcharging. + * @param surcharging Boolean value for surcharging. + * @return Builder + */ + public Builder surcharging(Boolean surcharging) { + this.surcharging = surcharging; + return this; + } + /** * Setter for taxExemptReason. * @param taxExemptReason String value for taxExemptReason. @@ -848,6 +950,25 @@ public Builder unsetSalesforceId() { return this; } + /** + * Setter for brandingThemeId. + * @param brandingThemeId Integer value for brandingThemeId. + * @return Builder + */ + public Builder brandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + return this; + } + + /** + * UnSetter for brandingThemeId. + * @return Builder + */ + public Builder unsetBrandingThemeId() { + brandingThemeId = null; + return this; + } + /** * Builds a new {@link CreateCustomer} object using the set fields. * @return {@link CreateCustomer} @@ -855,7 +976,8 @@ public Builder unsetSalesforceId() { public CreateCustomer build() { return new CreateCustomer(firstName, lastName, email, ccEmails, organization, reference, address, address2, city, state, zip, country, phone, locale, vatNumber, - taxExempt, taxExemptReason, parentId, salesforceId); + taxExempt, surcharging, taxExemptReason, parentId, salesforceId, + brandingThemeId); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateInvoice.java b/src/main/java/com/maxio/advancedbilling/models/CreateInvoice.java index 88696e38..dcfe2a1d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateInvoice.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateInvoice.java @@ -188,7 +188,7 @@ public void setMemo(String memo) { /** * Getter for SellerAddress. - * Overrides the defaults for the site + * Overrides the defaults for the site. * @return Returns the CreateInvoiceAddress */ @JsonGetter("seller_address") @@ -199,7 +199,7 @@ public CreateInvoiceAddress getSellerAddress() { /** * Setter for SellerAddress. - * Overrides the defaults for the site + * Overrides the defaults for the site. * @param sellerAddress Value for CreateInvoiceAddress */ @JsonSetter("seller_address") @@ -209,7 +209,7 @@ public void setSellerAddress(CreateInvoiceAddress sellerAddress) { /** * Getter for BillingAddress. - * Overrides the default for the customer + * Overrides the default for the customer. * @return Returns the CreateInvoiceAddress */ @JsonGetter("billing_address") @@ -220,7 +220,7 @@ public CreateInvoiceAddress getBillingAddress() { /** * Setter for BillingAddress. - * Overrides the default for the customer + * Overrides the default for the customer. * @param billingAddress Value for CreateInvoiceAddress */ @JsonSetter("billing_address") @@ -230,7 +230,7 @@ public void setBillingAddress(CreateInvoiceAddress billingAddress) { /** * Getter for ShippingAddress. - * Overrides the default for the customer + * Overrides the default for the customer. * @return Returns the CreateInvoiceAddress */ @JsonGetter("shipping_address") @@ -241,7 +241,7 @@ public CreateInvoiceAddress getShippingAddress() { /** * Setter for ShippingAddress. - * Overrides the default for the customer + * Overrides the default for the customer. * @param shippingAddress Value for CreateInvoiceAddress */ @JsonSetter("shipping_address") diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceItem.java b/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceItem.java index c546fb24..0e3ff1b3 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceItem.java @@ -105,7 +105,7 @@ public void setTitle(String title) { /** * Getter for Quantity. - * The quantity can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you + * The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you * submit a value with more than 8 decimal places, we will round it down to the 8th decimal * place. * @return Returns the CreateInvoiceItemQuantity @@ -118,7 +118,7 @@ public CreateInvoiceItemQuantity getQuantity() { /** * Setter for Quantity. - * The quantity can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you + * The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you * submit a value with more than 8 decimal places, we will round it down to the 8th decimal * place. * @param quantity Value for CreateInvoiceItemQuantity @@ -130,7 +130,7 @@ public void setQuantity(CreateInvoiceItemQuantity quantity) { /** * Getter for UnitPrice. - * The unit_price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you + * The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you * submit a value with more than 8 decimal places, we will round it down to the 8th decimal * place. * @return Returns the CreateInvoiceItemUnitPrice @@ -143,7 +143,7 @@ public CreateInvoiceItemUnitPrice getUnitPrice() { /** * Setter for UnitPrice. - * The unit_price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you + * The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you * submit a value with more than 8 decimal places, we will round it down to the 8th decimal * place. * @param unitPrice Value for CreateInvoiceItemUnitPrice diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceStatus.java b/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceStatus.java index ed0c595e..67fa8c8f 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceStatus.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateInvoiceStatus.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CreateInvoiceStatus to be used. */ @@ -21,7 +20,6 @@ public enum CreateInvoiceStatus { OPEN; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateEndpointRequest.java b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateEndpointRequest.java index 7f9cb8f8..c2592bd5 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateEndpointRequest.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateEndpointRequest.java @@ -34,7 +34,7 @@ public CreateOrUpdateEndpointRequest( /** * Getter for Endpoint. - * Used to Create or Update Endpoint + * Used to Create or Update Endpoint. * @return Returns the CreateOrUpdateEndpoint */ @JsonGetter("endpoint") @@ -44,7 +44,7 @@ public CreateOrUpdateEndpoint getEndpoint() { /** * Setter for Endpoint. - * Used to Create or Update Endpoint + * Used to Create or Update Endpoint. * @param endpoint Value for CreateOrUpdateEndpoint */ @JsonSetter("endpoint") diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java index 479b069b..b63c87bf 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java @@ -34,6 +34,7 @@ public class CreateOrUpdateProduct private OptionalNullable expirationIntervalUnit; private Boolean autoCreateSignupPage; private String taxCode; + private OptionalNullable unspscCode; /** * Default constructor. @@ -59,6 +60,7 @@ public CreateOrUpdateProduct() { * @param expirationIntervalUnit ExpirationIntervalUnit value for expirationIntervalUnit. * @param autoCreateSignupPage Boolean value for autoCreateSignupPage. * @param taxCode String value for taxCode. + * @param unspscCode String value for unspscCode. */ public CreateOrUpdateProduct( String name, @@ -76,7 +78,8 @@ public CreateOrUpdateProduct( Integer expirationInterval, ExpirationIntervalUnit expirationIntervalUnit, Boolean autoCreateSignupPage, - String taxCode) { + String taxCode, + String unspscCode) { this.name = name; this.handle = handle; this.description = description; @@ -93,6 +96,7 @@ public CreateOrUpdateProduct( this.expirationIntervalUnit = OptionalNullable.of(expirationIntervalUnit); this.autoCreateSignupPage = autoCreateSignupPage; this.taxCode = taxCode; + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -113,6 +117,7 @@ public CreateOrUpdateProduct( * @param expirationIntervalUnit ExpirationIntervalUnit value for expirationIntervalUnit. * @param autoCreateSignupPage Boolean value for autoCreateSignupPage. * @param taxCode String value for taxCode. + * @param unspscCode String value for unspscCode. */ protected CreateOrUpdateProduct(String name, String description, long priceInCents, @@ -121,7 +126,7 @@ protected CreateOrUpdateProduct(String name, String description, long priceInCen OptionalNullable trialIntervalUnit, OptionalNullable trialType, Integer expirationInterval, OptionalNullable expirationIntervalUnit, - Boolean autoCreateSignupPage, String taxCode) { + Boolean autoCreateSignupPage, String taxCode, OptionalNullable unspscCode) { this.name = name; this.handle = handle; this.description = description; @@ -138,6 +143,7 @@ protected CreateOrUpdateProduct(String name, String description, long priceInCen this.expirationIntervalUnit = expirationIntervalUnit; this.autoCreateSignupPage = autoCreateSignupPage; this.taxCode = taxCode; + this.unspscCode = unspscCode; } /** @@ -267,8 +273,8 @@ public void setPriceInCents(long priceInCents) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product would renew every 30 days. * @return Returns the int */ @JsonGetter("interval") @@ -278,8 +284,8 @@ public int getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product would renew every 30 days. * @param interval Value for int */ @JsonSetter("interval") @@ -330,7 +336,7 @@ public void setTrialPriceInCents(Long trialPriceInCents) { /** * Getter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of * day would mean this product trial would last 30 days. * @return Returns the Integer */ @@ -342,7 +348,7 @@ public Integer getTrialInterval() { /** * Setter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of * day would mean this product trial would last 30 days. * @param trialInterval Value for Integer */ @@ -392,7 +398,7 @@ public void unsetTrialIntervalUnit() { /** * Internal Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -408,7 +414,7 @@ protected OptionalNullable internalGetTrialType() { /** * Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -421,7 +427,7 @@ public TrialType getTrialType() { /** * Setter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -435,7 +441,7 @@ public void setTrialType(TrialType trialType) { /** * UnSetter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -447,7 +453,7 @@ public void unsetTrialType() { /** * Getter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product would expire after 30 days. * @return Returns the Integer */ @@ -459,7 +465,7 @@ public Integer getExpirationInterval() { /** * Setter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product would expire after 30 days. * @param expirationInterval Value for Integer */ @@ -553,6 +559,53 @@ public void setTaxCode(String taxCode) { this.taxCode = taxCode; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this CreateOrUpdateProduct into string format. * @return String representation of this class @@ -567,7 +620,8 @@ public String toString() { + trialIntervalUnit + ", trialType=" + trialType + ", expirationInterval=" + expirationInterval + ", expirationIntervalUnit=" + expirationIntervalUnit + ", autoCreateSignupPage=" + autoCreateSignupPage + ", taxCode=" + taxCode - + ", additionalProperties=" + getAdditionalProperties() + "]"; + + ", unspscCode=" + unspscCode + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -588,6 +642,7 @@ public Builder toBuilder() { builder.trialIntervalUnit = internalGetTrialIntervalUnit(); builder.trialType = internalGetTrialType(); builder.expirationIntervalUnit = internalGetExpirationIntervalUnit(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -611,6 +666,7 @@ public static class Builder { private OptionalNullable expirationIntervalUnit; private Boolean autoCreateSignupPage; private String taxCode; + private OptionalNullable unspscCode; /** * Initialization constructor. @@ -822,6 +878,25 @@ public Builder taxCode(String taxCode) { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link CreateOrUpdateProduct} object using the set fields. * @return {@link CreateOrUpdateProduct} @@ -830,7 +905,7 @@ public CreateOrUpdateProduct build() { return new CreateOrUpdateProduct(name, description, priceInCents, interval, intervalUnit, handle, accountingCode, requireCreditCard, trialPriceInCents, trialInterval, trialIntervalUnit, trialType, expirationInterval, - expirationIntervalUnit, autoCreateSignupPage, taxCode); + expirationIntervalUnit, autoCreateSignupPage, taxCode, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateSegmentPrice.java b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateSegmentPrice.java index 91385cfd..609e1760 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateSegmentPrice.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateSegmentPrice.java @@ -82,7 +82,7 @@ public void setEndingQuantity(Integer endingQuantity) { /** * Getter for UnitPrice. - * The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 * @return Returns the CreateOrUpdateSegmentPriceUnitPrice */ @JsonGetter("unit_price") @@ -92,7 +92,7 @@ public CreateOrUpdateSegmentPriceUnitPrice getUnitPrice() { /** * Setter for UnitPrice. - * The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 * @param unitPrice Value for CreateOrUpdateSegmentPriceUnitPrice */ @JsonSetter("unit_price") diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java index 14d19116..6119a9fb 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java @@ -411,7 +411,7 @@ public void setCardType(CardType cardType) { /** * Getter for ExpirationMonth. * (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit - * credit card expiration month, as an integer or string, i.e. 5 + * credit card expiration month, as an integer or string, e.g., 5 * @return Returns the CreatePaymentProfileExpirationMonth */ @JsonGetter("expiration_month") @@ -423,7 +423,7 @@ public CreatePaymentProfileExpirationMonth getExpirationMonth() { /** * Setter for ExpirationMonth. * (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit - * credit card expiration month, as an integer or string, i.e. 5 + * credit card expiration month, as an integer or string, e.g., 5 * @param expirationMonth Value for CreatePaymentProfileExpirationMonth */ @JsonSetter("expiration_month") @@ -433,8 +433,8 @@ public void setExpirationMonth(CreatePaymentProfileExpirationMonth expirationMon /** * Getter for ExpirationYear. - * (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit - * card expiration year, as an integer or string, i.e. 2012 + * (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit + * card expiration year, as an integer or string, e.g., 2012 * @return Returns the CreatePaymentProfileExpirationYear */ @JsonGetter("expiration_year") @@ -445,8 +445,8 @@ public CreatePaymentProfileExpirationYear getExpirationYear() { /** * Setter for ExpirationYear. - * (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit - * card expiration year, as an integer or string, i.e. 2012 + * (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit + * card expiration year, as an integer or string, e.g., 2012 * @param expirationYear Value for CreatePaymentProfileExpirationYear */ @JsonSetter("expiration_year") @@ -456,7 +456,7 @@ public void setExpirationYear(CreatePaymentProfileExpirationYear expirationYear) /** * Getter for BillingAddress. - * The credit card or bank account billing street address (i.e. 123 Main St.). This value is + * The credit card or bank account billing street address (e.g., 123 Main St.). This value is * merely passed through to the payment gateway. * @return Returns the String */ @@ -468,7 +468,7 @@ public String getBillingAddress() { /** * Setter for BillingAddress. - * The credit card or bank account billing street address (i.e. 123 Main St.). This value is + * The credit card or bank account billing street address (e.g., 123 Main St.). This value is * merely passed through to the payment gateway. * @param billingAddress Value for String */ @@ -479,7 +479,7 @@ public void setBillingAddress(String billingAddress) { /** * Internal Getter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address e.g., Apt. 100 * @return Returns the Internal String */ @JsonGetter("billing_address_2") @@ -491,7 +491,7 @@ protected OptionalNullable internalGetBillingAddress2() { /** * Getter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address e.g., Apt. 100 * @return Returns the String */ public String getBillingAddress2() { @@ -500,7 +500,7 @@ public String getBillingAddress2() { /** * Setter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address e.g., Apt. 100 * @param billingAddress2 Value for String */ @JsonSetter("billing_address_2") @@ -510,7 +510,7 @@ public void setBillingAddress2(String billingAddress2) { /** * UnSetter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address e.g., Apt. 100 */ public void unsetBillingAddress2() { billingAddress2 = null; @@ -518,7 +518,7 @@ public void unsetBillingAddress2() { /** * Getter for BillingCity. - * The credit card or bank account billing address city (i.e. “Boston”). This value is merely + * The credit card or bank account billing address city (e.g., “Boston”). This value is merely * passed through to the payment gateway. * @return Returns the String */ @@ -530,7 +530,7 @@ public String getBillingCity() { /** * Setter for BillingCity. - * The credit card or bank account billing address city (i.e. “Boston”). This value is merely + * The credit card or bank account billing address city (e.g., “Boston”). This value is merely * passed through to the payment gateway. * @param billingCity Value for String */ @@ -541,7 +541,7 @@ public void setBillingCity(String billingCity) { /** * Getter for BillingState. - * The credit card or bank account billing address state (i.e. MA). This value is merely passed + * The credit card or bank account billing address state (e.g., MA). This value is merely passed * through to the payment gateway. This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for * tax locale purposes. @@ -555,7 +555,7 @@ public String getBillingState() { /** * Setter for BillingState. - * The credit card or bank account billing address state (i.e. MA). This value is merely passed + * The credit card or bank account billing address state (e.g., MA). This value is merely passed * through to the payment gateway. This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for * tax locale purposes. @@ -568,11 +568,11 @@ public void setBillingState(String billingState) { /** * Getter for BillingCountry. - * The credit card or bank account billing address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is + * “The credit card or bank account billing address country, required in [ISO_3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is * merely passed through to the payment gateway. Some gateways require country codes in a * specific format. Check your gateway’s documentation. If creating an ACH subscription, only US - * is supported at this time. + * is supported at this time.” * @return Returns the String */ @JsonGetter("billing_country") @@ -583,11 +583,11 @@ public String getBillingCountry() { /** * Setter for BillingCountry. - * The credit card or bank account billing address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is + * “The credit card or bank account billing address country, required in [ISO_3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is * merely passed through to the payment gateway. Some gateways require country codes in a * specific format. Check your gateway’s documentation. If creating an ACH subscription, only US - * is supported at this time. + * is supported at this time.” * @param billingCountry Value for String */ @JsonSetter("billing_country") @@ -597,7 +597,7 @@ public void setBillingCountry(String billingCountry) { /** * Getter for BillingZip. - * The credit card or bank account billing address zip code (i.e. 12345). This value is merely + * The credit card or bank account billing address zip code (e.g., 12345). This value is merely * passed through to the payment gateway. * @return Returns the String */ @@ -609,7 +609,7 @@ public String getBillingZip() { /** * Setter for BillingZip. - * The credit card or bank account billing address zip code (i.e. 12345). This value is merely + * The credit card or bank account billing address zip code (e.g., 12345). This value is merely * passed through to the payment gateway. * @param billingZip Value for String */ @@ -834,7 +834,7 @@ public void setBankName(String bankName) { /** * Getter for BankIban. * (Optional when creating with GoCardless, required with Stripe Direct Debit). International - * Bank Account Number. Alternatively, local bank details can be provided + * Bank Account Number. Alternatively, local bank details can be provided. * @return Returns the String */ @JsonGetter("bank_iban") @@ -846,7 +846,7 @@ public String getBankIban() { /** * Setter for BankIban. * (Optional when creating with GoCardless, required with Stripe Direct Debit). International - * Bank Account Number. Alternatively, local bank details can be provided + * Bank Account Number. Alternatively, local bank details can be provided. * @param bankIban Value for String */ @JsonSetter("bank_iban") @@ -857,7 +857,7 @@ public void setBankIban(String bankIban) { /** * Getter for BankRoutingNumber. * (Required when creating with ACH. Optional when creating a subscription with GoCardless). The - * routing number of the bank. It becomes bank_code while passing via GoCardless API + * routing number of the bank. It becomes bank_code while passing via GoCardless API. * @return Returns the String */ @JsonGetter("bank_routing_number") @@ -869,7 +869,7 @@ public String getBankRoutingNumber() { /** * Setter for BankRoutingNumber. * (Required when creating with ACH. Optional when creating a subscription with GoCardless). The - * routing number of the bank. It becomes bank_code while passing via GoCardless API + * routing number of the bank. It becomes bank_code while passing via GoCardless API. * @param bankRoutingNumber Value for String */ @JsonSetter("bank_routing_number") @@ -903,7 +903,7 @@ public void setBankAccountNumber(String bankAccountNumber) { /** * Getter for BankBranchCode. * (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) - * Branch/Sort code. Alternatively, an IBAN can be provided + * Branch/Sort code. Alternatively, an IBAN can be provided. * @return Returns the String */ @JsonGetter("bank_branch_code") @@ -915,7 +915,7 @@ public String getBankBranchCode() { /** * Setter for BankBranchCode. * (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) - * Branch/Sort code. Alternatively, an IBAN can be provided + * Branch/Sort code. Alternatively, an IBAN can be provided. * @param bankBranchCode Value for String */ @JsonSetter("bank_branch_code") diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePrepaidUsageComponentPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/CreatePrepaidUsageComponentPricePoint.java index ecbb9868..559a8058 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreatePrepaidUsageComponentPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePrepaidUsageComponentPricePoint.java @@ -247,7 +247,7 @@ public void setUseSiteExchangeRate(Boolean useSiteExchangeRate) { /** * Getter for RolloverPrepaidRemainder. * (only for prepaid usage components) Boolean which controls whether or not remaining units - * should be rolled over to the next period + * should be rolled over to the next period. * @return Returns the Boolean */ @JsonGetter("rollover_prepaid_remainder") @@ -259,7 +259,7 @@ public Boolean getRolloverPrepaidRemainder() { /** * Setter for RolloverPrepaidRemainder. * (only for prepaid usage components) Boolean which controls whether or not remaining units - * should be rolled over to the next period + * should be rolled over to the next period. * @param rolloverPrepaidRemainder Value for Boolean */ @JsonSetter("rollover_prepaid_remainder") @@ -270,7 +270,7 @@ public void setRolloverPrepaidRemainder(Boolean rolloverPrepaidRemainder) { /** * Getter for RenewPrepaidAllocation. * (only for prepaid usage components) Boolean which controls whether or not the allocated - * quantity should be renewed at the beginning of each period + * quantity should be renewed at the beginning of each period. * @return Returns the Boolean */ @JsonGetter("renew_prepaid_allocation") @@ -282,7 +282,7 @@ public Boolean getRenewPrepaidAllocation() { /** * Setter for RenewPrepaidAllocation. * (only for prepaid usage components) Boolean which controls whether or not the allocated - * quantity should be renewed at the beginning of each period + * quantity should be renewed at the beginning of each period. * @param renewPrepaidAllocation Value for Boolean */ @JsonSetter("renew_prepaid_allocation") @@ -293,7 +293,7 @@ public void setRenewPrepaidAllocation(Boolean renewPrepaidAllocation) { /** * Getter for ExpirationInterval. * (only for prepaid usage components where rollover_prepaid_remainder is true) The number of - * `expiration_interval_unit`s after which rollover amounts should expire + * `expiration_interval_unit`s after which rollover amounts should expire. * @return Returns the Double */ @JsonGetter("expiration_interval") @@ -305,7 +305,7 @@ public Double getExpirationInterval() { /** * Setter for ExpirationInterval. * (only for prepaid usage components where rollover_prepaid_remainder is true) The number of - * `expiration_interval_unit`s after which rollover amounts should expire + * `expiration_interval_unit`s after which rollover amounts should expire. * @param expirationInterval Value for Double */ @JsonSetter("expiration_interval") @@ -316,7 +316,7 @@ public void setExpirationInterval(Double expirationInterval) { /** * Internal Getter for ExpirationIntervalUnit. * (only for prepaid usage components where rollover_prepaid_remainder is true) A string - * representing the expiration interval unit for this component, either month or day + * representing the expiration interval unit for this component, either month or day. * @return Returns the Internal ExpirationIntervalUnit */ @JsonGetter("expiration_interval_unit") @@ -329,7 +329,7 @@ protected OptionalNullable internalGetExpirationInterval /** * Getter for ExpirationIntervalUnit. * (only for prepaid usage components where rollover_prepaid_remainder is true) A string - * representing the expiration interval unit for this component, either month or day + * representing the expiration interval unit for this component, either month or day. * @return Returns the ExpirationIntervalUnit */ public ExpirationIntervalUnit getExpirationIntervalUnit() { @@ -339,7 +339,7 @@ public ExpirationIntervalUnit getExpirationIntervalUnit() { /** * Setter for ExpirationIntervalUnit. * (only for prepaid usage components where rollover_prepaid_remainder is true) A string - * representing the expiration interval unit for this component, either month or day + * representing the expiration interval unit for this component, either month or day. * @param expirationIntervalUnit Value for ExpirationIntervalUnit */ @JsonSetter("expiration_interval_unit") @@ -350,7 +350,7 @@ public void setExpirationIntervalUnit(ExpirationIntervalUnit expirationIntervalU /** * UnSetter for ExpirationIntervalUnit. * (only for prepaid usage components where rollover_prepaid_remainder is true) A string - * representing the expiration interval unit for this component, either month or day + * representing the expiration interval unit for this component, either month or day. */ public void unsetExpirationIntervalUnit() { expirationIntervalUnit = null; diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java b/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java index e6fb3a6d..aad8115c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java @@ -105,7 +105,7 @@ public void setMemo(String memo) { /** * Getter for Method. - * :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be + * When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be * collected using the default credit card payment profile and applied to the prepayment account * balance. This is especially useful for manual replenishment of prepaid subscriptions. * @return Returns the CreatePrepaymentMethod @@ -117,7 +117,7 @@ public CreatePrepaymentMethod getMethod() { /** * Setter for Method. - * :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be + * When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be * collected using the default credit card payment profile and applied to the prepayment account * balance. This is especially useful for manual replenishment of prepaid subscriptions. * @param method Value for CreatePrepaymentMethod diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePrepaymentMethod.java b/src/main/java/com/maxio/advancedbilling/models/CreatePrepaymentMethod.java index 0af18dd6..dc2951a1 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreatePrepaymentMethod.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePrepaymentMethod.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CreatePrepaymentMethod to be used. */ @@ -33,7 +32,6 @@ public enum CreatePrepaymentMethod { OTHER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateProductFamily.java b/src/main/java/com/maxio/advancedbilling/models/CreateProductFamily.java index 6f44b3b5..01d196de 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateProductFamily.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateProductFamily.java @@ -21,6 +21,7 @@ public class CreateProductFamily private String name; private OptionalNullable handle; private OptionalNullable description; + private Boolean surcharging; /** * Default constructor. @@ -33,14 +34,17 @@ public CreateProductFamily() { * @param name String value for name. * @param handle String value for handle. * @param description String value for description. + * @param surcharging Boolean value for surcharging. */ public CreateProductFamily( String name, String handle, - String description) { + String description, + Boolean surcharging) { this.name = name; this.handle = OptionalNullable.of(handle); this.description = OptionalNullable.of(description); + this.surcharging = surcharging; } /** @@ -48,13 +52,15 @@ public CreateProductFamily( * @param name String value for name. * @param handle String value for handle. * @param description String value for description. + * @param surcharging Boolean value for surcharging. */ protected CreateProductFamily(String name, OptionalNullable handle, - OptionalNullable description) { + OptionalNullable description, Boolean surcharging) { this.name = name; this.handle = handle; this.description = description; + this.surcharging = surcharging; } /** @@ -145,6 +151,29 @@ public void unsetDescription() { description = null; } + /** + * Getter for Surcharging. + * Whether surcharging applies to this product family. Defaults to `true` when omitted. Only + * applied on sites where surcharging is enabled. + * @return Returns the Boolean + */ + @JsonGetter("surcharging") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getSurcharging() { + return surcharging; + } + + /** + * Setter for Surcharging. + * Whether surcharging applies to this product family. Defaults to `true` when omitted. Only + * applied on sites where surcharging is enabled. + * @param surcharging Value for Boolean + */ + @JsonSetter("surcharging") + public void setSurcharging(Boolean surcharging) { + this.surcharging = surcharging; + } + /** * Converts this CreateProductFamily into string format. * @return String representation of this class @@ -152,7 +181,8 @@ public void unsetDescription() { @Override public String toString() { return "CreateProductFamily [" + "name=" + name + ", handle=" + handle + ", description=" - + description + ", additionalProperties=" + getAdditionalProperties() + "]"; + + description + ", surcharging=" + surcharging + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -161,7 +191,8 @@ public String toString() { * @return a new {@link CreateProductFamily.Builder} object */ public Builder toBuilder() { - Builder builder = new Builder(name); + Builder builder = new Builder(name) + .surcharging(getSurcharging()); builder.handle = internalGetHandle(); builder.description = internalGetDescription(); return builder; @@ -174,6 +205,7 @@ public static class Builder { private String name; private OptionalNullable handle; private OptionalNullable description; + private Boolean surcharging; /** * Initialization constructor. @@ -237,12 +269,22 @@ public Builder unsetDescription() { return this; } + /** + * Setter for surcharging. + * @param surcharging Boolean value for surcharging. + * @return Builder + */ + public Builder surcharging(Boolean surcharging) { + this.surcharging = surcharging; + return this; + } + /** * Builds a new {@link CreateProductFamily} object using the set fields. * @return {@link CreateProductFamily} */ public CreateProductFamily build() { - return new CreateProductFamily(name, handle, description); + return new CreateProductFamily(name, handle, description, surcharging); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java index 68fe60bd..50b9ebd5 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java @@ -191,8 +191,8 @@ public void setPriceInCents(long priceInCents) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product price point would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product price point would renew every 30 days. * @return Returns the int */ @JsonGetter("interval") @@ -202,8 +202,8 @@ public int getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product price point would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product price point would renew every 30 days. * @param interval Value for int */ @JsonSetter("interval") @@ -254,7 +254,7 @@ public void setTrialPriceInCents(Long trialPriceInCents) { /** * Getter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of * day would mean this product price point trial would last 30 days. * @return Returns the Integer */ @@ -266,7 +266,7 @@ public Integer getTrialInterval() { /** * Setter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of * day would mean this product price point trial would last 30 days. * @param trialInterval Value for Integer */ @@ -300,7 +300,7 @@ public void setTrialIntervalUnit(IntervalUnit trialIntervalUnit) { /** * Internal Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -316,7 +316,7 @@ protected OptionalNullable internalGetTrialType() { /** * Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -329,7 +329,7 @@ public TrialType getTrialType() { /** * Setter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -343,7 +343,7 @@ public void setTrialType(TrialType trialType) { /** * UnSetter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -395,7 +395,7 @@ public void setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) { /** * Getter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 * days. * @return Returns the Integer @@ -408,7 +408,7 @@ public Integer getExpirationInterval() { /** * Setter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 * days. * @param expirationInterval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateSignupProformaPreviewInclude.java b/src/main/java/com/maxio/advancedbilling/models/CreateSignupProformaPreviewInclude.java index e56d9b9f..bea91b1e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateSignupProformaPreviewInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateSignupProformaPreviewInclude.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * CreateSignupProformaPreviewInclude to be used. */ public enum CreateSignupProformaPreviewInclude { NEXT_PROFORMA_INVOICE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateSubscription.java b/src/main/java/com/maxio/advancedbilling/models/CreateSubscription.java index 36cf3d4e..60e758bf 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateSubscription.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateSubscription.java @@ -35,6 +35,7 @@ public class CreateSubscription private String receivesInvoiceEmails; private String netTerms; private Integer customerId; + private OptionalNullable brandingThemeId; private ZonedDateTime nextBillingAt; private ZonedDateTime initialBillingAt; private Boolean deferSignup; @@ -96,6 +97,7 @@ public CreateSubscription() { * @param receivesInvoiceEmails String value for receivesInvoiceEmails. * @param netTerms String value for netTerms. * @param customerId Integer value for customerId. + * @param brandingThemeId Integer value for brandingThemeId. * @param nextBillingAt ZonedDateTime value for nextBillingAt. * @param initialBillingAt ZonedDateTime value for initialBillingAt. * @param deferSignup Boolean value for deferSignup. @@ -151,6 +153,7 @@ public CreateSubscription( String receivesInvoiceEmails, String netTerms, Integer customerId, + Integer brandingThemeId, ZonedDateTime nextBillingAt, ZonedDateTime initialBillingAt, Boolean deferSignup, @@ -201,6 +204,7 @@ public CreateSubscription( this.receivesInvoiceEmails = receivesInvoiceEmails; this.netTerms = netTerms; this.customerId = customerId; + this.brandingThemeId = OptionalNullable.of(brandingThemeId); this.nextBillingAt = nextBillingAt; this.initialBillingAt = initialBillingAt; this.deferSignup = deferSignup; @@ -256,6 +260,7 @@ public CreateSubscription( * @param receivesInvoiceEmails String value for receivesInvoiceEmails. * @param netTerms String value for netTerms. * @param customerId Integer value for customerId. + * @param brandingThemeId Integer value for brandingThemeId. * @param nextBillingAt ZonedDateTime value for nextBillingAt. * @param initialBillingAt ZonedDateTime value for initialBillingAt. * @param deferSignup Boolean value for deferSignup. @@ -304,9 +309,10 @@ protected CreateSubscription(String productHandle, Integer productId, String productPricePointHandle, Integer productPricePointId, SubscriptionCustomPrice customPrice, String couponCode, List couponCodes, CollectionMethod paymentCollectionMethod, String receivesInvoiceEmails, String netTerms, - Integer customerId, ZonedDateTime nextBillingAt, ZonedDateTime initialBillingAt, - Boolean deferSignup, Integer storedCredentialTransactionId, Integer salesRepId, - Integer paymentProfileId, String reference, CustomerAttributes customerAttributes, + Integer customerId, OptionalNullable brandingThemeId, + ZonedDateTime nextBillingAt, ZonedDateTime initialBillingAt, Boolean deferSignup, + Integer storedCredentialTransactionId, Integer salesRepId, Integer paymentProfileId, + String reference, CustomerAttributes customerAttributes, PaymentProfileAttributes paymentProfileAttributes, PaymentProfileAttributes creditCardAttributes, BankAccountAttributes bankAccountAttributes, @@ -333,6 +339,7 @@ protected CreateSubscription(String productHandle, Integer productId, this.receivesInvoiceEmails = receivesInvoiceEmails; this.netTerms = netTerms; this.customerId = customerId; + this.brandingThemeId = brandingThemeId; this.nextBillingAt = nextBillingAt; this.initialBillingAt = initialBillingAt; this.deferSignup = deferSignup; @@ -625,6 +632,61 @@ public void setCustomerId(Integer customerId) { this.customerId = customerId; } + /** + * Internal Getter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + * @return Returns the Internal Integer + */ + @JsonGetter("branding_theme_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBrandingThemeId() { + return this.brandingThemeId; + } + + /** + * Getter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + * @return Returns the Integer + */ + public Integer getBrandingThemeId() { + return OptionalNullable.getFrom(brandingThemeId); + } + + /** + * Setter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + * @param brandingThemeId Value for Integer + */ + @JsonSetter("branding_theme_id") + public void setBrandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + } + + /** + * UnSetter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + */ + public void unsetBrandingThemeId() { + brandingThemeId = null; + } + /** * Getter for NextBillingAt. * (Optional) Set this attribute to a future date/time to sync imported subscriptions to your @@ -795,7 +857,7 @@ public void setSalesRepId(Integer salesRepId) { * does not exist already, or if you want to use a new (unstored) card or bank account for the * subscription, use `payment_profile_attributes` instead to create a new payment profile along * with the subscription. (This value is available on an existing subscription via the API as - * `credit_card` > id or `bank_account` > id) + * `credit_card` > id or `bank_account` > id.) * @return Returns the Integer */ @JsonGetter("payment_profile_id") @@ -811,7 +873,7 @@ public Integer getPaymentProfileId() { * does not exist already, or if you want to use a new (unstored) card or bank account for the * subscription, use `payment_profile_attributes` instead to create a new payment profile along * with the subscription. (This value is available on an existing subscription via the API as - * `credit_card` > id or `bank_account` > id) + * `credit_card` > id or `bank_account` > id.) * @param paymentProfileId Value for Integer */ @JsonSetter("payment_profile_id") @@ -949,7 +1011,7 @@ public void setComponents(List components) { /** * Getter for CalendarBilling. - * (Optional). Cannot be used when also specifying next_billing_at + * (Optional). Cannot be used when also specifying next_billing_at. * @return Returns the CalendarBilling */ @JsonGetter("calendar_billing") @@ -960,7 +1022,7 @@ public CalendarBilling getCalendarBilling() { /** * Setter for CalendarBilling. - * (Optional). Cannot be used when also specifying next_billing_at + * (Optional). Cannot be used when also specifying next_billing_at. * @param calendarBilling Value for CalendarBilling */ @JsonSetter("calendar_billing") @@ -1319,7 +1381,7 @@ public void setProductChangeDelayed(Boolean productChangeDelayed) { * Getter for OfferId. * Use in place of passing product and component information to set up the subscription with an * existing offer. May be either the Chargify id of the offer or its handle prefixed with - * `handle:`.er + * `handle:`. * @return Returns the CreateSubscriptionOfferId */ @JsonGetter("offer_id") @@ -1332,7 +1394,7 @@ public CreateSubscriptionOfferId getOfferId() { * Setter for OfferId. * Use in place of passing product and component information to set up the subscription with an * existing offer. May be either the Chargify id of the offer or its handle prefixed with - * `handle:`.er + * `handle:`. * @param offerId Value for CreateSubscriptionOfferId */ @JsonSetter("offer_id") @@ -1598,23 +1660,24 @@ public String toString() { + ", couponCode=" + couponCode + ", couponCodes=" + couponCodes + ", paymentCollectionMethod=" + paymentCollectionMethod + ", receivesInvoiceEmails=" + receivesInvoiceEmails + ", netTerms=" + netTerms - + ", customerId=" + customerId + ", nextBillingAt=" + nextBillingAt - + ", initialBillingAt=" + initialBillingAt + ", deferSignup=" + deferSignup - + ", storedCredentialTransactionId=" + storedCredentialTransactionId - + ", salesRepId=" + salesRepId + ", paymentProfileId=" + paymentProfileId - + ", reference=" + reference + ", customerAttributes=" + customerAttributes - + ", paymentProfileAttributes=" + paymentProfileAttributes - + ", creditCardAttributes=" + creditCardAttributes + ", bankAccountAttributes=" - + bankAccountAttributes + ", components=" + components + ", calendarBilling=" - + calendarBilling + ", metafields=" + metafields + ", customerReference=" - + customerReference + ", group=" + group + ", ref=" + ref + ", cancellationMessage=" - + cancellationMessage + ", cancellationMethod=" + cancellationMethod + ", currency=" - + currency + ", expiresAt=" + expiresAt + ", expirationTracksNextBillingChange=" - + expirationTracksNextBillingChange + ", agreementTerms=" + agreementTerms - + ", authorizerFirstName=" + authorizerFirstName + ", authorizerLastName=" - + authorizerLastName + ", calendarBillingFirstCharge=" + calendarBillingFirstCharge - + ", reasonCode=" + reasonCode + ", productChangeDelayed=" + productChangeDelayed - + ", offerId=" + offerId + ", prepaidConfiguration=" + prepaidConfiguration + + ", customerId=" + customerId + ", brandingThemeId=" + brandingThemeId + + ", nextBillingAt=" + nextBillingAt + ", initialBillingAt=" + initialBillingAt + + ", deferSignup=" + deferSignup + ", storedCredentialTransactionId=" + + storedCredentialTransactionId + ", salesRepId=" + salesRepId + + ", paymentProfileId=" + paymentProfileId + ", reference=" + reference + + ", customerAttributes=" + customerAttributes + ", paymentProfileAttributes=" + + paymentProfileAttributes + ", creditCardAttributes=" + creditCardAttributes + + ", bankAccountAttributes=" + bankAccountAttributes + ", components=" + components + + ", calendarBilling=" + calendarBilling + ", metafields=" + metafields + + ", customerReference=" + customerReference + ", group=" + group + ", ref=" + ref + + ", cancellationMessage=" + cancellationMessage + ", cancellationMethod=" + + cancellationMethod + ", currency=" + currency + ", expiresAt=" + expiresAt + + ", expirationTracksNextBillingChange=" + expirationTracksNextBillingChange + + ", agreementTerms=" + agreementTerms + ", authorizerFirstName=" + + authorizerFirstName + ", authorizerLastName=" + authorizerLastName + + ", calendarBillingFirstCharge=" + calendarBillingFirstCharge + ", reasonCode=" + + reasonCode + ", productChangeDelayed=" + productChangeDelayed + ", offerId=" + + offerId + ", prepaidConfiguration=" + prepaidConfiguration + ", previousBillingAt=" + previousBillingAt + ", importMrr=" + importMrr + ", canceledAt=" + canceledAt + ", activatedAt=" + activatedAt + ", agreementAcceptance=" + agreementAcceptance + ", achAgreement=" + achAgreement @@ -1680,6 +1743,7 @@ public Builder toBuilder() { .achAgreement(getAchAgreement()) .dunningCommunicationDelayEnabled(getDunningCommunicationDelayEnabled()) .skipBillingManifestTaxes(getSkipBillingManifestTaxes()); + builder.brandingThemeId = internalGetBrandingThemeId(); builder.dunningCommunicationDelayTimeZone = internalGetDunningCommunicationDelayTimeZone(); return builder; } @@ -1699,6 +1763,7 @@ public static class Builder { private String receivesInvoiceEmails; private String netTerms; private Integer customerId; + private OptionalNullable brandingThemeId; private ZonedDateTime nextBillingAt; private ZonedDateTime initialBillingAt; private Boolean deferSignup = false; @@ -1851,6 +1916,25 @@ public Builder customerId(Integer customerId) { return this; } + /** + * Setter for brandingThemeId. + * @param brandingThemeId Integer value for brandingThemeId. + * @return Builder + */ + public Builder brandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + return this; + } + + /** + * UnSetter for brandingThemeId. + * @return Builder + */ + public Builder unsetBrandingThemeId() { + brandingThemeId = null; + return this; + } + /** * Setter for nextBillingAt. * @param nextBillingAt ZonedDateTime value for nextBillingAt. @@ -2267,13 +2351,13 @@ public CreateSubscription build() { return new CreateSubscription(productHandle, productId, productPricePointHandle, productPricePointId, customPrice, couponCode, couponCodes, paymentCollectionMethod, receivesInvoiceEmails, netTerms, customerId, - nextBillingAt, initialBillingAt, deferSignup, storedCredentialTransactionId, - salesRepId, paymentProfileId, reference, customerAttributes, - paymentProfileAttributes, creditCardAttributes, bankAccountAttributes, - components, calendarBilling, metafields, customerReference, group, ref, - cancellationMessage, cancellationMethod, currency, expiresAt, - expirationTracksNextBillingChange, agreementTerms, authorizerFirstName, - authorizerLastName, calendarBillingFirstCharge, reasonCode, + brandingThemeId, nextBillingAt, initialBillingAt, deferSignup, + storedCredentialTransactionId, salesRepId, paymentProfileId, reference, + customerAttributes, paymentProfileAttributes, creditCardAttributes, + bankAccountAttributes, components, calendarBilling, metafields, + customerReference, group, ref, cancellationMessage, cancellationMethod, + currency, expiresAt, expirationTracksNextBillingChange, agreementTerms, + authorizerFirstName, authorizerLastName, calendarBillingFirstCharge, reasonCode, productChangeDelayed, offerId, prepaidConfiguration, previousBillingAt, importMrr, canceledAt, activatedAt, agreementAcceptance, achAgreement, dunningCommunicationDelayEnabled, dunningCommunicationDelayTimeZone, diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateSubscriptionComponent.java b/src/main/java/com/maxio/advancedbilling/models/CreateSubscriptionComponent.java index 8bb889ac..2d437768 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateSubscriptionComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateSubscriptionComponent.java @@ -12,6 +12,7 @@ import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentAllocatedQuantity; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentPricePointId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import io.apimatic.core.types.BaseModel; /** @@ -21,7 +22,7 @@ public class CreateSubscriptionComponent extends BaseModel { private CreateSubscriptionComponentComponentId componentId; private Boolean enabled; - private Integer unitBalance; + private CreateSubscriptionComponentUnitBalance unitBalance; private CreateSubscriptionComponentAllocatedQuantity allocatedQuantity; private Integer quantity; private CreateSubscriptionComponentPricePointId pricePointId; @@ -37,7 +38,7 @@ public CreateSubscriptionComponent() { * Initialization constructor. * @param componentId CreateSubscriptionComponentComponentId value for componentId. * @param enabled Boolean value for enabled. - * @param unitBalance Integer value for unitBalance. + * @param unitBalance CreateSubscriptionComponentUnitBalance value for unitBalance. * @param allocatedQuantity CreateSubscriptionComponentAllocatedQuantity value for * allocatedQuantity. * @param quantity Integer value for quantity. @@ -47,7 +48,7 @@ public CreateSubscriptionComponent() { public CreateSubscriptionComponent( CreateSubscriptionComponentComponentId componentId, Boolean enabled, - Integer unitBalance, + CreateSubscriptionComponentUnitBalance unitBalance, CreateSubscriptionComponentAllocatedQuantity allocatedQuantity, Integer quantity, CreateSubscriptionComponentPricePointId pricePointId, @@ -104,21 +105,21 @@ public void setEnabled(Boolean enabled) { /** * Getter for UnitBalance. * Used for metered and events based components. - * @return Returns the Integer + * @return Returns the CreateSubscriptionComponentUnitBalance */ @JsonGetter("unit_balance") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getUnitBalance() { + public CreateSubscriptionComponentUnitBalance getUnitBalance() { return unitBalance; } /** * Setter for UnitBalance. * Used for metered and events based components. - * @param unitBalance Value for Integer + * @param unitBalance Value for CreateSubscriptionComponentUnitBalance */ @JsonSetter("unit_balance") - public void setUnitBalance(Integer unitBalance) { + public void setUnitBalance(CreateSubscriptionComponentUnitBalance unitBalance) { this.unitBalance = unitBalance; } @@ -242,7 +243,7 @@ public Builder toBuilder() { public static class Builder { private CreateSubscriptionComponentComponentId componentId; private Boolean enabled; - private Integer unitBalance; + private CreateSubscriptionComponentUnitBalance unitBalance; private CreateSubscriptionComponentAllocatedQuantity allocatedQuantity; private Integer quantity; private CreateSubscriptionComponentPricePointId pricePointId; @@ -272,10 +273,10 @@ public Builder enabled(Boolean enabled) { /** * Setter for unitBalance. - * @param unitBalance Integer value for unitBalance. + * @param unitBalance CreateSubscriptionComponentUnitBalance value for unitBalance. * @return Builder */ - public Builder unitBalance(Integer unitBalance) { + public Builder unitBalance(CreateSubscriptionComponentUnitBalance unitBalance) { this.unitBalance = unitBalance; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditCardPaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/CreditCardPaymentProfile.java index 7dbdb298..e132c4a9 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreditCardPaymentProfile.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreditCardPaymentProfile.java @@ -27,7 +27,7 @@ public class CreditCardPaymentProfile private String firstName; private String lastName; private String maskedCardNumber; - private CardType cardType; + private OptionalNullable cardType; private Integer expirationMonth; private Integer expirationYear; private Integer customerId; @@ -111,7 +111,7 @@ public CreditCardPaymentProfile( this.firstName = firstName; this.lastName = lastName; this.maskedCardNumber = maskedCardNumber; - this.cardType = cardType; + this.cardType = OptionalNullable.of(cardType); this.expirationMonth = expirationMonth; this.expirationYear = expirationYear; this.customerId = customerId; @@ -162,15 +162,15 @@ public CreditCardPaymentProfile( */ protected CreditCardPaymentProfile(PaymentType paymentType, Integer id, String firstName, - String lastName, String maskedCardNumber, CardType cardType, Integer expirationMonth, - Integer expirationYear, Integer customerId, CreditCardVault currentVault, - OptionalNullable vaultToken, OptionalNullable billingAddress, - OptionalNullable billingCity, OptionalNullable billingState, - OptionalNullable billingZip, OptionalNullable billingCountry, - OptionalNullable customerVaultToken, OptionalNullable billingAddress2, - Boolean disabled, String chargifyToken, OptionalNullable siteGatewaySettingId, - OptionalNullable gatewayHandle, ZonedDateTime createdAt, - ZonedDateTime updatedAt) { + String lastName, String maskedCardNumber, OptionalNullable cardType, + Integer expirationMonth, Integer expirationYear, Integer customerId, + CreditCardVault currentVault, OptionalNullable vaultToken, + OptionalNullable billingAddress, OptionalNullable billingCity, + OptionalNullable billingState, OptionalNullable billingZip, + OptionalNullable billingCountry, OptionalNullable customerVaultToken, + OptionalNullable billingAddress2, Boolean disabled, String chargifyToken, + OptionalNullable siteGatewaySettingId, OptionalNullable gatewayHandle, + ZonedDateTime createdAt, ZonedDateTime updatedAt) { this.id = id; this.firstName = firstName; this.lastName = lastName; @@ -204,11 +204,12 @@ protected CreditCardPaymentProfile(PaymentType paymentType, Integer id, String f @JsonCreator protected CreditCardPaymentProfile( @JsonProperty("payment_type") PaymentType paymentType) { - this(paymentType, null, null, null, null, null, null, null, null, null, + this(paymentType, null, null, null, null, OptionalNullable.of(null), null, null, null, null, OptionalNullable.of(null), OptionalNullable.of(null), OptionalNullable.of(null), OptionalNullable.of(null), OptionalNullable.of(null), OptionalNullable.of(null), OptionalNullable.of(null), OptionalNullable.of(null), null, null, OptionalNullable.of(null), OptionalNullable.of(null), null, null); + unsetCardType(); unsetVaultToken(); unsetBillingAddress(); unsetBillingCity(); @@ -291,7 +292,7 @@ public void setLastName(String lastName) { /** * Getter for MaskedCardNumber. * A string representation of the credit card number with all but the last 4 digits masked with - * X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). + * X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). * @return Returns the String */ @JsonGetter("masked_card_number") @@ -303,7 +304,7 @@ public String getMaskedCardNumber() { /** * Setter for MaskedCardNumber. * A string representation of the credit card number with all but the last 4 digits masked with - * X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). + * X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). * @param maskedCardNumber Value for String */ @JsonSetter("masked_card_number") @@ -312,14 +313,24 @@ public void setMaskedCardNumber(String maskedCardNumber) { } /** - * Getter for CardType. + * Internal Getter for CardType. * The type of card used. - * @return Returns the CardType + * @return Returns the Internal CardType */ @JsonGetter("card_type") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetCardType() { + return this.cardType; + } + + /** + * Getter for CardType. + * The type of card used. + * @return Returns the CardType + */ public CardType getCardType() { - return cardType; + return OptionalNullable.getFrom(cardType); } /** @@ -329,7 +340,15 @@ public CardType getCardType() { */ @JsonSetter("card_type") public void setCardType(CardType cardType) { - this.cardType = cardType; + this.cardType = OptionalNullable.of(cardType); + } + + /** + * UnSetter for CardType. + * The type of card used. + */ + public void unsetCardType() { + cardType = null; } /** @@ -355,7 +374,7 @@ public void setExpirationMonth(Integer expirationMonth) { /** * Getter for ExpirationYear. - * An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). + * An integer representing the 4-digit expiration year of the card(e.g., ‘2012’). * @return Returns the Integer */ @JsonGetter("expiration_year") @@ -366,7 +385,7 @@ public Integer getExpirationYear() { /** * Setter for ExpirationYear. - * An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). + * An integer representing the 4-digit expiration year of the card(e.g., ‘2012’). * @param expirationYear Value for Integer */ @JsonSetter("expiration_year") @@ -774,8 +793,8 @@ public void setDisabled(Boolean disabled) { /** * Getter for ChargifyToken. * Token received after sending billing information using Maxio.js (formerly Chargify.js). This - * token will only be received if passed as a sole attribute of credit_card_attributes (i.e. - * tok_9g6hw85pnpt6knmskpwp4ttt) + * token will only be received if passed as a sole attribute of credit_card_attributes (e.g., + * tok_9g6hw85pnpt6knmskpwp4ttt). * @return Returns the String */ @JsonGetter("chargify_token") @@ -787,8 +806,8 @@ public String getChargifyToken() { /** * Setter for ChargifyToken. * Token received after sending billing information using Maxio.js (formerly Chargify.js). This - * token will only be received if passed as a sole attribute of credit_card_attributes (i.e. - * tok_9g6hw85pnpt6knmskpwp4ttt) + * token will only be received if passed as a sole attribute of credit_card_attributes (e.g., + * tok_9g6hw85pnpt6knmskpwp4ttt). * @param chargifyToken Value for String */ @JsonSetter("chargify_token") @@ -948,7 +967,6 @@ public Builder toBuilder() { .firstName(getFirstName()) .lastName(getLastName()) .maskedCardNumber(getMaskedCardNumber()) - .cardType(getCardType()) .expirationMonth(getExpirationMonth()) .expirationYear(getExpirationYear()) .customerId(getCustomerId()) @@ -957,6 +975,7 @@ public Builder toBuilder() { .chargifyToken(getChargifyToken()) .createdAt(getCreatedAt()) .updatedAt(getUpdatedAt()); + builder.cardType = internalGetCardType(); builder.vaultToken = internalGetVaultToken(); builder.billingAddress = internalGetBillingAddress(); builder.billingCity = internalGetBillingCity(); @@ -979,7 +998,7 @@ public static class Builder { private String firstName; private String lastName; private String maskedCardNumber; - private CardType cardType; + private OptionalNullable cardType; private Integer expirationMonth; private Integer expirationYear; private Integer customerId; @@ -1069,7 +1088,16 @@ public Builder maskedCardNumber(String maskedCardNumber) { * @return Builder */ public Builder cardType(CardType cardType) { - this.cardType = cardType; + this.cardType = OptionalNullable.of(cardType); + return this; + } + + /** + * UnSetter for cardType. + * @return Builder + */ + public Builder unsetCardType() { + cardType = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditCardVault.java b/src/main/java/com/maxio/advancedbilling/models/CreditCardVault.java index 0aabcf0f..56d9d472 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreditCardVault.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreditCardVault.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CreditCardVault to be used. */ @@ -83,7 +82,6 @@ public enum CreditCardVault { WIRECARD; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditNote.java b/src/main/java/com/maxio/advancedbilling/models/CreditNote.java index 703e005a..4afe60b3 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreditNote.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreditNote.java @@ -420,7 +420,7 @@ public void setSeller(InvoiceSeller seller) { /** * Getter for Customer. - * Information about the customer who is owner or recipient the credited subscription. + * Information about the customer who is owner or recipient of the credited subscription. * @return Returns the InvoiceCustomer */ @JsonGetter("customer") @@ -431,7 +431,7 @@ public InvoiceCustomer getCustomer() { /** * Setter for Customer. - * Information about the customer who is owner or recipient the credited subscription. + * Information about the customer who is owner or recipient of the credited subscription. * @param customer Value for InvoiceCustomer */ @JsonSetter("customer") @@ -507,7 +507,7 @@ public void setSubtotalAmount(String subtotalAmount) { /** * Getter for DiscountAmount. * Total discount applied to the credit note. Note that this is a positive amount representing - * the discount amount being credited back to the customer (i.e. a credit on an earlier + * the discount amount being credited back to the customer (i.e., a credit on an earlier * discount). For example, if the original purchase was $1.00 and the original discount was * $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of * $0.05 (also half). @@ -522,7 +522,7 @@ public String getDiscountAmount() { /** * Setter for DiscountAmount. * Total discount applied to the credit note. Note that this is a positive amount representing - * the discount amount being credited back to the customer (i.e. a credit on an earlier + * the discount amount being credited back to the customer (i.e., a credit on an earlier * discount). For example, if the original purchase was $1.00 and the original discount was * $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of * $0.05 (also half). @@ -536,7 +536,7 @@ public void setDiscountAmount(String discountAmount) { /** * Getter for TaxAmount. * Total tax of the credit note. Note that this is a positive amount representing a previously - * taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For + * taxed amount being credited back to the customer (i.e., a credit of an earlier tax). For * example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 * of the original purchase (half) would also have a tax credit of $0.05 (also half). * @return Returns the String @@ -550,7 +550,7 @@ public String getTaxAmount() { /** * Setter for TaxAmount. * Total tax of the credit note. Note that this is a positive amount representing a previously - * taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For + * taxed amount being credited back to the customer (i.e., a credit of an earlier tax). For * example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 * of the original purchase (half) would also have a tax credit of $0.05 (also half). * @param taxAmount Value for String @@ -562,7 +562,7 @@ public void setTaxAmount(String taxAmount) { /** * Getter for TotalAmount. - * The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' + * The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. * @return Returns the String */ @JsonGetter("total_amount") @@ -573,7 +573,7 @@ public String getTotalAmount() { /** * Setter for TotalAmount. - * The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' + * The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. * @param totalAmount Value for String */ @JsonSetter("total_amount") @@ -725,7 +725,7 @@ public void setRefunds(List refunds) { /** * Getter for OriginInvoices. * An array of origin invoices for the credit note. Learn more about [Origin Invoice from our - * docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices) + * docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices). * @return Returns the List of OriginInvoice */ @JsonGetter("origin_invoices") @@ -737,7 +737,7 @@ public List getOriginInvoices() { /** * Setter for OriginInvoices. * An array of origin invoices for the credit note. Learn more about [Origin Invoice from our - * docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices) + * docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices). * @param originInvoices Value for List of OriginInvoice */ @JsonSetter("origin_invoices") diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditNoteLineItem.java b/src/main/java/com/maxio/advancedbilling/models/CreditNoteLineItem.java index cf51a76e..56826e48 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreditNoteLineItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreditNoteLineItem.java @@ -261,7 +261,7 @@ public void setQuantity(String quantity) { /** * Getter for UnitPrice. - * The price per unit for the line item. When tiered pricing was used (i.e. not every unit was + * The price per unit for the line item. When tiered pricing was used (i.e., not every unit was * actually priced at the same price) this will be the blended average cost per unit and the * `tiered_unit_price` field will be set to `true`. * @return Returns the String @@ -274,7 +274,7 @@ public String getUnitPrice() { /** * Setter for UnitPrice. - * The price per unit for the line item. When tiered pricing was used (i.e. not every unit was + * The price per unit for the line item. When tiered pricing was used (i.e., not every unit was * actually priced at the same price) this will be the blended average cost per unit and the * `tiered_unit_price` field will be set to `true`. * @param unitPrice Value for String diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditNoteStatus.java b/src/main/java/com/maxio/advancedbilling/models/CreditNoteStatus.java index 0822002b..8b3b5de5 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreditNoteStatus.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreditNoteStatus.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CreditNoteStatus to be used. */ @@ -21,7 +20,6 @@ public enum CreditNoteStatus { APPLIED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditScheme.java b/src/main/java/com/maxio/advancedbilling/models/CreditScheme.java index 254fe861..cd9d66a1 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreditScheme.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreditScheme.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CreditScheme to be used. */ @@ -23,7 +22,6 @@ public enum CreditScheme { REFUND; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditType.java b/src/main/java/com/maxio/advancedbilling/models/CreditType.java index 8ec789ae..e965dd53 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreditType.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreditType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CreditType to be used. */ @@ -23,7 +22,6 @@ public enum CreditType { NONE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CurrencyOveragePrices.java b/src/main/java/com/maxio/advancedbilling/models/CurrencyOveragePrices.java index 09a2261b..3225172d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CurrencyOveragePrices.java +++ b/src/main/java/com/maxio/advancedbilling/models/CurrencyOveragePrices.java @@ -246,7 +246,7 @@ public void setType(PricePointType type) { /** * Getter for Default. - * Note: Refer to type attribute instead + * Note: Refer to type attribute instead. * @return Returns the Boolean */ @JsonGetter("default") @@ -257,7 +257,7 @@ public Boolean getDefault() { /** * Setter for Default. - * Note: Refer to type attribute instead + * Note: Refer to type attribute instead. * @param mDefault Value for Boolean */ @JsonSetter("default") @@ -527,7 +527,7 @@ public void setTaxIncluded(Boolean taxIncluded) { /** * Internal Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Internal Integer @@ -541,7 +541,7 @@ protected OptionalNullable internalGetInterval() { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -552,7 +552,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer @@ -564,7 +564,7 @@ public void setInterval(Integer interval) { /** * UnSetter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. */ diff --git a/src/main/java/com/maxio/advancedbilling/models/CurrencyPriceRole.java b/src/main/java/com/maxio/advancedbilling/models/CurrencyPriceRole.java index 9640e13d..b72fe961 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CurrencyPriceRole.java +++ b/src/main/java/com/maxio/advancedbilling/models/CurrencyPriceRole.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CurrencyPriceRole to be used. */ @@ -23,7 +22,6 @@ public enum CurrencyPriceRole { INITIAL; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/CustomFieldOwner.java b/src/main/java/com/maxio/advancedbilling/models/CustomFieldOwner.java index 6e2c6be4..a34336fb 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CustomFieldOwner.java +++ b/src/main/java/com/maxio/advancedbilling/models/CustomFieldOwner.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * CustomFieldOwner to be used. */ @@ -21,7 +20,6 @@ public enum CustomFieldOwner { SUBSCRIPTION; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Customer.java b/src/main/java/com/maxio/advancedbilling/models/Customer.java index 7d985bed..8b65a197 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Customer.java +++ b/src/main/java/com/maxio/advancedbilling/models/Customer.java @@ -44,6 +44,7 @@ public class Customer private OptionalNullable portalInviteLastSentAt; private OptionalNullable portalInviteLastAcceptedAt; private Boolean taxExempt; + private Boolean surcharging; private OptionalNullable vatNumber; private OptionalNullable parentId; private OptionalNullable locale; @@ -52,6 +53,7 @@ public class Customer private OptionalNullable taxExemptReason; private OptionalNullable defaultAutoRenewalProfileId; private OptionalNullable maxioid; + private OptionalNullable brandingThemeId; /** * Default constructor. @@ -84,6 +86,7 @@ public Customer() { * @param portalInviteLastSentAt ZonedDateTime value for portalInviteLastSentAt. * @param portalInviteLastAcceptedAt ZonedDateTime value for portalInviteLastAcceptedAt. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param vatNumber String value for vatNumber. * @param parentId Integer value for parentId. * @param locale String value for locale. @@ -92,6 +95,7 @@ public Customer() { * @param taxExemptReason String value for taxExemptReason. * @param defaultAutoRenewalProfileId Integer value for defaultAutoRenewalProfileId. * @param maxioid String value for maxioid. + * @param brandingThemeId Integer value for brandingThemeId. */ public Customer( String firstName, @@ -117,6 +121,7 @@ public Customer( ZonedDateTime portalInviteLastSentAt, ZonedDateTime portalInviteLastAcceptedAt, Boolean taxExempt, + Boolean surcharging, String vatNumber, Integer parentId, String locale, @@ -124,7 +129,8 @@ public Customer( String salesforceId, String taxExemptReason, Integer defaultAutoRenewalProfileId, - String maxioid) { + String maxioid, + Integer brandingThemeId) { this.firstName = firstName; this.lastName = lastName; this.email = email; @@ -148,6 +154,7 @@ public Customer( this.portalInviteLastSentAt = OptionalNullable.of(portalInviteLastSentAt); this.portalInviteLastAcceptedAt = OptionalNullable.of(portalInviteLastAcceptedAt); this.taxExempt = taxExempt; + this.surcharging = surcharging; this.vatNumber = OptionalNullable.of(vatNumber); this.parentId = OptionalNullable.of(parentId); this.locale = OptionalNullable.of(locale); @@ -156,6 +163,7 @@ public Customer( this.taxExemptReason = OptionalNullable.of(taxExemptReason); this.defaultAutoRenewalProfileId = OptionalNullable.of(defaultAutoRenewalProfileId); this.maxioid = OptionalNullable.of(maxioid); + this.brandingThemeId = OptionalNullable.of(brandingThemeId); } /** @@ -183,6 +191,7 @@ public Customer( * @param portalInviteLastSentAt ZonedDateTime value for portalInviteLastSentAt. * @param portalInviteLastAcceptedAt ZonedDateTime value for portalInviteLastAcceptedAt. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param vatNumber String value for vatNumber. * @param parentId Integer value for parentId. * @param locale String value for locale. @@ -191,6 +200,7 @@ public Customer( * @param taxExemptReason String value for taxExemptReason. * @param defaultAutoRenewalProfileId Integer value for defaultAutoRenewalProfileId. * @param maxioid String value for maxioid. + * @param brandingThemeId Integer value for brandingThemeId. */ protected Customer(String firstName, String lastName, String email, @@ -205,11 +215,12 @@ protected Customer(String firstName, String lastName, String email, OptionalNullable portalCustomerCreatedAt, OptionalNullable portalInviteLastSentAt, OptionalNullable portalInviteLastAcceptedAt, Boolean taxExempt, - OptionalNullable vatNumber, OptionalNullable parentId, - OptionalNullable locale, OptionalNullable defaultSubscriptionGroupUid, + Boolean surcharging, OptionalNullable vatNumber, + OptionalNullable parentId, OptionalNullable locale, + OptionalNullable defaultSubscriptionGroupUid, OptionalNullable salesforceId, OptionalNullable taxExemptReason, - OptionalNullable defaultAutoRenewalProfileId, - OptionalNullable maxioid) { + OptionalNullable defaultAutoRenewalProfileId, OptionalNullable maxioid, + OptionalNullable brandingThemeId) { this.firstName = firstName; this.lastName = lastName; this.email = email; @@ -233,6 +244,7 @@ protected Customer(String firstName, String lastName, String email, this.portalInviteLastSentAt = portalInviteLastSentAt; this.portalInviteLastAcceptedAt = portalInviteLastAcceptedAt; this.taxExempt = taxExempt; + this.surcharging = surcharging; this.vatNumber = vatNumber; this.parentId = parentId; this.locale = locale; @@ -241,6 +253,7 @@ protected Customer(String firstName, String lastName, String email, this.taxExemptReason = taxExemptReason; this.defaultAutoRenewalProfileId = defaultAutoRenewalProfileId; this.maxioid = maxioid; + this.brandingThemeId = brandingThemeId; } /** @@ -308,8 +321,8 @@ public void setEmail(String email) { /** * Internal Getter for CcEmails. - * A comma-separated list of emails that should be cc’d on all customer communications (i.e. - * “joe{@literal @}example.com, sue{@literal @}example.com”) + * “A comma-separated list of emails that should be cc’d on all customer communications (e.g., + * “joe{@literal @}example.com, sue{@literal @}example.com”)” * @return Returns the Internal String */ @JsonGetter("cc_emails") @@ -321,8 +334,8 @@ protected OptionalNullable internalGetCcEmails() { /** * Getter for CcEmails. - * A comma-separated list of emails that should be cc’d on all customer communications (i.e. - * “joe{@literal @}example.com, sue{@literal @}example.com”) + * “A comma-separated list of emails that should be cc’d on all customer communications (e.g., + * “joe{@literal @}example.com, sue{@literal @}example.com”)” * @return Returns the String */ public String getCcEmails() { @@ -331,8 +344,8 @@ public String getCcEmails() { /** * Setter for CcEmails. - * A comma-separated list of emails that should be cc’d on all customer communications (i.e. - * “joe{@literal @}example.com, sue{@literal @}example.com”) + * “A comma-separated list of emails that should be cc’d on all customer communications (e.g., + * “joe{@literal @}example.com, sue{@literal @}example.com”)” * @param ccEmails Value for String */ @JsonSetter("cc_emails") @@ -342,8 +355,8 @@ public void setCcEmails(String ccEmails) { /** * UnSetter for CcEmails. - * A comma-separated list of emails that should be cc’d on all customer communications (i.e. - * “joe{@literal @}example.com, sue{@literal @}example.com”) + * “A comma-separated list of emails that should be cc’d on all customer communications (e.g., + * “joe{@literal @}example.com, sue{@literal @}example.com”)” */ public void unsetCcEmails() { ccEmails = null; @@ -504,7 +517,7 @@ public void setUpdatedAt(ZonedDateTime updatedAt) { /** * Internal Getter for Address. - * The customer’s shipping street address (i.e. “123 Main St.”) + * The customer’s shipping street address (e.g., “123 Main St.”) * @return Returns the Internal String */ @JsonGetter("address") @@ -516,7 +529,7 @@ protected OptionalNullable internalGetAddress() { /** * Getter for Address. - * The customer’s shipping street address (i.e. “123 Main St.”) + * The customer’s shipping street address (e.g., “123 Main St.”) * @return Returns the String */ public String getAddress() { @@ -525,7 +538,7 @@ public String getAddress() { /** * Setter for Address. - * The customer’s shipping street address (i.e. “123 Main St.”) + * The customer’s shipping street address (e.g., “123 Main St.”) * @param address Value for String */ @JsonSetter("address") @@ -535,7 +548,7 @@ public void setAddress(String address) { /** * UnSetter for Address. - * The customer’s shipping street address (i.e. “123 Main St.”) + * The customer’s shipping street address (e.g., “123 Main St.”) */ public void unsetAddress() { address = null; @@ -543,7 +556,7 @@ public void unsetAddress() { /** * Internal Getter for Address2. - * Second line of the customer’s shipping address i.e. “Apt. 100” + * Second line of the customer’s shipping address e.g., “Apt. 100” * @return Returns the Internal String */ @JsonGetter("address_2") @@ -555,7 +568,7 @@ protected OptionalNullable internalGetAddress2() { /** * Getter for Address2. - * Second line of the customer’s shipping address i.e. “Apt. 100” + * Second line of the customer’s shipping address e.g., “Apt. 100” * @return Returns the String */ public String getAddress2() { @@ -564,7 +577,7 @@ public String getAddress2() { /** * Setter for Address2. - * Second line of the customer’s shipping address i.e. “Apt. 100” + * Second line of the customer’s shipping address e.g., “Apt. 100” * @param address2 Value for String */ @JsonSetter("address_2") @@ -574,7 +587,7 @@ public void setAddress2(String address2) { /** * UnSetter for Address2. - * Second line of the customer’s shipping address i.e. “Apt. 100” + * Second line of the customer’s shipping address e.g., “Apt. 100” */ public void unsetAddress2() { address2 = null; @@ -582,7 +595,7 @@ public void unsetAddress2() { /** * Internal Getter for City. - * The customer’s shipping address city (i.e. “Boston”) + * The customer’s shipping address city (e.g., “Boston”) * @return Returns the Internal String */ @JsonGetter("city") @@ -594,7 +607,7 @@ protected OptionalNullable internalGetCity() { /** * Getter for City. - * The customer’s shipping address city (i.e. “Boston”) + * The customer’s shipping address city (e.g., “Boston”) * @return Returns the String */ public String getCity() { @@ -603,7 +616,7 @@ public String getCity() { /** * Setter for City. - * The customer’s shipping address city (i.e. “Boston”) + * The customer’s shipping address city (e.g., “Boston”) * @param city Value for String */ @JsonSetter("city") @@ -613,7 +626,7 @@ public void setCity(String city) { /** * UnSetter for City. - * The customer’s shipping address city (i.e. “Boston”) + * The customer’s shipping address city (e.g., “Boston”) */ public void unsetCity() { city = null; @@ -621,7 +634,7 @@ public void unsetCity() { /** * Internal Getter for State. - * The customer’s shipping address state (i.e. “MA”) + * The customer’s shipping address state (e.g., “MA”) * @return Returns the Internal String */ @JsonGetter("state") @@ -633,7 +646,7 @@ protected OptionalNullable internalGetState() { /** * Getter for State. - * The customer’s shipping address state (i.e. “MA”) + * The customer’s shipping address state (e.g., “MA”) * @return Returns the String */ public String getState() { @@ -642,7 +655,7 @@ public String getState() { /** * Setter for State. - * The customer’s shipping address state (i.e. “MA”) + * The customer’s shipping address state (e.g., “MA”) * @param state Value for String */ @JsonSetter("state") @@ -652,7 +665,7 @@ public void setState(String state) { /** * UnSetter for State. - * The customer’s shipping address state (i.e. “MA”) + * The customer’s shipping address state (e.g., “MA”) */ public void unsetState() { state = null; @@ -699,7 +712,7 @@ public void unsetStateName() { /** * Internal Getter for Zip. - * The customer’s shipping address zip code (i.e. “12345”) + * The customer’s shipping address zip code (e.g., “12345”) * @return Returns the Internal String */ @JsonGetter("zip") @@ -711,7 +724,7 @@ protected OptionalNullable internalGetZip() { /** * Getter for Zip. - * The customer’s shipping address zip code (i.e. “12345”) + * The customer’s shipping address zip code (e.g., “12345”) * @return Returns the String */ public String getZip() { @@ -720,7 +733,7 @@ public String getZip() { /** * Setter for Zip. - * The customer’s shipping address zip code (i.e. “12345”) + * The customer’s shipping address zip code (e.g., “12345”) * @param zip Value for String */ @JsonSetter("zip") @@ -730,7 +743,7 @@ public void setZip(String zip) { /** * UnSetter for Zip. - * The customer’s shipping address zip code (i.e. “12345”) + * The customer’s shipping address zip code (e.g., “12345”) */ public void unsetZip() { zip = null; @@ -1035,6 +1048,29 @@ public void setTaxExempt(Boolean taxExempt) { this.taxExempt = taxExempt; } + /** + * Getter for Surcharging. + * Whether surcharging is enabled for the customer. Only included on sites where surcharging + * control is enabled. + * @return Returns the Boolean + */ + @JsonGetter("surcharging") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getSurcharging() { + return surcharging; + } + + /** + * Setter for Surcharging. + * Whether surcharging is enabled for the customer. Only included on sites where surcharging + * control is enabled. + * @param surcharging Value for Boolean + */ + @JsonSetter("surcharging") + public void setSurcharging(Boolean surcharging) { + this.surcharging = surcharging; + } + /** * Internal Getter for VatNumber. * The VAT business identification number for the customer. This number is used to determine VAT @@ -1355,6 +1391,57 @@ public void unsetMaxioid() { maxioid = null; } + /** + * Internal Getter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @return Returns the Internal Integer + */ + @JsonGetter("branding_theme_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBrandingThemeId() { + return this.brandingThemeId; + } + + /** + * Getter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @return Returns the Integer + */ + public Integer getBrandingThemeId() { + return OptionalNullable.getFrom(brandingThemeId); + } + + /** + * Setter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @param brandingThemeId Value for Integer + */ + @JsonSetter("branding_theme_id") + public void setBrandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + } + + /** + * UnSetter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + */ + public void unsetBrandingThemeId() { + brandingThemeId = null; + } + /** * Converts this Customer into string format. * @return String representation of this class @@ -1370,11 +1457,12 @@ public String toString() { + ", verified=" + verified + ", portalCustomerCreatedAt=" + portalCustomerCreatedAt + ", portalInviteLastSentAt=" + portalInviteLastSentAt + ", portalInviteLastAcceptedAt=" + portalInviteLastAcceptedAt + ", taxExempt=" - + taxExempt + ", vatNumber=" + vatNumber + ", parentId=" + parentId + ", locale=" - + locale + ", defaultSubscriptionGroupUid=" + defaultSubscriptionGroupUid - + ", salesforceId=" + salesforceId + ", taxExemptReason=" + taxExemptReason - + ", defaultAutoRenewalProfileId=" + defaultAutoRenewalProfileId + ", maxioid=" - + maxioid + ", additionalProperties=" + getAdditionalProperties() + "]"; + + taxExempt + ", surcharging=" + surcharging + ", vatNumber=" + vatNumber + + ", parentId=" + parentId + ", locale=" + locale + ", defaultSubscriptionGroupUid=" + + defaultSubscriptionGroupUid + ", salesforceId=" + salesforceId + + ", taxExemptReason=" + taxExemptReason + ", defaultAutoRenewalProfileId=" + + defaultAutoRenewalProfileId + ", maxioid=" + maxioid + ", brandingThemeId=" + + brandingThemeId + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -1390,7 +1478,8 @@ public Builder toBuilder() { .id(getId()) .createdAt(getCreatedAt()) .updatedAt(getUpdatedAt()) - .taxExempt(getTaxExempt()); + .taxExempt(getTaxExempt()) + .surcharging(getSurcharging()); builder.ccEmails = internalGetCcEmails(); builder.organization = internalGetOrganization(); builder.reference = internalGetReference(); @@ -1415,6 +1504,7 @@ public Builder toBuilder() { builder.taxExemptReason = internalGetTaxExemptReason(); builder.defaultAutoRenewalProfileId = internalGetDefaultAutoRenewalProfileId(); builder.maxioid = internalGetMaxioid(); + builder.brandingThemeId = internalGetBrandingThemeId(); return builder; } @@ -1445,6 +1535,7 @@ public static class Builder { private OptionalNullable portalInviteLastSentAt; private OptionalNullable portalInviteLastAcceptedAt; private Boolean taxExempt; + private Boolean surcharging; private OptionalNullable vatNumber; private OptionalNullable parentId; private OptionalNullable locale; @@ -1453,6 +1544,7 @@ public static class Builder { private OptionalNullable taxExemptReason; private OptionalNullable defaultAutoRenewalProfileId; private OptionalNullable maxioid; + private OptionalNullable brandingThemeId; @@ -1830,6 +1922,16 @@ public Builder taxExempt(Boolean taxExempt) { return this; } + /** + * Setter for surcharging. + * @param surcharging Boolean value for surcharging. + * @return Builder + */ + public Builder surcharging(Boolean surcharging) { + this.surcharging = surcharging; + return this; + } + /** * Setter for vatNumber. * @param vatNumber String value for vatNumber. @@ -1982,6 +2084,25 @@ public Builder unsetMaxioid() { return this; } + /** + * Setter for brandingThemeId. + * @param brandingThemeId Integer value for brandingThemeId. + * @return Builder + */ + public Builder brandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + return this; + } + + /** + * UnSetter for brandingThemeId. + * @return Builder + */ + public Builder unsetBrandingThemeId() { + brandingThemeId = null; + return this; + } + /** * Builds a new {@link Customer} object using the set fields. * @return {@link Customer} @@ -1990,9 +2111,9 @@ public Customer build() { return new Customer(firstName, lastName, email, ccEmails, organization, reference, id, createdAt, updatedAt, address, address2, city, state, stateName, zip, country, countryName, phone, verified, portalCustomerCreatedAt, portalInviteLastSentAt, - portalInviteLastAcceptedAt, taxExempt, vatNumber, parentId, locale, + portalInviteLastAcceptedAt, taxExempt, surcharging, vatNumber, parentId, locale, defaultSubscriptionGroupUid, salesforceId, taxExemptReason, - defaultAutoRenewalProfileId, maxioid); + defaultAutoRenewalProfileId, maxioid, brandingThemeId); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/CustomerAttributes.java b/src/main/java/com/maxio/advancedbilling/models/CustomerAttributes.java index 631b4373..fc1e3ae2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CustomerAttributes.java +++ b/src/main/java/com/maxio/advancedbilling/models/CustomerAttributes.java @@ -34,6 +34,7 @@ public class CustomerAttributes private String phone; private Boolean verified; private Boolean taxExempt; + private Boolean surcharging; private String vatNumber; private Map metafields; private OptionalNullable parentId; @@ -63,6 +64,7 @@ public CustomerAttributes() { * @param phone String value for phone. * @param verified Boolean value for verified. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param vatNumber String value for vatNumber. * @param metafields Map of String, value for metafields. * @param parentId Integer value for parentId. @@ -85,6 +87,7 @@ public CustomerAttributes( String phone, Boolean verified, Boolean taxExempt, + Boolean surcharging, String vatNumber, Map metafields, Integer parentId, @@ -105,6 +108,7 @@ public CustomerAttributes( this.phone = phone; this.verified = verified; this.taxExempt = taxExempt; + this.surcharging = surcharging; this.vatNumber = vatNumber; this.metafields = metafields; this.parentId = OptionalNullable.of(parentId); @@ -129,6 +133,7 @@ public CustomerAttributes( * @param phone String value for phone. * @param verified Boolean value for verified. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param vatNumber String value for vatNumber. * @param metafields Map of String, value for metafields. * @param parentId Integer value for parentId. @@ -139,8 +144,8 @@ public CustomerAttributes( protected CustomerAttributes(String firstName, String lastName, String email, String ccEmails, String organization, String reference, String address, OptionalNullable address2, String city, String state, String zip, - String country, String phone, Boolean verified, Boolean taxExempt, String vatNumber, - Map metafields, OptionalNullable parentId, + String country, String phone, Boolean verified, Boolean taxExempt, Boolean surcharging, + String vatNumber, Map metafields, OptionalNullable parentId, OptionalNullable salesforceId, OptionalNullable defaultAutoRenewalProfileId) { this.firstName = firstName; @@ -158,6 +163,7 @@ protected CustomerAttributes(String firstName, String lastName, String email, St this.phone = phone; this.verified = verified; this.taxExempt = taxExempt; + this.surcharging = surcharging; this.vatNumber = vatNumber; this.metafields = metafields; this.parentId = parentId; @@ -230,7 +236,7 @@ public void setEmail(String email) { /** * Getter for CcEmails. - * A list of emails that should be cc’d on all customer communications. Optional. + * (Optional) A list of emails that should be cc’d on all customer communications. * @return Returns the String */ @JsonGetter("cc_emails") @@ -241,7 +247,7 @@ public String getCcEmails() { /** * Setter for CcEmails. - * A list of emails that should be cc’d on all customer communications. Optional. + * (Optional) A list of emails that should be cc’d on all customer communications. * @param ccEmails Value for String */ @JsonSetter("cc_emails") @@ -251,7 +257,7 @@ public void setCcEmails(String ccEmails) { /** * Getter for Organization. - * The organization/company of the customer. Optional. + * (Optional) The organization/company of the customer. * @return Returns the String */ @JsonGetter("organization") @@ -262,7 +268,7 @@ public String getOrganization() { /** * Setter for Organization. - * The organization/company of the customer. Optional. + * (Optional) The organization/company of the customer. * @param organization Value for String */ @JsonSetter("organization") @@ -272,9 +278,9 @@ public void setOrganization(String organization) { /** * Getter for Reference. - * A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used - * so that you may reference your customer’s within Chargify using the same unique value you use - * in your application. Optional. + * (Optional) A customer “reference”, or unique identifier from your app, stored in Chargify. + * Can be used so that you may reference your customer’s within Chargify using the same unique + * value you use in your application. * @return Returns the String */ @JsonGetter("reference") @@ -285,9 +291,9 @@ public String getReference() { /** * Setter for Reference. - * A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used - * so that you may reference your customer’s within Chargify using the same unique value you use - * in your application. Optional. + * (Optional) A customer “reference”, or unique identifier from your app, stored in Chargify. + * Can be used so that you may reference your customer’s within Chargify using the same unique + * value you use in your application. * @param reference Value for String */ @JsonSetter("reference") @@ -297,7 +303,7 @@ public void setReference(String reference) { /** * Getter for Address. - * (Optional) The customer’s shipping street address (i.e. “123 Main St.”). + * (Optional) The customer’s shipping street address (e.g., “123 Main St.”). * @return Returns the String */ @JsonGetter("address") @@ -308,7 +314,7 @@ public String getAddress() { /** * Setter for Address. - * (Optional) The customer’s shipping street address (i.e. “123 Main St.”). + * (Optional) The customer’s shipping street address (e.g., “123 Main St.”). * @param address Value for String */ @JsonSetter("address") @@ -318,7 +324,7 @@ public void setAddress(String address) { /** * Internal Getter for Address2. - * (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” + * (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” * @return Returns the Internal String */ @JsonGetter("address_2") @@ -330,7 +336,7 @@ protected OptionalNullable internalGetAddress2() { /** * Getter for Address2. - * (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” + * (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” * @return Returns the String */ public String getAddress2() { @@ -339,7 +345,7 @@ public String getAddress2() { /** * Setter for Address2. - * (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” + * (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” * @param address2 Value for String */ @JsonSetter("address_2") @@ -349,7 +355,7 @@ public void setAddress2(String address2) { /** * UnSetter for Address2. - * (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” + * (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” */ public void unsetAddress2() { address2 = null; @@ -357,7 +363,7 @@ public void unsetAddress2() { /** * Getter for City. - * (Optional) The customer’s shipping address city (i.e. “Boston”). + * (Optional) The customer’s shipping address city (e.g., “Boston”). * @return Returns the String */ @JsonGetter("city") @@ -368,7 +374,7 @@ public String getCity() { /** * Setter for City. - * (Optional) The customer’s shipping address city (i.e. “Boston”). + * (Optional) The customer’s shipping address city (e.g., “Boston”). * @param city Value for String */ @JsonSetter("city") @@ -378,9 +384,9 @@ public void setCity(String city) { /** * Getter for State. - * (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the + * “(Optional) The customer’s shipping address state (e.g., “MA”). This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for - * tax locale purposes. + * tax locale purposes.” * @return Returns the String */ @JsonGetter("state") @@ -391,9 +397,9 @@ public String getState() { /** * Setter for State. - * (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the + * “(Optional) The customer’s shipping address state (e.g., “MA”). This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for - * tax locale purposes. + * tax locale purposes.” * @param state Value for String */ @JsonSetter("state") @@ -403,7 +409,7 @@ public void setState(String state) { /** * Getter for Zip. - * (Optional) The customer’s shipping address zip code (i.e. “12345”). + * (Optional) The customer’s shipping address zip code (e.g., “12345”). * @return Returns the String */ @JsonGetter("zip") @@ -414,7 +420,7 @@ public String getZip() { /** * Setter for Zip. - * (Optional) The customer’s shipping address zip code (i.e. “12345”). + * (Optional) The customer’s shipping address zip code (e.g., “12345”). * @param zip Value for String */ @JsonSetter("zip") @@ -424,8 +430,8 @@ public void setZip(String zip) { /** * Getter for Country. - * (Optional) The customer shipping address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). + * “(Optional) The customer shipping address country, required in [ISO_3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”).” * @return Returns the String */ @JsonGetter("country") @@ -436,8 +442,8 @@ public String getCountry() { /** * Setter for Country. - * (Optional) The customer shipping address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). + * “(Optional) The customer shipping address country, required in [ISO_3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”).” * @param country Value for String */ @JsonSetter("country") @@ -508,9 +514,32 @@ public void setTaxExempt(Boolean taxExempt) { this.taxExempt = taxExempt; } + /** + * Getter for Surcharging. + * (Optional) Whether surcharging is enabled for the customer. Defaults to `true` when omitted. + * Only applied on sites where surcharging control is enabled. + * @return Returns the Boolean + */ + @JsonGetter("surcharging") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getSurcharging() { + return surcharging; + } + + /** + * Setter for Surcharging. + * (Optional) Whether surcharging is enabled for the customer. Defaults to `true` when omitted. + * Only applied on sites where surcharging control is enabled. + * @param surcharging Value for Boolean + */ + @JsonSetter("surcharging") + public void setSurcharging(Boolean surcharging) { + this.surcharging = surcharging; + } + /** * Getter for VatNumber. - * (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax + * (Optional) Supplying the VAT number allows EU customers to opt-out of the Value Added Tax * assuming the merchant address and customer billing address are not within the same EU * country. It’s important to omit the country code from the VAT number upon entry. Otherwise, * taxes will be assessed upon the purchase. @@ -524,7 +553,7 @@ public String getVatNumber() { /** * Setter for VatNumber. - * (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax + * (Optional) Supplying the VAT number allows EU customers to opt-out of the Value Added Tax * assuming the merchant address and customer billing address are not within the same EU * country. It’s important to omit the country code from the VAT number upon entry. Otherwise, * taxes will be assessed upon the purchase. @@ -686,10 +715,10 @@ public String toString() { + ", reference=" + reference + ", address=" + address + ", address2=" + address2 + ", city=" + city + ", state=" + state + ", zip=" + zip + ", country=" + country + ", phone=" + phone + ", verified=" + verified + ", taxExempt=" + taxExempt - + ", vatNumber=" + vatNumber + ", metafields=" + metafields + ", parentId=" - + parentId + ", salesforceId=" + salesforceId + ", defaultAutoRenewalProfileId=" - + defaultAutoRenewalProfileId + ", additionalProperties=" - + getAdditionalProperties() + "]"; + + ", surcharging=" + surcharging + ", vatNumber=" + vatNumber + ", metafields=" + + metafields + ", parentId=" + parentId + ", salesforceId=" + salesforceId + + ", defaultAutoRenewalProfileId=" + defaultAutoRenewalProfileId + + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -713,6 +742,7 @@ public Builder toBuilder() { .phone(getPhone()) .verified(getVerified()) .taxExempt(getTaxExempt()) + .surcharging(getSurcharging()) .vatNumber(getVatNumber()) .metafields(getMetafields()); builder.address2 = internalGetAddress2(); @@ -741,6 +771,7 @@ public static class Builder { private String phone; private Boolean verified; private Boolean taxExempt; + private Boolean surcharging; private String vatNumber; private Map metafields; private OptionalNullable parentId; @@ -908,6 +939,16 @@ public Builder taxExempt(Boolean taxExempt) { return this; } + /** + * Setter for surcharging. + * @param surcharging Boolean value for surcharging. + * @return Builder + */ + public Builder surcharging(Boolean surcharging) { + this.surcharging = surcharging; + return this; + } + /** * Setter for vatNumber. * @param vatNumber String value for vatNumber. @@ -992,7 +1033,7 @@ public Builder unsetDefaultAutoRenewalProfileId() { public CustomerAttributes build() { return new CustomerAttributes(firstName, lastName, email, ccEmails, organization, reference, address, address2, city, state, zip, country, phone, verified, - taxExempt, vatNumber, metafields, parentId, salesforceId, + taxExempt, surcharging, vatNumber, metafields, parentId, salesforceId, defaultAutoRenewalProfileId); } } diff --git a/src/main/java/com/maxio/advancedbilling/models/DebitNote.java b/src/main/java/com/maxio/advancedbilling/models/DebitNote.java index 183cf858..48d21b6a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/DebitNote.java +++ b/src/main/java/com/maxio/advancedbilling/models/DebitNote.java @@ -214,7 +214,7 @@ public void setSubscriptionId(Integer subscriptionId) { /** * Getter for Number. - * A unique, identifier that appears on the debit note and in places it is referenced. + * A unique identifier that appears on the debit note and in places it is referenced. * @return Returns the Integer */ @JsonGetter("number") @@ -225,7 +225,7 @@ public Integer getNumber() { /** * Setter for Number. - * A unique, identifier that appears on the debit note and in places it is referenced. + * A unique identifier that appears on the debit note and in places it is referenced. * @param number Value for Integer */ @JsonSetter("number") @@ -283,7 +283,7 @@ public void setOriginCreditNoteUid(String originCreditNoteUid) { /** * Getter for OriginCreditNoteNumber. - * A unique, identifying string of the connected credit note. + * A unique identifying string of the connected credit note. * @return Returns the String */ @JsonGetter("origin_credit_note_number") @@ -294,7 +294,7 @@ public String getOriginCreditNoteNumber() { /** * Setter for OriginCreditNoteNumber. - * A unique, identifying string of the connected credit note. + * A unique identifying string of the connected credit note. * @param originCreditNoteNumber Value for String */ @JsonSetter("origin_credit_note_number") @@ -486,7 +486,7 @@ public void setSeller(InvoiceSeller seller) { /** * Getter for Customer. - * Information about the customer who is owner or recipient the debited subscription. + * Information about the customer who is the owner or recipient of the debited subscription. * @return Returns the InvoiceCustomer */ @JsonGetter("customer") @@ -497,7 +497,7 @@ public InvoiceCustomer getCustomer() { /** * Setter for Customer. - * Information about the customer who is owner or recipient the debited subscription. + * Information about the customer who is the owner or recipient of the debited subscription. * @param customer Value for InvoiceCustomer */ @JsonSetter("customer") diff --git a/src/main/java/com/maxio/advancedbilling/models/DebitNoteRole.java b/src/main/java/com/maxio/advancedbilling/models/DebitNoteRole.java index 0a788baa..3c7b028a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/DebitNoteRole.java +++ b/src/main/java/com/maxio/advancedbilling/models/DebitNoteRole.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * DebitNoteRole to be used. */ @@ -21,7 +20,6 @@ public enum DebitNoteRole { REFUND; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/DebitNoteStatus.java b/src/main/java/com/maxio/advancedbilling/models/DebitNoteStatus.java index f0a2d7e3..dd6dc834 100644 --- a/src/main/java/com/maxio/advancedbilling/models/DebitNoteStatus.java +++ b/src/main/java/com/maxio/advancedbilling/models/DebitNoteStatus.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * DebitNoteStatus to be used. */ @@ -25,7 +24,6 @@ public enum DebitNoteStatus { PAID; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Direction.java b/src/main/java/com/maxio/advancedbilling/models/Direction.java index 66b6288c..82942732 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Direction.java +++ b/src/main/java/com/maxio/advancedbilling/models/Direction.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * Direction to be used. */ @@ -21,7 +20,6 @@ public enum Direction { DESC; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/DiscountType.java b/src/main/java/com/maxio/advancedbilling/models/DiscountType.java index 54b52024..8a855bda 100644 --- a/src/main/java/com/maxio/advancedbilling/models/DiscountType.java +++ b/src/main/java/com/maxio/advancedbilling/models/DiscountType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * DiscountType to be used. */ @@ -21,7 +20,6 @@ public enum DiscountType { PERCENT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/DowngradeCreditCreditType.java b/src/main/java/com/maxio/advancedbilling/models/DowngradeCreditCreditType.java index 93d85762..5f302391 100644 --- a/src/main/java/com/maxio/advancedbilling/models/DowngradeCreditCreditType.java +++ b/src/main/java/com/maxio/advancedbilling/models/DowngradeCreditCreditType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * DowngradeCreditCreditType to be used. */ @@ -23,7 +22,6 @@ public enum DowngradeCreditCreditType { NONE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java b/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java index 7c175147..57a804b0 100644 --- a/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java @@ -34,6 +34,7 @@ public class EBBComponent private int eventBasedBillingMetricId; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Default constructor. @@ -57,6 +58,7 @@ public EBBComponent() { * @param hideDateRangeOnInvoice Boolean value for hideDateRangeOnInvoice. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ public EBBComponent( String name, @@ -72,7 +74,8 @@ public EBBComponent( String taxCode, Boolean hideDateRangeOnInvoice, Integer interval, - IntervalUnit intervalUnit) { + IntervalUnit intervalUnit, + String unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -87,6 +90,7 @@ public EBBComponent( this.eventBasedBillingMetricId = eventBasedBillingMetricId; this.interval = interval; this.intervalUnit = OptionalNullable.of(intervalUnit); + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -105,13 +109,15 @@ public EBBComponent( * @param hideDateRangeOnInvoice Boolean value for hideDateRangeOnInvoice. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ protected EBBComponent(String name, String unitName, PricingScheme pricingScheme, int eventBasedBillingMetricId, String description, String handle, Boolean taxable, List prices, List pricePoints, EBBComponentUnitPrice unitPrice, String taxCode, Boolean hideDateRangeOnInvoice, - Integer interval, OptionalNullable intervalUnit) { + Integer interval, OptionalNullable intervalUnit, + OptionalNullable unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -126,12 +132,13 @@ protected EBBComponent(String name, String unitName, PricingScheme pricingScheme this.eventBasedBillingMetricId = eventBasedBillingMetricId; this.interval = interval; this.intervalUnit = intervalUnit; + this.unspscCode = unspscCode; } /** * Getter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, i.e., "Minutes". * @return Returns the String */ @JsonGetter("name") @@ -142,7 +149,7 @@ public String getName() { /** * Setter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, i.e., "Minutes". * @param name Value for String */ @JsonSetter("name") @@ -152,9 +159,9 @@ public void setName(String name) { /** * Getter for UnitName. - * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 - * messages” on a subscription’s component line-item + * “The name of the unit of measurement for the component. It should be singular since it will + * be automatically pluralized when necessary. i.e., “message”, which may then be shown as “5 + * messages” on a subscription’s component line-item” * @return Returns the String */ @JsonGetter("unit_name") @@ -164,9 +171,9 @@ public String getUnitName() { /** * Setter for UnitName. - * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 - * messages” on a subscription’s component line-item + * “The name of the unit of measurement for the component. It should be singular since it will + * be automatically pluralized when necessary. i.e., “message”, which may then be shown as “5 + * messages” on a subscription’s component line-item” * @param unitName Value for String */ @JsonSetter("unit_name") @@ -197,7 +204,7 @@ public void setDescription(String description) { /** * Getter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @return Returns the String @@ -210,7 +217,7 @@ public String getHandle() { /** * Setter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @param handle Value for String @@ -312,7 +319,7 @@ public void setPricePoints(List pricePoints) { /** * Getter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. The - * price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * price can contain up to 8 decimal places. i.e., 1.00 or 0.0012 or 0.00000065 * @return Returns the EBBComponentUnitPrice */ @JsonGetter("unit_price") @@ -324,7 +331,7 @@ public EBBComponentUnitPrice getUnitPrice() { /** * Setter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. The - * price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * price can contain up to 8 decimal places. i.e., 1.00 or 0.0012 or 0.00000065 * @param unitPrice Value for EBBComponentUnitPrice */ @JsonSetter("unit_price") @@ -402,7 +409,7 @@ public void setEventBasedBillingMetricId(int eventBasedBillingMetricId) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. i.e., an interval of ‘30’ coupled with an interval_unit of day would * mean this component's default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @return Returns the Integer @@ -415,7 +422,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. i.e., an interval of ‘30’ coupled with an interval_unit of day would * mean this component's default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @param interval Value for Integer @@ -468,6 +475,53 @@ public void unsetIntervalUnit() { intervalUnit = null; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this EBBComponent into string format. * @return String representation of this class @@ -479,8 +533,8 @@ public String toString() { + ", description=" + description + ", handle=" + handle + ", taxable=" + taxable + ", prices=" + prices + ", pricePoints=" + pricePoints + ", unitPrice=" + unitPrice + ", taxCode=" + taxCode + ", hideDateRangeOnInvoice=" + hideDateRangeOnInvoice - + ", interval=" + interval + ", intervalUnit=" + intervalUnit - + ", additionalProperties=" + getAdditionalProperties() + "]"; + + ", interval=" + interval + ", intervalUnit=" + intervalUnit + ", unspscCode=" + + unspscCode + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -500,6 +554,7 @@ public Builder toBuilder() { .hideDateRangeOnInvoice(getHideDateRangeOnInvoice()) .interval(getInterval()); builder.intervalUnit = internalGetIntervalUnit(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -521,6 +576,7 @@ public static class Builder { private Boolean hideDateRangeOnInvoice; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Initialization constructor. @@ -692,6 +748,25 @@ public Builder unsetIntervalUnit() { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link EBBComponent} object using the set fields. * @return {@link EBBComponent} @@ -699,7 +774,7 @@ public Builder unsetIntervalUnit() { public EBBComponent build() { return new EBBComponent(name, unitName, pricingScheme, eventBasedBillingMetricId, description, handle, taxable, prices, pricePoints, unitPrice, taxCode, - hideDateRangeOnInvoice, interval, intervalUnit); + hideDateRangeOnInvoice, interval, intervalUnit, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/Event.java b/src/main/java/com/maxio/advancedbilling/models/Event.java index 2e388887..fa1030d0 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Event.java +++ b/src/main/java/com/maxio/advancedbilling/models/Event.java @@ -174,17 +174,17 @@ public void setCreatedAt(ZonedDateTime createdAt) { /** * Getter for EventSpecificData. * The schema varies based on the event key. The key-to-event data mapping is as follows: * - * `subscription_product_change` - SubscriptionProductChange * `subscription_state_change` - - * SubscriptionStateChange * `signup_success`, `delayed_signup_creation_success`, - * `payment_success`, `payment_failure`, `renewal_success`, `renewal_failure`, - * `chargeback_lost`, `chargeback_accepted`, `chargeback_closed` - PaymentRelatedEvents * - * `refund_success` - RefundSuccess * `component_allocation_change` - ComponentAllocationChange - * * `metered_usage` - MeteredUsage * `prepaid_usage` - PrepaidUsage * `dunning_step_reached` - - * DunningStepReached * `invoice_issued` - InvoiceIssued * `pending_cancellation_change` - - * PendingCancellationChange * `prepaid_subscription_balance_changed` - - * PrepaidSubscriptionBalanceChanged * `subscription_group_signup_success` and - * `subscription_group_signup_failure` - SubscriptionGroupSignupEventData * - * `proforma_invoice_issued` - ProformaInvoiceIssued * + * `subscription_product_change`, `subscription_product_change_scheduled` - + * SubscriptionProductChange * `subscription_state_change` - SubscriptionStateChange * + * `signup_success`, `delayed_signup_creation_success`, `payment_success`, `payment_failure`, + * `renewal_success`, `renewal_failure`, `chargeback_lost`, `chargeback_accepted`, + * `chargeback_closed` - PaymentRelatedEvents * `refund_success` - RefundSuccess * + * `component_allocation_change` - ComponentAllocationChange * `metered_usage` - MeteredUsage * + * `prepaid_usage` - PrepaidUsage * `dunning_step_reached` - DunningStepReached * + * `invoice_issued` - InvoiceIssued * `pending_cancellation_change` - PendingCancellationChange + * * `prepaid_subscription_balance_changed` - PrepaidSubscriptionBalanceChanged * + * `subscription_group_signup_success` and `subscription_group_signup_failure` - + * SubscriptionGroupSignupEventData * `proforma_invoice_issued` - ProformaInvoiceIssued * * `subscription_prepayment_account_balance_changed` - PrepaymentAccountBalanceChanged * * `payment_collection_method_changed` - PaymentCollectionMethodChanged * * `subscription_service_credit_account_balance_changed` - CreditAccountBalanceChanged * @@ -225,17 +225,17 @@ public EventEventSpecificData getEventSpecificData() { /** * Setter for EventSpecificData. * The schema varies based on the event key. The key-to-event data mapping is as follows: * - * `subscription_product_change` - SubscriptionProductChange * `subscription_state_change` - - * SubscriptionStateChange * `signup_success`, `delayed_signup_creation_success`, - * `payment_success`, `payment_failure`, `renewal_success`, `renewal_failure`, - * `chargeback_lost`, `chargeback_accepted`, `chargeback_closed` - PaymentRelatedEvents * - * `refund_success` - RefundSuccess * `component_allocation_change` - ComponentAllocationChange - * * `metered_usage` - MeteredUsage * `prepaid_usage` - PrepaidUsage * `dunning_step_reached` - - * DunningStepReached * `invoice_issued` - InvoiceIssued * `pending_cancellation_change` - - * PendingCancellationChange * `prepaid_subscription_balance_changed` - - * PrepaidSubscriptionBalanceChanged * `subscription_group_signup_success` and - * `subscription_group_signup_failure` - SubscriptionGroupSignupEventData * - * `proforma_invoice_issued` - ProformaInvoiceIssued * + * `subscription_product_change`, `subscription_product_change_scheduled` - + * SubscriptionProductChange * `subscription_state_change` - SubscriptionStateChange * + * `signup_success`, `delayed_signup_creation_success`, `payment_success`, `payment_failure`, + * `renewal_success`, `renewal_failure`, `chargeback_lost`, `chargeback_accepted`, + * `chargeback_closed` - PaymentRelatedEvents * `refund_success` - RefundSuccess * + * `component_allocation_change` - ComponentAllocationChange * `metered_usage` - MeteredUsage * + * `prepaid_usage` - PrepaidUsage * `dunning_step_reached` - DunningStepReached * + * `invoice_issued` - InvoiceIssued * `pending_cancellation_change` - PendingCancellationChange + * * `prepaid_subscription_balance_changed` - PrepaidSubscriptionBalanceChanged * + * `subscription_group_signup_success` and `subscription_group_signup_failure` - + * SubscriptionGroupSignupEventData * `proforma_invoice_issued` - ProformaInvoiceIssued * * `subscription_prepayment_account_balance_changed` - PrepaymentAccountBalanceChanged * * `payment_collection_method_changed` - PaymentCollectionMethodChanged * * `subscription_service_credit_account_balance_changed` - CreditAccountBalanceChanged * diff --git a/src/main/java/com/maxio/advancedbilling/models/EventKey.java b/src/main/java/com/maxio/advancedbilling/models/EventKey.java index a9ca0d4d..d3408b59 100644 --- a/src/main/java/com/maxio/advancedbilling/models/EventKey.java +++ b/src/main/java/com/maxio/advancedbilling/models/EventKey.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * EventKey to be used. */ @@ -41,6 +40,8 @@ public enum EventKey { SUBSCRIPTION_PRODUCT_CHANGE, + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED, + PENDING_CANCELLATION_CHANGE, EXPIRING_CARD, @@ -183,7 +184,6 @@ public enum EventKey { SUBSCRIPTION_TERM_RENEWAL_REMOVED; - private static TreeMap valueMap = new TreeMap<>(); private String value; @@ -200,6 +200,7 @@ public enum EventKey { RENEWAL_FAILURE.value = "renewal_failure"; SUBSCRIPTION_STATE_CHANGE.value = "subscription_state_change"; SUBSCRIPTION_PRODUCT_CHANGE.value = "subscription_product_change"; + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED.value = "subscription_product_change_scheduled"; PENDING_CANCELLATION_CHANGE.value = "pending_cancellation_change"; EXPIRING_CARD.value = "expiring_card"; CUSTOMER_UPDATE.value = "customer_update"; @@ -284,6 +285,7 @@ public enum EventKey { valueMap.put("renewal_failure", RENEWAL_FAILURE); valueMap.put("subscription_state_change", SUBSCRIPTION_STATE_CHANGE); valueMap.put("subscription_product_change", SUBSCRIPTION_PRODUCT_CHANGE); + valueMap.put("subscription_product_change_scheduled", SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED); valueMap.put("pending_cancellation_change", PENDING_CANCELLATION_CHANGE); valueMap.put("expiring_card", EXPIRING_CARD); valueMap.put("customer_update", CUSTOMER_UPDATE); diff --git a/src/main/java/com/maxio/advancedbilling/models/ExpirationIntervalUnit.java b/src/main/java/com/maxio/advancedbilling/models/ExpirationIntervalUnit.java index ed82d790..cc333b9d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ExpirationIntervalUnit.java +++ b/src/main/java/com/maxio/advancedbilling/models/ExpirationIntervalUnit.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ExpirationIntervalUnit to be used. */ @@ -23,7 +22,6 @@ public enum ExpirationIntervalUnit { NEVER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/FailedPaymentAction.java b/src/main/java/com/maxio/advancedbilling/models/FailedPaymentAction.java index 7c978619..1fd647b2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/FailedPaymentAction.java +++ b/src/main/java/com/maxio/advancedbilling/models/FailedPaymentAction.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * FailedPaymentAction to be used. */ @@ -23,7 +22,6 @@ public enum FailedPaymentAction { INITIATE_DUNNING; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/FirstChargeType.java b/src/main/java/com/maxio/advancedbilling/models/FirstChargeType.java index 2f2b98c7..5d697f26 100644 --- a/src/main/java/com/maxio/advancedbilling/models/FirstChargeType.java +++ b/src/main/java/com/maxio/advancedbilling/models/FirstChargeType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * FirstChargeType to be used. */ @@ -23,7 +22,6 @@ public enum FirstChargeType { DELAYED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenBankAccountPaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenBankAccountPaymentProfile.java new file mode 100644 index 00000000..a50c3b76 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenBankAccountPaymentProfile.java @@ -0,0 +1,1157 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.apimatic.core.types.BaseModel; +import io.apimatic.core.types.OptionalNullable; + +/** + * This is a model class for GetOneTimeTokenBankAccountPaymentProfile type. + */ +public class GetOneTimeTokenBankAccountPaymentProfile + extends BaseModel { + private OptionalNullable id; + private String firstName; + private String lastName; + private OptionalNullable customerId; + private BankAccountVault currentVault; + private String vaultToken; + private String billingAddress; + private String billingAddress2; + private String billingCity; + private String billingCountry; + private String billingState; + private String billingZip; + private String bankName; + private String maskedBankRoutingNumber; + private String maskedBankAccountNumber; + private BankAccountType bankAccountType; + private BankAccountHolderType bankAccountHolderType; + private String paymentType; + private boolean disabled; + private int siteGatewaySettingId; + private OptionalNullable customerVaultToken; + private OptionalNullable gatewayHandle; + private OptionalNullable verified; + + /** + * Default constructor. + */ + public GetOneTimeTokenBankAccountPaymentProfile() { + } + + /** + * Initialization constructor. + * @param firstName String value for firstName. + * @param lastName String value for lastName. + * @param currentVault BankAccountVault value for currentVault. + * @param vaultToken String value for vaultToken. + * @param billingAddress String value for billingAddress. + * @param billingCity String value for billingCity. + * @param billingCountry String value for billingCountry. + * @param billingState String value for billingState. + * @param billingZip String value for billingZip. + * @param bankName String value for bankName. + * @param maskedBankRoutingNumber String value for maskedBankRoutingNumber. + * @param maskedBankAccountNumber String value for maskedBankAccountNumber. + * @param bankAccountType BankAccountType value for bankAccountType. + * @param bankAccountHolderType BankAccountHolderType value for bankAccountHolderType. + * @param paymentType String value for paymentType. + * @param disabled boolean value for disabled. + * @param siteGatewaySettingId int value for siteGatewaySettingId. + * @param id String value for id. + * @param customerId String value for customerId. + * @param billingAddress2 String value for billingAddress2. + * @param customerVaultToken String value for customerVaultToken. + * @param gatewayHandle String value for gatewayHandle. + * @param verified Boolean value for verified. + */ + public GetOneTimeTokenBankAccountPaymentProfile( + String firstName, + String lastName, + BankAccountVault currentVault, + String vaultToken, + String billingAddress, + String billingCity, + String billingCountry, + String billingState, + String billingZip, + String bankName, + String maskedBankRoutingNumber, + String maskedBankAccountNumber, + BankAccountType bankAccountType, + BankAccountHolderType bankAccountHolderType, + String paymentType, + boolean disabled, + int siteGatewaySettingId, + String id, + String customerId, + String billingAddress2, + String customerVaultToken, + String gatewayHandle, + Boolean verified) { + this.id = OptionalNullable.of(id); + this.firstName = firstName; + this.lastName = lastName; + this.customerId = OptionalNullable.of(customerId); + this.currentVault = currentVault; + this.vaultToken = vaultToken; + this.billingAddress = billingAddress; + this.billingAddress2 = billingAddress2; + this.billingCity = billingCity; + this.billingCountry = billingCountry; + this.billingState = billingState; + this.billingZip = billingZip; + this.bankName = bankName; + this.maskedBankRoutingNumber = maskedBankRoutingNumber; + this.maskedBankAccountNumber = maskedBankAccountNumber; + this.bankAccountType = bankAccountType; + this.bankAccountHolderType = bankAccountHolderType; + this.paymentType = paymentType; + this.disabled = disabled; + this.siteGatewaySettingId = siteGatewaySettingId; + this.customerVaultToken = OptionalNullable.of(customerVaultToken); + this.gatewayHandle = OptionalNullable.of(gatewayHandle); + this.verified = OptionalNullable.of(verified); + } + + /** + * Initialization constructor. + * @param firstName String value for firstName. + * @param lastName String value for lastName. + * @param currentVault BankAccountVault value for currentVault. + * @param vaultToken String value for vaultToken. + * @param billingAddress String value for billingAddress. + * @param billingCity String value for billingCity. + * @param billingCountry String value for billingCountry. + * @param billingState String value for billingState. + * @param billingZip String value for billingZip. + * @param bankName String value for bankName. + * @param maskedBankRoutingNumber String value for maskedBankRoutingNumber. + * @param maskedBankAccountNumber String value for maskedBankAccountNumber. + * @param bankAccountType BankAccountType value for bankAccountType. + * @param bankAccountHolderType BankAccountHolderType value for bankAccountHolderType. + * @param paymentType String value for paymentType. + * @param disabled boolean value for disabled. + * @param siteGatewaySettingId int value for siteGatewaySettingId. + * @param id String value for id. + * @param customerId String value for customerId. + * @param billingAddress2 String value for billingAddress2. + * @param customerVaultToken String value for customerVaultToken. + * @param gatewayHandle String value for gatewayHandle. + * @param verified Boolean value for verified. + */ + + protected GetOneTimeTokenBankAccountPaymentProfile(String firstName, String lastName, + BankAccountVault currentVault, String vaultToken, String billingAddress, + String billingCity, String billingCountry, String billingState, String billingZip, + String bankName, String maskedBankRoutingNumber, String maskedBankAccountNumber, + BankAccountType bankAccountType, BankAccountHolderType bankAccountHolderType, + String paymentType, boolean disabled, int siteGatewaySettingId, + OptionalNullable id, OptionalNullable customerId, + String billingAddress2, OptionalNullable customerVaultToken, + OptionalNullable gatewayHandle, OptionalNullable verified) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + this.customerId = customerId; + this.currentVault = currentVault; + this.vaultToken = vaultToken; + this.billingAddress = billingAddress; + this.billingAddress2 = billingAddress2; + this.billingCity = billingCity; + this.billingCountry = billingCountry; + this.billingState = billingState; + this.billingZip = billingZip; + this.bankName = bankName; + this.maskedBankRoutingNumber = maskedBankRoutingNumber; + this.maskedBankAccountNumber = maskedBankAccountNumber; + this.bankAccountType = bankAccountType; + this.bankAccountHolderType = bankAccountHolderType; + this.paymentType = paymentType; + this.disabled = disabled; + this.siteGatewaySettingId = siteGatewaySettingId; + this.customerVaultToken = customerVaultToken; + this.gatewayHandle = gatewayHandle; + this.verified = verified; + } + + /** + * Initialization constructor. + * @param firstName String value for firstName. + * @param lastName String value for lastName. + * @param currentVault BankAccountVault value for currentVault. + * @param vaultToken String value for vaultToken. + * @param billingAddress String value for billingAddress. + * @param billingCity String value for billingCity. + * @param billingCountry String value for billingCountry. + * @param billingState String value for billingState. + * @param billingZip String value for billingZip. + * @param bankName String value for bankName. + * @param maskedBankRoutingNumber String value for maskedBankRoutingNumber. + * @param maskedBankAccountNumber String value for maskedBankAccountNumber. + * @param bankAccountType BankAccountType value for bankAccountType. + * @param bankAccountHolderType BankAccountHolderType value for bankAccountHolderType. + * @param paymentType String value for paymentType. + * @param disabled boolean value for disabled. + * @param siteGatewaySettingId int value for siteGatewaySettingId. + */ + @JsonCreator + protected GetOneTimeTokenBankAccountPaymentProfile( + @JsonProperty("first_name") String firstName, + @JsonProperty("last_name") String lastName, + @JsonProperty("current_vault") BankAccountVault currentVault, + @JsonProperty("vault_token") String vaultToken, + @JsonProperty("billing_address") String billingAddress, + @JsonProperty("billing_city") String billingCity, + @JsonProperty("billing_country") String billingCountry, + @JsonProperty("billing_state") String billingState, + @JsonProperty("billing_zip") String billingZip, + @JsonProperty("bank_name") String bankName, + @JsonProperty("masked_bank_routing_number") String maskedBankRoutingNumber, + @JsonProperty("masked_bank_account_number") String maskedBankAccountNumber, + @JsonProperty("bank_account_type") BankAccountType bankAccountType, + @JsonProperty("bank_account_holder_type") BankAccountHolderType bankAccountHolderType, + @JsonProperty("payment_type") String paymentType, + @JsonProperty("disabled") boolean disabled, + @JsonProperty("site_gateway_setting_id") int siteGatewaySettingId) { + this(firstName, lastName, currentVault, vaultToken, billingAddress, billingCity, + billingCountry, billingState, billingZip, bankName, maskedBankRoutingNumber, + maskedBankAccountNumber, bankAccountType, bankAccountHolderType, paymentType, + disabled, siteGatewaySettingId, OptionalNullable.of(null), + OptionalNullable.of(null), null, OptionalNullable.of(null), + OptionalNullable.of(null), OptionalNullable.of(null)); + unsetId(); + unsetCustomerId(); + unsetCustomerVaultToken(); + unsetGatewayHandle(); + unsetVerified(); + } + + /** + * Internal Getter for Id. + * @return Returns the Internal String + */ + @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetId() { + return this.id; + } + + /** + * Getter for Id. + * @return Returns the String + */ + public String getId() { + return OptionalNullable.getFrom(id); + } + + /** + * Setter for Id. + * @param id Value for String + */ + @JsonSetter("id") + public void setId(String id) { + this.id = OptionalNullable.of(id); + } + + /** + * UnSetter for Id. + */ + public void unsetId() { + id = null; + } + + /** + * Getter for FirstName. + * @return Returns the String + */ + @JsonGetter("first_name") + public String getFirstName() { + return firstName; + } + + /** + * Setter for FirstName. + * @param firstName Value for String + */ + @JsonSetter("first_name") + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Getter for LastName. + * @return Returns the String + */ + @JsonGetter("last_name") + public String getLastName() { + return lastName; + } + + /** + * Setter for LastName. + * @param lastName Value for String + */ + @JsonSetter("last_name") + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Internal Getter for CustomerId. + * @return Returns the Internal String + */ + @JsonGetter("customer_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetCustomerId() { + return this.customerId; + } + + /** + * Getter for CustomerId. + * @return Returns the String + */ + public String getCustomerId() { + return OptionalNullable.getFrom(customerId); + } + + /** + * Setter for CustomerId. + * @param customerId Value for String + */ + @JsonSetter("customer_id") + public void setCustomerId(String customerId) { + this.customerId = OptionalNullable.of(customerId); + } + + /** + * UnSetter for CustomerId. + */ + public void unsetCustomerId() { + customerId = null; + } + + /** + * Getter for CurrentVault. + * The vault that stores the payment profile with the provided vault_token. Use `bogus` for + * testing. + * @return Returns the BankAccountVault + */ + @JsonGetter("current_vault") + public BankAccountVault getCurrentVault() { + return currentVault; + } + + /** + * Setter for CurrentVault. + * The vault that stores the payment profile with the provided vault_token. Use `bogus` for + * testing. + * @param currentVault Value for BankAccountVault + */ + @JsonSetter("current_vault") + public void setCurrentVault(BankAccountVault currentVault) { + this.currentVault = currentVault; + } + + /** + * Getter for VaultToken. + * @return Returns the String + */ + @JsonGetter("vault_token") + public String getVaultToken() { + return vaultToken; + } + + /** + * Setter for VaultToken. + * @param vaultToken Value for String + */ + @JsonSetter("vault_token") + public void setVaultToken(String vaultToken) { + this.vaultToken = vaultToken; + } + + /** + * Getter for BillingAddress. + * @return Returns the String + */ + @JsonGetter("billing_address") + public String getBillingAddress() { + return billingAddress; + } + + /** + * Setter for BillingAddress. + * @param billingAddress Value for String + */ + @JsonSetter("billing_address") + public void setBillingAddress(String billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * Getter for BillingAddress2. + * @return Returns the String + */ + @JsonGetter("billing_address_2") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getBillingAddress2() { + return billingAddress2; + } + + /** + * Setter for BillingAddress2. + * @param billingAddress2 Value for String + */ + @JsonSetter("billing_address_2") + public void setBillingAddress2(String billingAddress2) { + this.billingAddress2 = billingAddress2; + } + + /** + * Getter for BillingCity. + * @return Returns the String + */ + @JsonGetter("billing_city") + public String getBillingCity() { + return billingCity; + } + + /** + * Setter for BillingCity. + * @param billingCity Value for String + */ + @JsonSetter("billing_city") + public void setBillingCity(String billingCity) { + this.billingCity = billingCity; + } + + /** + * Getter for BillingCountry. + * @return Returns the String + */ + @JsonGetter("billing_country") + public String getBillingCountry() { + return billingCountry; + } + + /** + * Setter for BillingCountry. + * @param billingCountry Value for String + */ + @JsonSetter("billing_country") + public void setBillingCountry(String billingCountry) { + this.billingCountry = billingCountry; + } + + /** + * Getter for BillingState. + * @return Returns the String + */ + @JsonGetter("billing_state") + public String getBillingState() { + return billingState; + } + + /** + * Setter for BillingState. + * @param billingState Value for String + */ + @JsonSetter("billing_state") + public void setBillingState(String billingState) { + this.billingState = billingState; + } + + /** + * Getter for BillingZip. + * @return Returns the String + */ + @JsonGetter("billing_zip") + public String getBillingZip() { + return billingZip; + } + + /** + * Setter for BillingZip. + * @param billingZip Value for String + */ + @JsonSetter("billing_zip") + public void setBillingZip(String billingZip) { + this.billingZip = billingZip; + } + + /** + * Getter for BankName. + * @return Returns the String + */ + @JsonGetter("bank_name") + public String getBankName() { + return bankName; + } + + /** + * Setter for BankName. + * @param bankName Value for String + */ + @JsonSetter("bank_name") + public void setBankName(String bankName) { + this.bankName = bankName; + } + + /** + * Getter for MaskedBankRoutingNumber. + * @return Returns the String + */ + @JsonGetter("masked_bank_routing_number") + public String getMaskedBankRoutingNumber() { + return maskedBankRoutingNumber; + } + + /** + * Setter for MaskedBankRoutingNumber. + * @param maskedBankRoutingNumber Value for String + */ + @JsonSetter("masked_bank_routing_number") + public void setMaskedBankRoutingNumber(String maskedBankRoutingNumber) { + this.maskedBankRoutingNumber = maskedBankRoutingNumber; + } + + /** + * Getter for MaskedBankAccountNumber. + * @return Returns the String + */ + @JsonGetter("masked_bank_account_number") + public String getMaskedBankAccountNumber() { + return maskedBankAccountNumber; + } + + /** + * Setter for MaskedBankAccountNumber. + * @param maskedBankAccountNumber Value for String + */ + @JsonSetter("masked_bank_account_number") + public void setMaskedBankAccountNumber(String maskedBankAccountNumber) { + this.maskedBankAccountNumber = maskedBankAccountNumber; + } + + /** + * Getter for BankAccountType. + * Defaults to checking + * @return Returns the BankAccountType + */ + @JsonGetter("bank_account_type") + public BankAccountType getBankAccountType() { + return bankAccountType; + } + + /** + * Setter for BankAccountType. + * Defaults to checking + * @param bankAccountType Value for BankAccountType + */ + @JsonSetter("bank_account_type") + public void setBankAccountType(BankAccountType bankAccountType) { + this.bankAccountType = bankAccountType; + } + + /** + * Getter for BankAccountHolderType. + * Defaults to personal + * @return Returns the BankAccountHolderType + */ + @JsonGetter("bank_account_holder_type") + public BankAccountHolderType getBankAccountHolderType() { + return bankAccountHolderType; + } + + /** + * Setter for BankAccountHolderType. + * Defaults to personal + * @param bankAccountHolderType Value for BankAccountHolderType + */ + @JsonSetter("bank_account_holder_type") + public void setBankAccountHolderType(BankAccountHolderType bankAccountHolderType) { + this.bankAccountHolderType = bankAccountHolderType; + } + + /** + * Getter for PaymentType. + * @return Returns the String + */ + @JsonGetter("payment_type") + public String getPaymentType() { + return paymentType; + } + + /** + * Setter for PaymentType. + * @param paymentType Value for String + */ + @JsonSetter("payment_type") + public void setPaymentType(String paymentType) { + this.paymentType = paymentType; + } + + /** + * Getter for Disabled. + * @return Returns the boolean + */ + @JsonGetter("disabled") + public boolean getDisabled() { + return disabled; + } + + /** + * Setter for Disabled. + * @param disabled Value for boolean + */ + @JsonSetter("disabled") + public void setDisabled(boolean disabled) { + this.disabled = disabled; + } + + /** + * Getter for SiteGatewaySettingId. + * @return Returns the int + */ + @JsonGetter("site_gateway_setting_id") + public int getSiteGatewaySettingId() { + return siteGatewaySettingId; + } + + /** + * Setter for SiteGatewaySettingId. + * @param siteGatewaySettingId Value for int + */ + @JsonSetter("site_gateway_setting_id") + public void setSiteGatewaySettingId(int siteGatewaySettingId) { + this.siteGatewaySettingId = siteGatewaySettingId; + } + + /** + * Internal Getter for CustomerVaultToken. + * @return Returns the Internal String + */ + @JsonGetter("customer_vault_token") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetCustomerVaultToken() { + return this.customerVaultToken; + } + + /** + * Getter for CustomerVaultToken. + * @return Returns the String + */ + public String getCustomerVaultToken() { + return OptionalNullable.getFrom(customerVaultToken); + } + + /** + * Setter for CustomerVaultToken. + * @param customerVaultToken Value for String + */ + @JsonSetter("customer_vault_token") + public void setCustomerVaultToken(String customerVaultToken) { + this.customerVaultToken = OptionalNullable.of(customerVaultToken); + } + + /** + * UnSetter for CustomerVaultToken. + */ + public void unsetCustomerVaultToken() { + customerVaultToken = null; + } + + /** + * Internal Getter for GatewayHandle. + * @return Returns the Internal String + */ + @JsonGetter("gateway_handle") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetGatewayHandle() { + return this.gatewayHandle; + } + + /** + * Getter for GatewayHandle. + * @return Returns the String + */ + public String getGatewayHandle() { + return OptionalNullable.getFrom(gatewayHandle); + } + + /** + * Setter for GatewayHandle. + * @param gatewayHandle Value for String + */ + @JsonSetter("gateway_handle") + public void setGatewayHandle(String gatewayHandle) { + this.gatewayHandle = OptionalNullable.of(gatewayHandle); + } + + /** + * UnSetter for GatewayHandle. + */ + public void unsetGatewayHandle() { + gatewayHandle = null; + } + + /** + * Internal Getter for Verified. + * @return Returns the Internal Boolean + */ + @JsonGetter("verified") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetVerified() { + return this.verified; + } + + /** + * Getter for Verified. + * @return Returns the Boolean + */ + public Boolean getVerified() { + return OptionalNullable.getFrom(verified); + } + + /** + * Setter for Verified. + * @param verified Value for Boolean + */ + @JsonSetter("verified") + public void setVerified(Boolean verified) { + this.verified = OptionalNullable.of(verified); + } + + /** + * UnSetter for Verified. + */ + public void unsetVerified() { + verified = null; + } + + /** + * Converts this GetOneTimeTokenBankAccountPaymentProfile into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "GetOneTimeTokenBankAccountPaymentProfile [" + "firstName=" + firstName + + ", lastName=" + lastName + ", currentVault=" + currentVault + ", vaultToken=" + + vaultToken + ", billingAddress=" + billingAddress + ", billingCity=" + billingCity + + ", billingCountry=" + billingCountry + ", billingState=" + billingState + + ", billingZip=" + billingZip + ", bankName=" + bankName + + ", maskedBankRoutingNumber=" + maskedBankRoutingNumber + + ", maskedBankAccountNumber=" + maskedBankAccountNumber + ", bankAccountType=" + + bankAccountType + ", bankAccountHolderType=" + bankAccountHolderType + + ", paymentType=" + paymentType + ", disabled=" + disabled + + ", siteGatewaySettingId=" + siteGatewaySettingId + ", id=" + id + ", customerId=" + + customerId + ", billingAddress2=" + billingAddress2 + ", customerVaultToken=" + + customerVaultToken + ", gatewayHandle=" + gatewayHandle + ", verified=" + verified + + ", additionalProperties=" + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link GetOneTimeTokenBankAccountPaymentProfile.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link GetOneTimeTokenBankAccountPaymentProfile.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(firstName, lastName, currentVault, vaultToken, billingAddress, + billingCity, billingCountry, billingState, billingZip, bankName, + maskedBankRoutingNumber, maskedBankAccountNumber, bankAccountType, + bankAccountHolderType, paymentType, disabled, siteGatewaySettingId) + .billingAddress2(getBillingAddress2()); + builder.id = internalGetId(); + builder.customerId = internalGetCustomerId(); + builder.customerVaultToken = internalGetCustomerVaultToken(); + builder.gatewayHandle = internalGetGatewayHandle(); + builder.verified = internalGetVerified(); + return builder; + } + + /** + * Class to build instances of {@link GetOneTimeTokenBankAccountPaymentProfile}. + */ + public static class Builder { + private String firstName; + private String lastName; + private BankAccountVault currentVault; + private String vaultToken; + private String billingAddress; + private String billingCity; + private String billingCountry; + private String billingState; + private String billingZip; + private String bankName; + private String maskedBankRoutingNumber; + private String maskedBankAccountNumber; + private BankAccountType bankAccountType; + private BankAccountHolderType bankAccountHolderType; + private String paymentType; + private boolean disabled; + private int siteGatewaySettingId; + private OptionalNullable id; + private OptionalNullable customerId; + private String billingAddress2; + private OptionalNullable customerVaultToken; + private OptionalNullable gatewayHandle; + private OptionalNullable verified; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param firstName String value for firstName. + * @param lastName String value for lastName. + * @param currentVault BankAccountVault value for currentVault. + * @param vaultToken String value for vaultToken. + * @param billingAddress String value for billingAddress. + * @param billingCity String value for billingCity. + * @param billingCountry String value for billingCountry. + * @param billingState String value for billingState. + * @param billingZip String value for billingZip. + * @param bankName String value for bankName. + * @param maskedBankRoutingNumber String value for maskedBankRoutingNumber. + * @param maskedBankAccountNumber String value for maskedBankAccountNumber. + * @param bankAccountType BankAccountType value for bankAccountType. + * @param bankAccountHolderType BankAccountHolderType value for bankAccountHolderType. + * @param paymentType String value for paymentType. + * @param disabled boolean value for disabled. + * @param siteGatewaySettingId int value for siteGatewaySettingId. + */ + public Builder(String firstName, String lastName, BankAccountVault currentVault, + String vaultToken, String billingAddress, String billingCity, String billingCountry, + String billingState, String billingZip, String bankName, + String maskedBankRoutingNumber, String maskedBankAccountNumber, + BankAccountType bankAccountType, BankAccountHolderType bankAccountHolderType, + String paymentType, boolean disabled, int siteGatewaySettingId) { + this.firstName = firstName; + this.lastName = lastName; + this.currentVault = currentVault; + this.vaultToken = vaultToken; + this.billingAddress = billingAddress; + this.billingCity = billingCity; + this.billingCountry = billingCountry; + this.billingState = billingState; + this.billingZip = billingZip; + this.bankName = bankName; + this.maskedBankRoutingNumber = maskedBankRoutingNumber; + this.maskedBankAccountNumber = maskedBankAccountNumber; + this.bankAccountType = bankAccountType; + this.bankAccountHolderType = bankAccountHolderType; + this.paymentType = paymentType; + this.disabled = disabled; + this.siteGatewaySettingId = siteGatewaySettingId; + } + + /** + * Setter for firstName. + * @param firstName String value for firstName. + * @return Builder + */ + public Builder firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Setter for lastName. + * @param lastName String value for lastName. + * @return Builder + */ + public Builder lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Setter for currentVault. + * @param currentVault BankAccountVault value for currentVault. + * @return Builder + */ + public Builder currentVault(BankAccountVault currentVault) { + this.currentVault = currentVault; + return this; + } + + /** + * Setter for vaultToken. + * @param vaultToken String value for vaultToken. + * @return Builder + */ + public Builder vaultToken(String vaultToken) { + this.vaultToken = vaultToken; + return this; + } + + /** + * Setter for billingAddress. + * @param billingAddress String value for billingAddress. + * @return Builder + */ + public Builder billingAddress(String billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + /** + * Setter for billingCity. + * @param billingCity String value for billingCity. + * @return Builder + */ + public Builder billingCity(String billingCity) { + this.billingCity = billingCity; + return this; + } + + /** + * Setter for billingCountry. + * @param billingCountry String value for billingCountry. + * @return Builder + */ + public Builder billingCountry(String billingCountry) { + this.billingCountry = billingCountry; + return this; + } + + /** + * Setter for billingState. + * @param billingState String value for billingState. + * @return Builder + */ + public Builder billingState(String billingState) { + this.billingState = billingState; + return this; + } + + /** + * Setter for billingZip. + * @param billingZip String value for billingZip. + * @return Builder + */ + public Builder billingZip(String billingZip) { + this.billingZip = billingZip; + return this; + } + + /** + * Setter for bankName. + * @param bankName String value for bankName. + * @return Builder + */ + public Builder bankName(String bankName) { + this.bankName = bankName; + return this; + } + + /** + * Setter for maskedBankRoutingNumber. + * @param maskedBankRoutingNumber String value for maskedBankRoutingNumber. + * @return Builder + */ + public Builder maskedBankRoutingNumber(String maskedBankRoutingNumber) { + this.maskedBankRoutingNumber = maskedBankRoutingNumber; + return this; + } + + /** + * Setter for maskedBankAccountNumber. + * @param maskedBankAccountNumber String value for maskedBankAccountNumber. + * @return Builder + */ + public Builder maskedBankAccountNumber(String maskedBankAccountNumber) { + this.maskedBankAccountNumber = maskedBankAccountNumber; + return this; + } + + /** + * Setter for bankAccountType. + * @param bankAccountType BankAccountType value for bankAccountType. + * @return Builder + */ + public Builder bankAccountType(BankAccountType bankAccountType) { + this.bankAccountType = bankAccountType; + return this; + } + + /** + * Setter for bankAccountHolderType. + * @param bankAccountHolderType BankAccountHolderType value for bankAccountHolderType. + * @return Builder + */ + public Builder bankAccountHolderType(BankAccountHolderType bankAccountHolderType) { + this.bankAccountHolderType = bankAccountHolderType; + return this; + } + + /** + * Setter for paymentType. + * @param paymentType String value for paymentType. + * @return Builder + */ + public Builder paymentType(String paymentType) { + this.paymentType = paymentType; + return this; + } + + /** + * Setter for disabled. + * @param disabled boolean value for disabled. + * @return Builder + */ + public Builder disabled(boolean disabled) { + this.disabled = disabled; + return this; + } + + /** + * Setter for siteGatewaySettingId. + * @param siteGatewaySettingId int value for siteGatewaySettingId. + * @return Builder + */ + public Builder siteGatewaySettingId(int siteGatewaySettingId) { + this.siteGatewaySettingId = siteGatewaySettingId; + return this; + } + + /** + * Setter for id. + * @param id String value for id. + * @return Builder + */ + public Builder id(String id) { + this.id = OptionalNullable.of(id); + return this; + } + + /** + * UnSetter for id. + * @return Builder + */ + public Builder unsetId() { + id = null; + return this; + } + + /** + * Setter for customerId. + * @param customerId String value for customerId. + * @return Builder + */ + public Builder customerId(String customerId) { + this.customerId = OptionalNullable.of(customerId); + return this; + } + + /** + * UnSetter for customerId. + * @return Builder + */ + public Builder unsetCustomerId() { + customerId = null; + return this; + } + + /** + * Setter for billingAddress2. + * @param billingAddress2 String value for billingAddress2. + * @return Builder + */ + public Builder billingAddress2(String billingAddress2) { + this.billingAddress2 = billingAddress2; + return this; + } + + /** + * Setter for customerVaultToken. + * @param customerVaultToken String value for customerVaultToken. + * @return Builder + */ + public Builder customerVaultToken(String customerVaultToken) { + this.customerVaultToken = OptionalNullable.of(customerVaultToken); + return this; + } + + /** + * UnSetter for customerVaultToken. + * @return Builder + */ + public Builder unsetCustomerVaultToken() { + customerVaultToken = null; + return this; + } + + /** + * Setter for gatewayHandle. + * @param gatewayHandle String value for gatewayHandle. + * @return Builder + */ + public Builder gatewayHandle(String gatewayHandle) { + this.gatewayHandle = OptionalNullable.of(gatewayHandle); + return this; + } + + /** + * UnSetter for gatewayHandle. + * @return Builder + */ + public Builder unsetGatewayHandle() { + gatewayHandle = null; + return this; + } + + /** + * Setter for verified. + * @param verified Boolean value for verified. + * @return Builder + */ + public Builder verified(Boolean verified) { + this.verified = OptionalNullable.of(verified); + return this; + } + + /** + * UnSetter for verified. + * @return Builder + */ + public Builder unsetVerified() { + verified = null; + return this; + } + + /** + * Builds a new {@link GetOneTimeTokenBankAccountPaymentProfile} object using the set + * fields. + * @return {@link GetOneTimeTokenBankAccountPaymentProfile} + */ + public GetOneTimeTokenBankAccountPaymentProfile build() { + return new GetOneTimeTokenBankAccountPaymentProfile(firstName, lastName, currentVault, + vaultToken, billingAddress, billingCity, billingCountry, billingState, + billingZip, bankName, maskedBankRoutingNumber, maskedBankAccountNumber, + bankAccountType, bankAccountHolderType, paymentType, disabled, + siteGatewaySettingId, id, customerId, billingAddress2, customerVaultToken, + gatewayHandle, verified); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenPaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenPaymentProfile.java index ff0f2ea4..13712fce 100644 --- a/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenPaymentProfile.java +++ b/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenPaymentProfile.java @@ -6,8 +6,10 @@ package com.maxio.advancedbilling.models; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.apimatic.core.types.BaseModel; @@ -171,6 +173,54 @@ protected GetOneTimeTokenPaymentProfile(String firstName, String lastName, this.gatewayHandle = gatewayHandle; } + /** + * Initialization constructor. + * @param firstName String value for firstName. + * @param lastName String value for lastName. + * @param maskedCardNumber String value for maskedCardNumber. + * @param cardType CardType value for cardType. + * @param expirationMonth double value for expirationMonth. + * @param expirationYear double value for expirationYear. + * @param currentVault CreditCardVault value for currentVault. + * @param vaultToken String value for vaultToken. + * @param billingAddress String value for billingAddress. + * @param billingCity String value for billingCity. + * @param billingCountry String value for billingCountry. + * @param billingState String value for billingState. + * @param billingZip String value for billingZip. + * @param paymentType String value for paymentType. + * @param disabled boolean value for disabled. + * @param siteGatewaySettingId int value for siteGatewaySettingId. + */ + @JsonCreator + protected GetOneTimeTokenPaymentProfile( + @JsonProperty("first_name") String firstName, + @JsonProperty("last_name") String lastName, + @JsonProperty("masked_card_number") String maskedCardNumber, + @JsonProperty("card_type") CardType cardType, + @JsonProperty("expiration_month") double expirationMonth, + @JsonProperty("expiration_year") double expirationYear, + @JsonProperty("current_vault") CreditCardVault currentVault, + @JsonProperty("vault_token") String vaultToken, + @JsonProperty("billing_address") String billingAddress, + @JsonProperty("billing_city") String billingCity, + @JsonProperty("billing_country") String billingCountry, + @JsonProperty("billing_state") String billingState, + @JsonProperty("billing_zip") String billingZip, + @JsonProperty("payment_type") String paymentType, + @JsonProperty("disabled") boolean disabled, + @JsonProperty("site_gateway_setting_id") int siteGatewaySettingId) { + this(firstName, lastName, maskedCardNumber, cardType, expirationMonth, expirationYear, + currentVault, vaultToken, billingAddress, billingCity, billingCountry, billingState, + billingZip, paymentType, disabled, siteGatewaySettingId, OptionalNullable.of(null), + OptionalNullable.of(null), null, OptionalNullable.of(null), + OptionalNullable.of(null)); + unsetId(); + unsetCustomerId(); + unsetCustomerVaultToken(); + unsetGatewayHandle(); + } + /** * Internal Getter for Id. * @return Returns the Internal String diff --git a/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenRequest.java b/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenRequest.java index 85fc83c3..171870cb 100644 --- a/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenRequest.java +++ b/src/main/java/com/maxio/advancedbilling/models/GetOneTimeTokenRequest.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonSetter; +import com.maxio.advancedbilling.models.containers.GetOneTimeTokenRequestPaymentProfile; import io.apimatic.core.types.BaseModel; /** @@ -15,7 +16,7 @@ */ public class GetOneTimeTokenRequest extends BaseModel { - private GetOneTimeTokenPaymentProfile paymentProfile; + private GetOneTimeTokenRequestPaymentProfile paymentProfile; /** * Default constructor. @@ -25,28 +26,28 @@ public GetOneTimeTokenRequest() { /** * Initialization constructor. - * @param paymentProfile GetOneTimeTokenPaymentProfile value for paymentProfile. + * @param paymentProfile GetOneTimeTokenRequestPaymentProfile value for paymentProfile. */ public GetOneTimeTokenRequest( - GetOneTimeTokenPaymentProfile paymentProfile) { + GetOneTimeTokenRequestPaymentProfile paymentProfile) { this.paymentProfile = paymentProfile; } /** * Getter for PaymentProfile. - * @return Returns the GetOneTimeTokenPaymentProfile + * @return Returns the GetOneTimeTokenRequestPaymentProfile */ @JsonGetter("payment_profile") - public GetOneTimeTokenPaymentProfile getPaymentProfile() { + public GetOneTimeTokenRequestPaymentProfile getPaymentProfile() { return paymentProfile; } /** * Setter for PaymentProfile. - * @param paymentProfile Value for GetOneTimeTokenPaymentProfile + * @param paymentProfile Value for GetOneTimeTokenRequestPaymentProfile */ @JsonSetter("payment_profile") - public void setPaymentProfile(GetOneTimeTokenPaymentProfile paymentProfile) { + public void setPaymentProfile(GetOneTimeTokenRequestPaymentProfile paymentProfile) { this.paymentProfile = paymentProfile; } @@ -74,7 +75,7 @@ public Builder toBuilder() { * Class to build instances of {@link GetOneTimeTokenRequest}. */ public static class Builder { - private GetOneTimeTokenPaymentProfile paymentProfile; + private GetOneTimeTokenRequestPaymentProfile paymentProfile; /** * Initialization constructor. @@ -84,18 +85,18 @@ public Builder() { /** * Initialization constructor. - * @param paymentProfile GetOneTimeTokenPaymentProfile value for paymentProfile. + * @param paymentProfile GetOneTimeTokenRequestPaymentProfile value for paymentProfile. */ - public Builder(GetOneTimeTokenPaymentProfile paymentProfile) { + public Builder(GetOneTimeTokenRequestPaymentProfile paymentProfile) { this.paymentProfile = paymentProfile; } /** * Setter for paymentProfile. - * @param paymentProfile GetOneTimeTokenPaymentProfile value for paymentProfile. + * @param paymentProfile GetOneTimeTokenRequestPaymentProfile value for paymentProfile. * @return Builder */ - public Builder paymentProfile(GetOneTimeTokenPaymentProfile paymentProfile) { + public Builder paymentProfile(GetOneTimeTokenRequestPaymentProfile paymentProfile) { this.paymentProfile = paymentProfile; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/GroupSettings.java b/src/main/java/com/maxio/advancedbilling/models/GroupSettings.java index e26de225..97157736 100644 --- a/src/main/java/com/maxio/advancedbilling/models/GroupSettings.java +++ b/src/main/java/com/maxio/advancedbilling/models/GroupSettings.java @@ -61,7 +61,7 @@ public void setTarget(GroupTarget target) { /** * Getter for Billing. - * Optional attributes related to billing date and accrual. Note: Only applicable for new + * (Optional) Attributes related to billing date and accrual. Note: Only applicable for new * subscriptions. * @return Returns the GroupBilling */ @@ -73,7 +73,7 @@ public GroupBilling getBilling() { /** * Setter for Billing. - * Optional attributes related to billing date and accrual. Note: Only applicable for new + * (Optional) Attributes related to billing date and accrual. Note: Only applicable for new * subscriptions. * @param billing Value for GroupBilling */ diff --git a/src/main/java/com/maxio/advancedbilling/models/GroupStatus.java b/src/main/java/com/maxio/advancedbilling/models/GroupStatus.java new file mode 100644 index 00000000..b94fb274 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/GroupStatus.java @@ -0,0 +1,90 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + +/** + * GroupStatus to be used. + */ +public enum GroupStatus { + UNGROUPED, + + GROUPED; + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + UNGROUPED.value = "ungrouped"; + GROUPED.value = "grouped"; + + valueMap.put("ungrouped", UNGROUPED); + valueMap.put("grouped", GROUPED); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static GroupStatus constructFromString(String toConvert) throws IOException { + GroupStatus enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static GroupStatus fromString(String toConvert) { + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + return value.toString(); + } + + /** + * Convert list of GroupStatus values to list of string values. + * @param toConvert The list of GroupStatus values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (GroupStatus enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/GroupTarget.java b/src/main/java/com/maxio/advancedbilling/models/GroupTarget.java index 03099cd4..abbd7677 100644 --- a/src/main/java/com/maxio/advancedbilling/models/GroupTarget.java +++ b/src/main/java/com/maxio/advancedbilling/models/GroupTarget.java @@ -60,7 +60,7 @@ public void setType(GroupTargetType type) { /** * Getter for Id. * The id of the target customer or subscription to group the existing subscription with. - * Ignored and should not be included if type is "self" , "parent", or "eldest" + * Ignored and should not be included if type is "self", "parent", or "eldest". * @return Returns the Integer */ @JsonGetter("id") @@ -72,7 +72,7 @@ public Integer getId() { /** * Setter for Id. * The id of the target customer or subscription to group the existing subscription with. - * Ignored and should not be included if type is "self" , "parent", or "eldest" + * Ignored and should not be included if type is "self", "parent", or "eldest". * @param id Value for Integer */ @JsonSetter("id") diff --git a/src/main/java/com/maxio/advancedbilling/models/GroupTargetType.java b/src/main/java/com/maxio/advancedbilling/models/GroupTargetType.java index da808ba8..d6f90d3f 100644 --- a/src/main/java/com/maxio/advancedbilling/models/GroupTargetType.java +++ b/src/main/java/com/maxio/advancedbilling/models/GroupTargetType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * GroupTargetType to be used. */ @@ -27,7 +26,6 @@ public enum GroupTargetType { ELDEST; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/GroupType.java b/src/main/java/com/maxio/advancedbilling/models/GroupType.java index 0fa4808d..48e095ef 100644 --- a/src/main/java/com/maxio/advancedbilling/models/GroupType.java +++ b/src/main/java/com/maxio/advancedbilling/models/GroupType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * GroupType to be used. */ @@ -21,7 +20,6 @@ public enum GroupType { MULTIPLE_CUSTOMERS; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/IncludeNotNull.java b/src/main/java/com/maxio/advancedbilling/models/IncludeNotNull.java index 5c699e16..2a734bd9 100644 --- a/src/main/java/com/maxio/advancedbilling/models/IncludeNotNull.java +++ b/src/main/java/com/maxio/advancedbilling/models/IncludeNotNull.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * IncludeNotNull to be used. */ public enum IncludeNotNull { NOT_NULL; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/IncludeNullOrNotNull.java b/src/main/java/com/maxio/advancedbilling/models/IncludeNullOrNotNull.java index 80ef6b99..ddcda021 100644 --- a/src/main/java/com/maxio/advancedbilling/models/IncludeNullOrNotNull.java +++ b/src/main/java/com/maxio/advancedbilling/models/IncludeNullOrNotNull.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * IncludeNullOrNotNull to be used. */ @@ -21,7 +20,6 @@ public enum IncludeNullOrNotNull { ENUM_NULL; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/IncludeOption.java b/src/main/java/com/maxio/advancedbilling/models/IncludeOption.java index 2b873a04..34937361 100644 --- a/src/main/java/com/maxio/advancedbilling/models/IncludeOption.java +++ b/src/main/java/com/maxio/advancedbilling/models/IncludeOption.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * IncludeOption to be used. */ @@ -21,7 +20,6 @@ public enum IncludeOption { INCLUDE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/IntervalUnit.java b/src/main/java/com/maxio/advancedbilling/models/IntervalUnit.java index d2c1d304..afa78c91 100644 --- a/src/main/java/com/maxio/advancedbilling/models/IntervalUnit.java +++ b/src/main/java/com/maxio/advancedbilling/models/IntervalUnit.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * IntervalUnit to be used. */ @@ -21,7 +20,6 @@ public enum IntervalUnit { MONTH; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Invoice.java b/src/main/java/com/maxio/advancedbilling/models/Invoice.java index 8dce14a9..ac718f87 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Invoice.java +++ b/src/main/java/com/maxio/advancedbilling/models/Invoice.java @@ -79,6 +79,7 @@ public class Invoice private String publicUrl; private InvoicePreviousBalance previousBalanceData; private LocalDate publicUrlExpiresOn; + private OptionalNullable brandingThemeId; /** * Default constructor. @@ -144,6 +145,7 @@ public Invoice() { * @param publicUrl String value for publicUrl. * @param previousBalanceData InvoicePreviousBalance value for previousBalanceData. * @param publicUrlExpiresOn LocalDate value for publicUrlExpiresOn. + * @param brandingThemeId Integer value for brandingThemeId. */ public Invoice( Long id, @@ -201,7 +203,8 @@ public Invoice( InvoiceAvataxDetails avataxDetails, String publicUrl, InvoicePreviousBalance previousBalanceData, - LocalDate publicUrlExpiresOn) { + LocalDate publicUrlExpiresOn, + Integer brandingThemeId) { this.id = id; this.uid = uid; this.siteId = siteId; @@ -258,6 +261,7 @@ public Invoice( this.publicUrl = publicUrl; this.previousBalanceData = previousBalanceData; this.publicUrlExpiresOn = publicUrlExpiresOn; + this.brandingThemeId = OptionalNullable.of(brandingThemeId); } /** @@ -318,6 +322,7 @@ public Invoice( * @param publicUrl String value for publicUrl. * @param previousBalanceData InvoicePreviousBalance value for previousBalanceData. * @param publicUrlExpiresOn LocalDate value for publicUrlExpiresOn. + * @param brandingThemeId Integer value for brandingThemeId. */ protected Invoice(Long id, String uid, Integer siteId, Integer customerId, @@ -340,7 +345,8 @@ protected Invoice(Long id, String uid, Integer siteId, Integer customerId, List refunds, List payments, List customFields, InvoiceDisplaySettings displaySettings, InvoiceAvataxDetails avataxDetails, String publicUrl, - InvoicePreviousBalance previousBalanceData, LocalDate publicUrlExpiresOn) { + InvoicePreviousBalance previousBalanceData, LocalDate publicUrlExpiresOn, + OptionalNullable brandingThemeId) { this.id = id; this.uid = uid; this.siteId = siteId; @@ -397,6 +403,7 @@ protected Invoice(Long id, String uid, Integer siteId, Integer customerId, this.publicUrl = publicUrl; this.previousBalanceData = previousBalanceData; this.publicUrlExpiresOn = publicUrlExpiresOn; + this.brandingThemeId = brandingThemeId; } /** @@ -1125,7 +1132,7 @@ public void setSeller(InvoiceSeller seller) { /** * Getter for Customer. - * Information about the customer who is owner or recipient the invoiced subscription. + * Information about the customer who is owner or recipient of the invoiced subscription. * @return Returns the InvoiceCustomer */ @JsonGetter("customer") @@ -1136,7 +1143,7 @@ public InvoiceCustomer getCustomer() { /** * Setter for Customer. - * Information about the customer who is owner or recipient the invoiced subscription. + * Information about the customer who is owner or recipient of the invoiced subscription. * @param customer Value for InvoiceCustomer */ @JsonSetter("customer") @@ -1331,7 +1338,7 @@ public void setTaxAmount(String taxAmount) { /** * Getter for TotalAmount. - * The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' + * The invoice total, which is `subtotal_amount - discount_amount + tax_amount`. * @return Returns the String */ @JsonGetter("total_amount") @@ -1342,7 +1349,7 @@ public String getTotalAmount() { /** * Setter for TotalAmount. - * The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' + * The invoice total, which is `subtotal_amount - discount_amount + tax_amount`. * @param totalAmount Value for String */ @JsonSetter("total_amount") @@ -1708,6 +1715,53 @@ public void setPublicUrlExpiresOn(LocalDate publicUrlExpiresOn) { this.publicUrlExpiresOn = publicUrlExpiresOn; } + /** + * Internal Getter for BrandingThemeId. + * The ID of the Branding Theme associated with this invoice. This value represents the Branding + * Theme used for invoice theming, such as themed invoice rendering. Available only when + * Branding Themes are enabled for the site. + * @return Returns the Internal Integer + */ + @JsonGetter("branding_theme_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBrandingThemeId() { + return this.brandingThemeId; + } + + /** + * Getter for BrandingThemeId. + * The ID of the Branding Theme associated with this invoice. This value represents the Branding + * Theme used for invoice theming, such as themed invoice rendering. Available only when + * Branding Themes are enabled for the site. + * @return Returns the Integer + */ + public Integer getBrandingThemeId() { + return OptionalNullable.getFrom(brandingThemeId); + } + + /** + * Setter for BrandingThemeId. + * The ID of the Branding Theme associated with this invoice. This value represents the Branding + * Theme used for invoice theming, such as themed invoice rendering. Available only when + * Branding Themes are enabled for the site. + * @param brandingThemeId Value for Integer + */ + @JsonSetter("branding_theme_id") + public void setBrandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + } + + /** + * UnSetter for BrandingThemeId. + * The ID of the Branding Theme associated with this invoice. This value represents the Branding + * Theme used for invoice theming, such as themed invoice rendering. Available only when + * Branding Themes are enabled for the site. + */ + public void unsetBrandingThemeId() { + brandingThemeId = null; + } + /** * Converts this Invoice into string format. * @return String representation of this class @@ -1738,7 +1792,8 @@ public String toString() { + ", payments=" + payments + ", customFields=" + customFields + ", displaySettings=" + displaySettings + ", avataxDetails=" + avataxDetails + ", publicUrl=" + publicUrl + ", previousBalanceData=" + previousBalanceData + ", publicUrlExpiresOn=" - + publicUrlExpiresOn + ", additionalProperties=" + getAdditionalProperties() + "]"; + + publicUrlExpiresOn + ", brandingThemeId=" + brandingThemeId + + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -1804,6 +1859,7 @@ public Builder toBuilder() { builder.subscriptionGroupId = internalGetSubscriptionGroupId(); builder.parentInvoiceNumber = internalGetParentInvoiceNumber(); builder.groupPrimarySubscriptionId = internalGetGroupPrimarySubscriptionId(); + builder.brandingThemeId = internalGetBrandingThemeId(); return builder; } @@ -1867,6 +1923,7 @@ public static class Builder { private String publicUrl; private InvoicePreviousBalance previousBalanceData; private LocalDate publicUrlExpiresOn; + private OptionalNullable brandingThemeId; @@ -2484,6 +2541,25 @@ public Builder publicUrlExpiresOn(LocalDate publicUrlExpiresOn) { return this; } + /** + * Setter for brandingThemeId. + * @param brandingThemeId Integer value for brandingThemeId. + * @return Builder + */ + public Builder brandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + return this; + } + + /** + * UnSetter for brandingThemeId. + * @return Builder + */ + public Builder unsetBrandingThemeId() { + brandingThemeId = null; + return this; + } + /** * Builds a new {@link Invoice} object using the set fields. * @return {@link Invoice} @@ -2498,7 +2574,8 @@ public Invoice build() { subtotalAmount, discountAmount, taxAmount, totalAmount, creditAmount, debitAmount, refundAmount, paidAmount, dueAmount, lineItems, discounts, taxes, credits, debits, refunds, payments, customFields, displaySettings, - avataxDetails, publicUrl, previousBalanceData, publicUrlExpiresOn); + avataxDetails, publicUrl, previousBalanceData, publicUrlExpiresOn, + brandingThemeId); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceConsolidationLevel.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceConsolidationLevel.java index 46b7dccd..2f4155b8 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceConsolidationLevel.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceConsolidationLevel.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceConsolidationLevel to be used. */ @@ -23,7 +22,6 @@ public enum InvoiceConsolidationLevel { PARENT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceDateField.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceDateField.java index 0c1aa9de..5b3a4469 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceDateField.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceDateField.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceDateField to be used. */ @@ -27,7 +26,6 @@ public enum InvoiceDateField { PAID_DATE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountSourceType.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountSourceType.java index eb5f6382..eefb1c74 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountSourceType.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountSourceType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceDiscountSourceType to be used. */ @@ -23,7 +22,6 @@ public enum InvoiceDiscountSourceType { ENUM_AD_HOC_COUPON; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountType.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountType.java index 7d08bbc6..d7cd0c9d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountType.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceDiscountType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceDiscountType to be used. */ @@ -23,7 +22,6 @@ public enum InvoiceDiscountType { ROLLOVER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventPaymentMethod.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventPaymentMethod.java index ba5f5128..141c6175 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventPaymentMethod.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventPaymentMethod.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceEventPaymentMethod to be used. */ @@ -27,7 +26,6 @@ public enum InvoiceEventPaymentMethod { PAYPAL_ACCOUNT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java index 83465c54..20d0c69d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceEventType to be used. */ @@ -47,7 +46,6 @@ public enum InvoiceEventType { CHANGE_CHARGEBACK_STATUS; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceLineItem.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceLineItem.java index 195dfc0e..415c5970 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceLineItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceLineItem.java @@ -294,7 +294,7 @@ public void setQuantity(String quantity) { /** * Getter for UnitPrice. - * The price per unit for the line item. When tiered pricing was used (i.e. not every unit was + * The price per unit for the line item. When tiered pricing was used (i.e., not every unit was * actually priced at the same price) this will be the blended average cost per unit and the * `tiered_unit_price` field will be set to `true`. * @return Returns the String @@ -307,7 +307,7 @@ public String getUnitPrice() { /** * Setter for UnitPrice. - * The price per unit for the line item. When tiered pricing was used (i.e. not every unit was + * The price per unit for the line item. When tiered pricing was used (i.e., not every unit was * actually priced at the same price) this will be the blended average cost per unit and the * `tiered_unit_price` field will be set to `true`. * @param unitPrice Value for String @@ -485,7 +485,7 @@ public void setTieredUnitPrice(Boolean tieredUnitPrice) { * Getter for PeriodRangeStart. * Start date for the period covered by this line. The format is `"YYYY-MM-DD"`. * For periodic * charges paid in advance, this date will match the billing date, and the end date will be in - * the future. * For periodic charges paid in arrears (e.g. metered charges), this date will be + * the future. * For periodic charges paid in arrears (e.g., metered charges), this date will be * the date of the previous billing, and the end date will be the current billing date. * For * non-periodic charges, this date and the end date will match. * @return Returns the LocalDate @@ -501,7 +501,7 @@ public LocalDate getPeriodRangeStart() { * Setter for PeriodRangeStart. * Start date for the period covered by this line. The format is `"YYYY-MM-DD"`. * For periodic * charges paid in advance, this date will match the billing date, and the end date will be in - * the future. * For periodic charges paid in arrears (e.g. metered charges), this date will be + * the future. * For periodic charges paid in arrears (e.g., metered charges), this date will be * the date of the previous billing, and the end date will be the current billing date. * For * non-periodic charges, this date and the end date will match. * @param periodRangeStart Value for LocalDate @@ -516,7 +516,7 @@ public void setPeriodRangeStart(LocalDate periodRangeStart) { * Getter for PeriodRangeEnd. * End date for the period covered by this line. The format is `"YYYY-MM-DD"`. * For periodic * charges paid in advance, this date will match the next (future) billing date. * For periodic - * charges paid in arrears (e.g. metered charges), this date will be the date of the current + * charges paid in arrears (e.g., metered charges), this date will be the date of the current * billing date. * For non-periodic charges, this date and the start date will match. * @return Returns the LocalDate */ @@ -531,7 +531,7 @@ public LocalDate getPeriodRangeEnd() { * Setter for PeriodRangeEnd. * End date for the period covered by this line. The format is `"YYYY-MM-DD"`. * For periodic * charges paid in advance, this date will match the next (future) billing date. * For periodic - * charges paid in arrears (e.g. metered charges), this date will be the date of the current + * charges paid in arrears (e.g., metered charges), this date will be the date of the current * billing date. * For non-periodic charges, this date and the start date will match. * @param periodRangeEnd Value for LocalDate */ diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentMethodType.java b/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentMethodType.java index b7dfd716..fcab12f2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentMethodType.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentMethodType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoicePaymentMethodType to be used. */ @@ -29,7 +28,6 @@ public enum InvoicePaymentMethodType { OTHER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentType.java b/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentType.java index 122cb7eb..a2701564 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentType.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoicePaymentType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoicePaymentType to be used. */ @@ -25,7 +24,6 @@ public enum InvoicePaymentType { PAYMENT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceRole.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceRole.java index 7d6b3cbb..1f114211 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceRole.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceRole.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceRole to be used. */ @@ -37,7 +36,6 @@ public enum InvoiceRole { BACKPORTBALANCERECONCILIATION; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceSortField.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceSortField.java index 31449b38..40dd12eb 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceSortField.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceSortField.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceSortField to be used. */ @@ -33,7 +32,6 @@ public enum InvoiceSortField { NUMBER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceStatus.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceStatus.java index 9b219e47..dd5236de 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceStatus.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceStatus.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * InvoiceStatus to be used. */ @@ -31,7 +30,6 @@ public enum InvoiceStatus { PROCESSING; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ItemCategory.java b/src/main/java/com/maxio/advancedbilling/models/ItemCategory.java index 4c1138a3..9ee03874 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ItemCategory.java +++ b/src/main/java/com/maxio/advancedbilling/models/ItemCategory.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ItemCategory to be used. */ @@ -27,7 +26,6 @@ public enum ItemCategory { OTHER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/LineItemKind.java b/src/main/java/com/maxio/advancedbilling/models/LineItemKind.java index 6988ba34..975fbd9b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/LineItemKind.java +++ b/src/main/java/com/maxio/advancedbilling/models/LineItemKind.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * LineItemKind to be used. */ @@ -37,7 +36,6 @@ public enum LineItemKind { TAX; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/LineItemTransactionType.java b/src/main/java/com/maxio/advancedbilling/models/LineItemTransactionType.java index 30ac2294..0d991266 100644 --- a/src/main/java/com/maxio/advancedbilling/models/LineItemTransactionType.java +++ b/src/main/java/com/maxio/advancedbilling/models/LineItemTransactionType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * LineItemTransactionType to be used. */ @@ -31,7 +30,6 @@ public enum LineItemTransactionType { PAYMENT_AUTHORIZATION; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListComponentPricePointsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListComponentPricePointsInput.java index c68feb1b..e8d8a1df 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListComponentPricePointsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListComponentPricePointsInput.java @@ -72,7 +72,7 @@ public void setComponentId(int componentId) { /** * Getter for CurrencyPrices. - * Include an array of currency price data + * Include an array of currency price data. * @return Returns the Boolean */ @JsonGetter("currency_prices") @@ -83,7 +83,7 @@ public Boolean getCurrencyPrices() { /** * Setter for CurrencyPrices. - * Include an array of currency price data + * Include an array of currency price data. * @param currencyPrices Value for Boolean */ @JsonSetter("currency_prices") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListComponentsForProductFamilyInput.java b/src/main/java/com/maxio/advancedbilling/models/ListComponentsForProductFamilyInput.java index fe8fbcd0..1a2f1ef1 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListComponentsForProductFamilyInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListComponentsForProductFamilyInput.java @@ -236,7 +236,7 @@ public void setEndDate(String endDate) { * The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. * Returns components with a timestamp at or before exact time provided in query. You can * specify timezone in query - otherwise your site's time zone will be used. If provided, this - * parameter will be used instead of end_date. optional. + * parameter will be used instead of end_date. * @return Returns the String */ @JsonGetter("end_datetime") @@ -250,7 +250,7 @@ public String getEndDatetime() { * The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. * Returns components with a timestamp at or before exact time provided in query. You can * specify timezone in query - otherwise your site's time zone will be used. If provided, this - * parameter will be used instead of end_date. optional. + * parameter will be used instead of end_date. * @param endDatetime Value for String */ @JsonSetter("end_datetime") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListComponentsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListComponentsInput.java index 0c1c9647..f974e782 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListComponentsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListComponentsInput.java @@ -166,7 +166,7 @@ public void setStartDatetime(String startDatetime) { * The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. * Returns components with a timestamp at or before exact time provided in query. You can * specify timezone in query - otherwise your site's time zone will be used. If provided, this - * parameter will be used instead of end_date. optional + * parameter will be used instead of end_date. * @return Returns the String */ @JsonGetter("end_datetime") @@ -180,7 +180,7 @@ public String getEndDatetime() { * The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. * Returns components with a timestamp at or before exact time provided in query. You can * specify timezone in query - otherwise your site's time zone will be used. If provided, this - * parameter will be used instead of end_date. optional + * parameter will be used instead of end_date. * @param endDatetime Value for String */ @JsonSetter("end_datetime") @@ -190,7 +190,7 @@ public void setEndDatetime(String endDatetime) { /** * Getter for IncludeArchived. - * Include archived items + * Include archived items. * @return Returns the Boolean */ @JsonGetter("include_archived") @@ -201,7 +201,7 @@ public Boolean getIncludeArchived() { /** * Setter for IncludeArchived. - * Include archived items + * Include archived items. * @param includeArchived Value for Boolean */ @JsonSetter("include_archived") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListComponentsPricePointsInclude.java b/src/main/java/com/maxio/advancedbilling/models/ListComponentsPricePointsInclude.java index 27383982..2ae14dff 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListComponentsPricePointsInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListComponentsPricePointsInclude.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * ListComponentsPricePointsInclude to be used. */ public enum ListComponentsPricePointsInclude { CURRENCY_PRICES; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListCouponsForProductFamilyInput.java b/src/main/java/com/maxio/advancedbilling/models/ListCouponsForProductFamilyInput.java index 91013b5f..0fb01f32 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListCouponsForProductFamilyInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListCouponsForProductFamilyInput.java @@ -146,9 +146,9 @@ public void setFilter(ListCouponsFilter filter) { /** * Getter for CurrencyPrices. - * When fetching coupons, if you have defined multiple currencies at the site level, you can - * optionally pass the `?currency_prices=true` query param to include an array of currency price - * data in the response. Use in query `currency_prices=true`. + * (Optional) If you have defined multiple currencies at the site level, you can pass + * `?currency_prices=true` to include an array of currency price data in the response. Use in + * query `currency_prices=true`. * @return Returns the Boolean */ @JsonGetter("currency_prices") @@ -159,9 +159,9 @@ public Boolean getCurrencyPrices() { /** * Setter for CurrencyPrices. - * When fetching coupons, if you have defined multiple currencies at the site level, you can - * optionally pass the `?currency_prices=true` query param to include an array of currency price - * data in the response. Use in query `currency_prices=true`. + * (Optional) If you have defined multiple currencies at the site level, you can pass + * `?currency_prices=true` to include an array of currency price data in the response. Use in + * query `currency_prices=true`. * @param currencyPrices Value for Boolean */ @JsonSetter("currency_prices") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListCouponsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListCouponsInput.java index 4489da45..6cf39c16 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListCouponsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListCouponsInput.java @@ -122,9 +122,9 @@ public void setFilter(ListCouponsFilter filter) { /** * Getter for CurrencyPrices. - * When fetching coupons, if you have defined multiple currencies at the site level, you can - * optionally pass the `?currency_prices=true` query param to include an array of currency price - * data in the response. Use in query `currency_prices=true`. + * (Optional) If you have defined multiple currencies at the site level, you can pass + * `?currency_prices=true` to include an array of currency price data in the response. Use in + * query `currency_prices=true`. * @return Returns the Boolean */ @JsonGetter("currency_prices") @@ -135,9 +135,9 @@ public Boolean getCurrencyPrices() { /** * Setter for CurrencyPrices. - * When fetching coupons, if you have defined multiple currencies at the site level, you can - * optionally pass the `?currency_prices=true` query param to include an array of currency price - * data in the response. Use in query `currency_prices=true`. + * (Optional) If you have defined multiple currencies at the site level, you can pass + * `?currency_prices=true` to include an array of currency price data in the response. Use in + * query `currency_prices=true`. * @param currencyPrices Value for Boolean */ @JsonSetter("currency_prices") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListCreditNotesInput.java b/src/main/java/com/maxio/advancedbilling/models/ListCreditNotesInput.java index 57766406..af772d46 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListCreditNotesInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListCreditNotesInput.java @@ -143,7 +143,7 @@ public void setPerPage(Integer perPage) { /** * Getter for LineItems. - * Include line items data + * Include line items data. * @return Returns the Boolean */ @JsonGetter("line_items") @@ -154,7 +154,7 @@ public Boolean getLineItems() { /** * Setter for LineItems. - * Include line items data + * Include line items data. * @param lineItems Value for Boolean */ @JsonSetter("line_items") @@ -164,7 +164,7 @@ public void setLineItems(Boolean lineItems) { /** * Getter for Discounts. - * Include discounts data + * Include discounts data. * @return Returns the Boolean */ @JsonGetter("discounts") @@ -175,7 +175,7 @@ public Boolean getDiscounts() { /** * Setter for Discounts. - * Include discounts data + * Include discounts data. * @param discounts Value for Boolean */ @JsonSetter("discounts") @@ -185,7 +185,7 @@ public void setDiscounts(Boolean discounts) { /** * Getter for Taxes. - * Include taxes data + * Include taxes data. * @return Returns the Boolean */ @JsonGetter("taxes") @@ -196,7 +196,7 @@ public Boolean getTaxes() { /** * Setter for Taxes. - * Include taxes data + * Include taxes data. * @param taxes Value for Boolean */ @JsonSetter("taxes") @@ -206,7 +206,7 @@ public void setTaxes(Boolean taxes) { /** * Getter for Refunds. - * Include refunds data + * Include refunds data. * @return Returns the Boolean */ @JsonGetter("refunds") @@ -217,7 +217,7 @@ public Boolean getRefunds() { /** * Setter for Refunds. - * Include refunds data + * Include refunds data. * @param refunds Value for Boolean */ @JsonSetter("refunds") @@ -227,7 +227,7 @@ public void setRefunds(Boolean refunds) { /** * Getter for Applications. - * Include applications data + * Include applications data. * @return Returns the Boolean */ @JsonGetter("applications") @@ -238,7 +238,7 @@ public Boolean getApplications() { /** * Setter for Applications. - * Include applications data + * Include applications data. * @param applications Value for Boolean */ @JsonSetter("applications") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListEventsDateField.java b/src/main/java/com/maxio/advancedbilling/models/ListEventsDateField.java index deeecdc5..d1bc6b36 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListEventsDateField.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListEventsDateField.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * ListEventsDateField to be used. */ public enum ListEventsDateField { CREATED_AT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java index 0014aea4..11724c5d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java @@ -131,7 +131,7 @@ public void setPerPage(Integer perPage) { /** * Getter for SinceId. - * Returns events with an id greater than or equal to the one specified + * Returns events with an id greater than or equal to the one specified. * @return Returns the Long */ @JsonGetter("since_id") @@ -142,7 +142,7 @@ public Long getSinceId() { /** * Setter for SinceId. - * Returns events with an id greater than or equal to the one specified + * Returns events with an id greater than or equal to the one specified. * @param sinceId Value for Long */ @JsonSetter("since_id") @@ -152,7 +152,7 @@ public void setSinceId(Long sinceId) { /** * Getter for MaxId. - * Returns events with an id less than or equal to the one specified + * Returns events with an id less than or equal to the one specified. * @return Returns the Long */ @JsonGetter("max_id") @@ -163,7 +163,7 @@ public Long getMaxId() { /** * Setter for MaxId. - * Returns events with an id less than or equal to the one specified + * Returns events with an id less than or equal to the one specified. * @param maxId Value for Long */ @JsonSetter("max_id") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListInvoicesInput.java b/src/main/java/com/maxio/advancedbilling/models/ListInvoicesInput.java index c0ec0d43..742ded61 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListInvoicesInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListInvoicesInput.java @@ -345,7 +345,7 @@ public void setDirection(Direction direction) { /** * Getter for LineItems. - * Include line items data + * Include line items data. * @return Returns the Boolean */ @JsonGetter("line_items") @@ -356,7 +356,7 @@ public Boolean getLineItems() { /** * Setter for LineItems. - * Include line items data + * Include line items data. * @param lineItems Value for Boolean */ @JsonSetter("line_items") @@ -366,7 +366,7 @@ public void setLineItems(Boolean lineItems) { /** * Getter for Discounts. - * Include discounts data + * Include discounts data. * @return Returns the Boolean */ @JsonGetter("discounts") @@ -377,7 +377,7 @@ public Boolean getDiscounts() { /** * Setter for Discounts. - * Include discounts data + * Include discounts data. * @param discounts Value for Boolean */ @JsonSetter("discounts") @@ -387,7 +387,7 @@ public void setDiscounts(Boolean discounts) { /** * Getter for Taxes. - * Include taxes data + * Include taxes data. * @return Returns the Boolean */ @JsonGetter("taxes") @@ -398,7 +398,7 @@ public Boolean getTaxes() { /** * Setter for Taxes. - * Include taxes data + * Include taxes data. * @param taxes Value for Boolean */ @JsonSetter("taxes") @@ -408,7 +408,7 @@ public void setTaxes(Boolean taxes) { /** * Getter for Credits. - * Include credits data + * Include credits data. * @return Returns the Boolean */ @JsonGetter("credits") @@ -419,7 +419,7 @@ public Boolean getCredits() { /** * Setter for Credits. - * Include credits data + * Include credits data. * @param credits Value for Boolean */ @JsonSetter("credits") @@ -429,7 +429,7 @@ public void setCredits(Boolean credits) { /** * Getter for Payments. - * Include payments data + * Include payments data. * @return Returns the Boolean */ @JsonGetter("payments") @@ -440,7 +440,7 @@ public Boolean getPayments() { /** * Setter for Payments. - * Include payments data + * Include payments data. * @param payments Value for Boolean */ @JsonSetter("payments") @@ -450,7 +450,7 @@ public void setPayments(Boolean payments) { /** * Getter for CustomFields. - * Include custom fields data + * Include custom fields data. * @return Returns the Boolean */ @JsonGetter("custom_fields") @@ -461,7 +461,7 @@ public Boolean getCustomFields() { /** * Setter for CustomFields. - * Include custom fields data + * Include custom fields data. * @param customFields Value for Boolean */ @JsonSetter("custom_fields") @@ -471,7 +471,7 @@ public void setCustomFields(Boolean customFields) { /** * Getter for Refunds. - * Include refunds data + * Include refunds data. * @return Returns the Boolean */ @JsonGetter("refunds") @@ -482,7 +482,7 @@ public Boolean getRefunds() { /** * Setter for Refunds. - * Include refunds data + * Include refunds data. * @param refunds Value for Boolean */ @JsonSetter("refunds") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListMrrMovementsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListMrrMovementsInput.java index d336e13b..7558139a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListMrrMovementsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListMrrMovementsInput.java @@ -47,7 +47,7 @@ public ListMrrMovementsInput( /** * Getter for SubscriptionId. - * optionally filter results by subscription + * (Optional) Filter results by subscription. * @return Returns the Integer */ @JsonGetter("subscription_id") @@ -58,7 +58,7 @@ public Integer getSubscriptionId() { /** * Setter for SubscriptionId. - * optionally filter results by subscription + * (Optional) Filter results by subscription. * @param subscriptionId Value for Integer */ @JsonSetter("subscription_id") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListPrepaymentDateField.java b/src/main/java/com/maxio/advancedbilling/models/ListPrepaymentDateField.java index 18271350..bc8a6792 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListPrepaymentDateField.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListPrepaymentDateField.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ListPrepaymentDateField to be used. */ @@ -21,7 +20,6 @@ public enum ListPrepaymentDateField { APPLICATION_AT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java index 494e1e34..95d36252 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java @@ -129,11 +129,11 @@ public void setPerPage(Integer perPage) { /** * Getter for CurrencyPrices. - * When fetching a product's price points, if you have defined multiple currencies at the site - * level, you can optionally pass the ?currency_prices=true query param to include an array of - * currency price data in the response. If the product price point is set to - * use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If - * the flag is set to false, it will return all of the defined prices for each currency. + * (Optional) If you have defined multiple currencies at the site level, you can pass + * ?currency_prices=true to include an array of currency price data in the response. If the + * product price point is set to use_site_exchange_rate: true, it will return pricing based on + * the current exchange rate. If the flag is set to false, it will return all of the defined + * prices for each currency. * @return Returns the Boolean */ @JsonGetter("currency_prices") @@ -144,11 +144,11 @@ public Boolean getCurrencyPrices() { /** * Setter for CurrencyPrices. - * When fetching a product's price points, if you have defined multiple currencies at the site - * level, you can optionally pass the ?currency_prices=true query param to include an array of - * currency price data in the response. If the product price point is set to - * use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If - * the flag is set to false, it will return all of the defined prices for each currency. + * (Optional) If you have defined multiple currencies at the site level, you can pass + * ?currency_prices=true to include an array of currency price data in the response. If the + * product price point is set to use_site_exchange_rate: true, it will return pricing based on + * the current exchange rate. If the flag is set to false, it will return all of the defined + * prices for each currency. * @param currencyPrices Value for Boolean */ @JsonSetter("currency_prices") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProductsForProductFamilyInput.java b/src/main/java/com/maxio/advancedbilling/models/ListProductsForProductFamilyInput.java index 3430bb40..84204919 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListProductsForProductFamilyInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListProductsForProductFamilyInput.java @@ -308,7 +308,7 @@ public void setEndDatetime(ZonedDateTime endDatetime) { /** * Getter for IncludeArchived. - * Include archived products + * Include archived products. * @return Returns the Boolean */ @JsonGetter("include_archived") @@ -319,7 +319,7 @@ public Boolean getIncludeArchived() { /** * Setter for IncludeArchived. - * Include archived products + * Include archived products. * @param includeArchived Value for Boolean */ @JsonSetter("include_archived") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProductsInclude.java b/src/main/java/com/maxio/advancedbilling/models/ListProductsInclude.java index 32ef1395..6230bb6e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListProductsInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListProductsInclude.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * ListProductsInclude to be used. */ public enum ListProductsInclude { PREPAID_PRODUCT_PRICE_POINT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProductsPricePointsInclude.java b/src/main/java/com/maxio/advancedbilling/models/ListProductsPricePointsInclude.java index 87f5e69d..0c9a1907 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListProductsPricePointsInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListProductsPricePointsInclude.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * ListProductsPricePointsInclude to be used. */ public enum ListProductsPricePointsInclude { CURRENCY_PRICES; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesInput.java b/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesInput.java index 88cc7002..1eedd69f 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesInput.java @@ -248,7 +248,7 @@ public void setDirection(Direction direction) { /** * Getter for LineItems. - * Include line items data + * Include line items data. * @return Returns the Boolean */ @JsonGetter("line_items") @@ -259,7 +259,7 @@ public Boolean getLineItems() { /** * Setter for LineItems. - * Include line items data + * Include line items data. * @param lineItems Value for Boolean */ @JsonSetter("line_items") @@ -269,7 +269,7 @@ public void setLineItems(Boolean lineItems) { /** * Getter for Discounts. - * Include discounts data + * Include discounts data. * @return Returns the Boolean */ @JsonGetter("discounts") @@ -280,7 +280,7 @@ public Boolean getDiscounts() { /** * Setter for Discounts. - * Include discounts data + * Include discounts data. * @param discounts Value for Boolean */ @JsonSetter("discounts") @@ -290,7 +290,7 @@ public void setDiscounts(Boolean discounts) { /** * Getter for Taxes. - * Include taxes data + * Include taxes data. * @return Returns the Boolean */ @JsonGetter("taxes") @@ -301,7 +301,7 @@ public Boolean getTaxes() { /** * Setter for Taxes. - * Include taxes data + * Include taxes data. * @param taxes Value for Boolean */ @JsonSetter("taxes") @@ -311,7 +311,7 @@ public void setTaxes(Boolean taxes) { /** * Getter for Credits. - * Include credits data + * Include credits data. * @return Returns the Boolean */ @JsonGetter("credits") @@ -322,7 +322,7 @@ public Boolean getCredits() { /** * Setter for Credits. - * Include credits data + * Include credits data. * @param credits Value for Boolean */ @JsonSetter("credits") @@ -332,7 +332,7 @@ public void setCredits(Boolean credits) { /** * Getter for Payments. - * Include payments data + * Include payments data. * @return Returns the Boolean */ @JsonGetter("payments") @@ -343,7 +343,7 @@ public Boolean getPayments() { /** * Setter for Payments. - * Include payments data + * Include payments data. * @param payments Value for Boolean */ @JsonSetter("payments") @@ -353,7 +353,7 @@ public void setPayments(Boolean payments) { /** * Getter for CustomFields. - * Include custom fields data + * Include custom fields data. * @return Returns the Boolean */ @JsonGetter("custom_fields") @@ -364,7 +364,7 @@ public Boolean getCustomFields() { /** * Setter for CustomFields. - * Include custom fields data + * Include custom fields data. * @param customFields Value for Boolean */ @JsonSetter("custom_fields") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInclude.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInclude.java index 84961bd2..2d9efc3a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInclude.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ListSubscriptionComponentsInclude to be used. */ @@ -21,7 +20,6 @@ public enum ListSubscriptionComponentsInclude { HISTORIC_USAGES; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsSort.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsSort.java index c4b874d3..1b22b85b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsSort.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsSort.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ListSubscriptionComponentsSort to be used. */ @@ -21,7 +20,6 @@ public enum ListSubscriptionComponentsSort { UPDATED_AT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java index 593a288b..138f4d75 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java @@ -135,7 +135,7 @@ public void setPerPage(Integer perPage) { /** * Getter for SinceId. - * Returns events with an id greater than or equal to the one specified + * Returns events with an id greater than or equal to the one specified. * @return Returns the Long */ @JsonGetter("since_id") @@ -146,7 +146,7 @@ public Long getSinceId() { /** * Setter for SinceId. - * Returns events with an id greater than or equal to the one specified + * Returns events with an id greater than or equal to the one specified. * @param sinceId Value for Long */ @JsonSetter("since_id") @@ -156,7 +156,7 @@ public void setSinceId(Long sinceId) { /** * Getter for MaxId. - * Returns events with an id less than or equal to the one specified + * Returns events with an id less than or equal to the one specified. * @return Returns the Long */ @JsonGetter("max_id") @@ -167,7 +167,7 @@ public Long getMaxId() { /** * Setter for MaxId. - * Returns events with an id less than or equal to the one specified + * Returns events with an id less than or equal to the one specified. * @param maxId Value for Long */ @JsonSetter("max_id") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupPrepayment.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupPrepayment.java index a35e4884..3a031a7c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupPrepayment.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupPrepayment.java @@ -15,7 +15,7 @@ */ public class ListSubscriptionGroupPrepayment extends BaseModel { - private ListSubcriptionGroupPrepaymentItem prepayment; + private ListSubscriptionGroupPrepaymentItem prepayment; /** * Default constructor. @@ -25,28 +25,28 @@ public ListSubscriptionGroupPrepayment() { /** * Initialization constructor. - * @param prepayment ListSubcriptionGroupPrepaymentItem value for prepayment. + * @param prepayment ListSubscriptionGroupPrepaymentItem value for prepayment. */ public ListSubscriptionGroupPrepayment( - ListSubcriptionGroupPrepaymentItem prepayment) { + ListSubscriptionGroupPrepaymentItem prepayment) { this.prepayment = prepayment; } /** * Getter for Prepayment. - * @return Returns the ListSubcriptionGroupPrepaymentItem + * @return Returns the ListSubscriptionGroupPrepaymentItem */ @JsonGetter("prepayment") - public ListSubcriptionGroupPrepaymentItem getPrepayment() { + public ListSubscriptionGroupPrepaymentItem getPrepayment() { return prepayment; } /** * Setter for Prepayment. - * @param prepayment Value for ListSubcriptionGroupPrepaymentItem + * @param prepayment Value for ListSubscriptionGroupPrepaymentItem */ @JsonSetter("prepayment") - public void setPrepayment(ListSubcriptionGroupPrepaymentItem prepayment) { + public void setPrepayment(ListSubscriptionGroupPrepaymentItem prepayment) { this.prepayment = prepayment; } @@ -74,7 +74,7 @@ public Builder toBuilder() { * Class to build instances of {@link ListSubscriptionGroupPrepayment}. */ public static class Builder { - private ListSubcriptionGroupPrepaymentItem prepayment; + private ListSubscriptionGroupPrepaymentItem prepayment; /** * Initialization constructor. @@ -84,18 +84,18 @@ public Builder() { /** * Initialization constructor. - * @param prepayment ListSubcriptionGroupPrepaymentItem value for prepayment. + * @param prepayment ListSubscriptionGroupPrepaymentItem value for prepayment. */ - public Builder(ListSubcriptionGroupPrepaymentItem prepayment) { + public Builder(ListSubscriptionGroupPrepaymentItem prepayment) { this.prepayment = prepayment; } /** * Setter for prepayment. - * @param prepayment ListSubcriptionGroupPrepaymentItem value for prepayment. + * @param prepayment ListSubscriptionGroupPrepaymentItem value for prepayment. * @return Builder */ - public Builder prepayment(ListSubcriptionGroupPrepaymentItem prepayment) { + public Builder prepayment(ListSubscriptionGroupPrepaymentItem prepayment) { this.prepayment = prepayment; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubcriptionGroupPrepaymentItem.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupPrepaymentItem.java similarity index 91% rename from src/main/java/com/maxio/advancedbilling/models/ListSubcriptionGroupPrepaymentItem.java rename to src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupPrepaymentItem.java index 863005d1..77e31624 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubcriptionGroupPrepaymentItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupPrepaymentItem.java @@ -16,9 +16,9 @@ import java.time.ZonedDateTime; /** - * This is a model class for ListSubcriptionGroupPrepaymentItem type. + * This is a model class for ListSubscriptionGroupPrepaymentItem type. */ -public class ListSubcriptionGroupPrepaymentItem +public class ListSubscriptionGroupPrepaymentItem extends BaseModel { private Integer id; private String subscriptionGroupUid; @@ -33,7 +33,7 @@ public class ListSubcriptionGroupPrepaymentItem /** * Default constructor. */ - public ListSubcriptionGroupPrepaymentItem() { + public ListSubscriptionGroupPrepaymentItem() { } /** @@ -48,7 +48,7 @@ public ListSubcriptionGroupPrepaymentItem() { * @param paymentType PrepaymentMethod value for paymentType. * @param createdAt ZonedDateTime value for createdAt. */ - public ListSubcriptionGroupPrepaymentItem( + public ListSubscriptionGroupPrepaymentItem( Integer id, String subscriptionGroupUid, Long amountInCents, @@ -243,12 +243,12 @@ public void setCreatedAt(ZonedDateTime createdAt) { } /** - * Converts this ListSubcriptionGroupPrepaymentItem into string format. + * Converts this ListSubscriptionGroupPrepaymentItem into string format. * @return String representation of this class */ @Override public String toString() { - return "ListSubcriptionGroupPrepaymentItem [" + "id=" + id + ", subscriptionGroupUid=" + return "ListSubscriptionGroupPrepaymentItem [" + "id=" + id + ", subscriptionGroupUid=" + subscriptionGroupUid + ", amountInCents=" + amountInCents + ", remainingAmountInCents=" + remainingAmountInCents + ", details=" + details + ", external=" + external + ", memo=" + memo + ", paymentType=" + paymentType @@ -257,9 +257,9 @@ public String toString() { } /** - * Builds a new {@link ListSubcriptionGroupPrepaymentItem.Builder} object. + * Builds a new {@link ListSubscriptionGroupPrepaymentItem.Builder} object. * Creates the instance with the state of the current model. - * @return a new {@link ListSubcriptionGroupPrepaymentItem.Builder} object + * @return a new {@link ListSubscriptionGroupPrepaymentItem.Builder} object */ public Builder toBuilder() { Builder builder = new Builder() @@ -276,7 +276,7 @@ public Builder toBuilder() { } /** - * Class to build instances of {@link ListSubcriptionGroupPrepaymentItem}. + * Class to build instances of {@link ListSubscriptionGroupPrepaymentItem}. */ public static class Builder { private Integer id; @@ -382,11 +382,11 @@ public Builder createdAt(ZonedDateTime createdAt) { } /** - * Builds a new {@link ListSubcriptionGroupPrepaymentItem} object using the set fields. - * @return {@link ListSubcriptionGroupPrepaymentItem} + * Builds a new {@link ListSubscriptionGroupPrepaymentItem} object using the set fields. + * @return {@link ListSubscriptionGroupPrepaymentItem} */ - public ListSubcriptionGroupPrepaymentItem build() { - return new ListSubcriptionGroupPrepaymentItem(id, subscriptionGroupUid, amountInCents, + public ListSubscriptionGroupPrepaymentItem build() { + return new ListSubscriptionGroupPrepaymentItem(id, subscriptionGroupUid, amountInCents, remainingAmountInCents, details, external, memo, paymentType, createdAt); } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupProformaInvoicesInput.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupProformaInvoicesInput.java index d1b86306..12c0dcde 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupProformaInvoicesInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionGroupProformaInvoicesInput.java @@ -83,7 +83,7 @@ public void setUid(String uid) { /** * Getter for LineItems. - * Include line items data + * Include line items data. * @return Returns the Boolean */ @JsonGetter("line_items") @@ -94,7 +94,7 @@ public Boolean getLineItems() { /** * Setter for LineItems. - * Include line items data + * Include line items data. * @param lineItems Value for Boolean */ @JsonSetter("line_items") @@ -104,7 +104,7 @@ public void setLineItems(Boolean lineItems) { /** * Getter for Discounts. - * Include discounts data + * Include discounts data. * @return Returns the Boolean */ @JsonGetter("discounts") @@ -115,7 +115,7 @@ public Boolean getDiscounts() { /** * Setter for Discounts. - * Include discounts data + * Include discounts data. * @param discounts Value for Boolean */ @JsonSetter("discounts") @@ -125,7 +125,7 @@ public void setDiscounts(Boolean discounts) { /** * Getter for Taxes. - * Include taxes data + * Include taxes data. * @return Returns the Boolean */ @JsonGetter("taxes") @@ -136,7 +136,7 @@ public Boolean getTaxes() { /** * Setter for Taxes. - * Include taxes data + * Include taxes data. * @param taxes Value for Boolean */ @JsonSetter("taxes") @@ -146,7 +146,7 @@ public void setTaxes(Boolean taxes) { /** * Getter for Credits. - * Include credits data + * Include credits data. * @return Returns the Boolean */ @JsonGetter("credits") @@ -157,7 +157,7 @@ public Boolean getCredits() { /** * Setter for Credits. - * Include credits data + * Include credits data. * @param credits Value for Boolean */ @JsonSetter("credits") @@ -167,7 +167,7 @@ public void setCredits(Boolean credits) { /** * Getter for Payments. - * Include payments data + * Include payments data. * @return Returns the Boolean */ @JsonGetter("payments") @@ -178,7 +178,7 @@ public Boolean getPayments() { /** * Setter for Payments. - * Include payments data + * Include payments data. * @param payments Value for Boolean */ @JsonSetter("payments") @@ -188,7 +188,7 @@ public void setPayments(Boolean payments) { /** * Getter for CustomFields. - * Include custom fields data + * Include custom fields data. * @return Returns the Boolean */ @JsonGetter("custom_fields") @@ -199,7 +199,7 @@ public Boolean getCustomFields() { /** * Setter for CustomFields. - * Include custom fields data + * Include custom fields data. * @param customFields Value for Boolean */ @JsonSetter("custom_fields") diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionsInput.java index 0daa0999..895e2d9d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionsInput.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.containers.ListSubscriptionsInputProduct; import java.time.LocalDate; import java.time.ZonedDateTime; import java.util.List; @@ -23,19 +24,28 @@ public class ListSubscriptionsInput { private Integer page; private Integer perPage; + private SubscriptionSort sort; + private SortingDirection direction; private SubscriptionStateFilter state; - private Integer product; + private ListSubscriptionsInputProduct product; + private String q; + private QScope qScope; + private Integer customerId; private Integer productPricePointId; private Integer coupon; private String couponCode; + private CollectionMethod1 collectionMethod; + private Integer brandingThemeId; private SubscriptionDateField dateField; private LocalDate startDate; private LocalDate endDate; private ZonedDateTime startDatetime; private ZonedDateTime endDatetime; private Map metadata; - private SortingDirection direction; - private SubscriptionSort sort; + private GroupStatus groupStatus; + private Boolean dunningExemption; + private String paymentGateways; + private String currencies; private List include; /** @@ -51,53 +61,80 @@ public ListSubscriptionsInput() { * Initialization constructor. * @param page Integer value for page. * @param perPage Integer value for perPage. + * @param sort SubscriptionSort value for sort. + * @param direction SortingDirection value for direction. * @param state SubscriptionStateFilter value for state. - * @param product Integer value for product. + * @param product ListSubscriptionsInputProduct value for product. + * @param q String value for q. + * @param qScope QScope value for qScope. + * @param customerId Integer value for customerId. * @param productPricePointId Integer value for productPricePointId. * @param coupon Integer value for coupon. * @param couponCode String value for couponCode. + * @param collectionMethod CollectionMethod1 value for collectionMethod. + * @param brandingThemeId Integer value for brandingThemeId. * @param dateField SubscriptionDateField value for dateField. * @param startDate LocalDate value for startDate. * @param endDate LocalDate value for endDate. * @param startDatetime ZonedDateTime value for startDatetime. * @param endDatetime ZonedDateTime value for endDatetime. * @param metadata Map of String, value for metadata. - * @param direction SortingDirection value for direction. - * @param sort SubscriptionSort value for sort. + * @param groupStatus GroupStatus value for groupStatus. + * @param dunningExemption Boolean value for dunningExemption. + * @param paymentGateways String value for paymentGateways. + * @param currencies String value for currencies. * @param include List of SubscriptionListInclude value for include. */ public ListSubscriptionsInput( Integer page, Integer perPage, + SubscriptionSort sort, + SortingDirection direction, SubscriptionStateFilter state, - Integer product, + ListSubscriptionsInputProduct product, + String q, + QScope qScope, + Integer customerId, Integer productPricePointId, Integer coupon, String couponCode, + CollectionMethod1 collectionMethod, + Integer brandingThemeId, SubscriptionDateField dateField, LocalDate startDate, LocalDate endDate, ZonedDateTime startDatetime, ZonedDateTime endDatetime, Map metadata, - SortingDirection direction, - SubscriptionSort sort, + GroupStatus groupStatus, + Boolean dunningExemption, + String paymentGateways, + String currencies, List include) { this.page = page; this.perPage = perPage; + this.sort = sort; + this.direction = direction; this.state = state; this.product = product; + this.q = q; + this.qScope = qScope; + this.customerId = customerId; this.productPricePointId = productPricePointId; this.coupon = coupon; this.couponCode = couponCode; + this.collectionMethod = collectionMethod; + this.brandingThemeId = brandingThemeId; this.dateField = dateField; this.startDate = startDate; this.endDate = endDate; this.startDatetime = startDatetime; this.endDatetime = endDatetime; this.metadata = metadata; - this.direction = direction; - this.sort = sort; + this.groupStatus = groupStatus; + this.dunningExemption = dunningExemption; + this.paymentGateways = paymentGateways; + this.currencies = currencies; this.include = include; } @@ -155,6 +192,48 @@ public void setPerPage(Integer perPage) { this.perPage = perPage; } + /** + * Getter for Sort. + * The attribute by which to sort + * @return Returns the SubscriptionSort + */ + @JsonGetter("sort") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SubscriptionSort getSort() { + return sort; + } + + /** + * Setter for Sort. + * The attribute by which to sort + * @param sort Value for SubscriptionSort + */ + @JsonSetter("sort") + public void setSort(SubscriptionSort sort) { + this.sort = sort; + } + + /** + * Getter for Direction. + * Controls the order in which results are returned. Use in query `direction=asc`. + * @return Returns the SortingDirection + */ + @JsonGetter("direction") + @JsonInclude(JsonInclude.Include.NON_NULL) + public SortingDirection getDirection() { + return direction; + } + + /** + * Setter for Direction. + * Controls the order in which results are returned. Use in query `direction=asc`. + * @param direction Value for SortingDirection + */ + @JsonSetter("direction") + public void setDirection(SortingDirection direction) { + this.direction = direction; + } + /** * Getter for State. * The current state of the subscription @@ -178,28 +257,93 @@ public void setState(SubscriptionStateFilter state) { /** * Getter for Product. - * The product id of the subscription. (Note that the product handle cannot be used.) - * @return Returns the Integer + * Filter subscriptions by product. Accepts product ID or exact product name. Product handle is + * not supported. + * @return Returns the ListSubscriptionsInputProduct */ @JsonGetter("product") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getProduct() { + public ListSubscriptionsInputProduct getProduct() { return product; } /** * Setter for Product. - * The product id of the subscription. (Note that the product handle cannot be used.) - * @param product Value for Integer + * Filter subscriptions by product. Accepts product ID or exact product name. Product handle is + * not supported. + * @param product Value for ListSubscriptionsInputProduct */ @JsonSetter("product") - public void setProduct(Integer product) { + public void setProduct(ListSubscriptionsInputProduct product) { this.product = product; } + /** + * Getter for Q. + * Search string. + * @return Returns the String + */ + @JsonGetter("q") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getQ() { + return q; + } + + /** + * Setter for Q. + * Search string. + * @param q Value for String + */ + @JsonSetter("q") + public void setQ(String q) { + this.q = q; + } + + /** + * Getter for QScope. + * Scope of fields used by the q search. + * @return Returns the QScope + */ + @JsonGetter("q_scope") + @JsonInclude(JsonInclude.Include.NON_NULL) + public QScope getQScope() { + return qScope; + } + + /** + * Setter for QScope. + * Scope of fields used by the q search. + * @param qScope Value for QScope + */ + @JsonSetter("q_scope") + public void setQScope(QScope qScope) { + this.qScope = qScope; + } + + /** + * Getter for CustomerId. + * The Advanced Billing id of the customer. + * @return Returns the Integer + */ + @JsonGetter("customer_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getCustomerId() { + return customerId; + } + + /** + * Setter for CustomerId. + * The Advanced Billing id of the customer. + * @param customerId Value for Integer + */ + @JsonSetter("customer_id") + public void setCustomerId(Integer customerId) { + this.customerId = customerId; + } + /** * Getter for ProductPricePointId. - * The ID of the product price point. If supplied, product is required + * The ID of the product price point. If supplied, product is required. * @return Returns the Integer */ @JsonGetter("product_price_point_id") @@ -210,7 +354,7 @@ public Integer getProductPricePointId() { /** * Setter for ProductPricePointId. - * The ID of the product price point. If supplied, product is required + * The ID of the product price point. If supplied, product is required. * @param productPricePointId Value for Integer */ @JsonSetter("product_price_point_id") @@ -262,6 +406,54 @@ public void setCouponCode(String couponCode) { this.couponCode = couponCode; } + /** + * Getter for CollectionMethod. + * The collection method for the subscription. + * @return Returns the CollectionMethod1 + */ + @JsonGetter("collection_method") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CollectionMethod1 getCollectionMethod() { + return collectionMethod; + } + + /** + * Setter for CollectionMethod. + * The collection method for the subscription. + * @param collectionMethod Value for CollectionMethod1 + */ + @JsonSetter("collection_method") + public void setCollectionMethod(CollectionMethod1 collectionMethod) { + this.collectionMethod = collectionMethod; + } + + /** + * Getter for BrandingThemeId. + * Filter subscriptions by the ID of an assigned Branding Theme. Branding Themes is a beta + * feature. See [Understand Branding + * Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand-Branding-Themes#understand-branding-themes-0-0) + * for more information. + * @return Returns the Integer + */ + @JsonGetter("branding_theme_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getBrandingThemeId() { + return brandingThemeId; + } + + /** + * Setter for BrandingThemeId. + * Filter subscriptions by the ID of an assigned Branding Theme. Branding Themes is a beta + * feature. See [Understand Branding + * Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand-Branding-Themes#understand-branding-themes-0-0) + * for more information. + * @param brandingThemeId Value for Integer + */ + @JsonSetter("branding_theme_id") + public void setBrandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = brandingThemeId; + } + /** * Getter for DateField. * The type of filter you'd like to apply to your search. Allowed Values: , @@ -425,45 +617,87 @@ public void setMetadata(Map metadata) { } /** - * Getter for Direction. - * Controls the order in which results are returned. Use in query `direction=asc`. - * @return Returns the SortingDirection + * Getter for GroupStatus. + * Filter by whether a subscription is in a group. + * @return Returns the GroupStatus */ - @JsonGetter("direction") + @JsonGetter("group_status") @JsonInclude(JsonInclude.Include.NON_NULL) - public SortingDirection getDirection() { - return direction; + public GroupStatus getGroupStatus() { + return groupStatus; } /** - * Setter for Direction. - * Controls the order in which results are returned. Use in query `direction=asc`. - * @param direction Value for SortingDirection + * Setter for GroupStatus. + * Filter by whether a subscription is in a group. + * @param groupStatus Value for GroupStatus */ - @JsonSetter("direction") - public void setDirection(SortingDirection direction) { - this.direction = direction; + @JsonSetter("group_status") + public void setGroupStatus(GroupStatus groupStatus) { + this.groupStatus = groupStatus; } /** - * Getter for Sort. - * The attribute by which to sort - * @return Returns the SubscriptionSort + * Getter for DunningExemption. + * Filter by dunning exemption status. + * @return Returns the Boolean */ - @JsonGetter("sort") + @JsonGetter("dunning_exemption") @JsonInclude(JsonInclude.Include.NON_NULL) - public SubscriptionSort getSort() { - return sort; + public Boolean getDunningExemption() { + return dunningExemption; } /** - * Setter for Sort. - * The attribute by which to sort - * @param sort Value for SubscriptionSort + * Setter for DunningExemption. + * Filter by dunning exemption status. + * @param dunningExemption Value for Boolean */ - @JsonSetter("sort") - public void setSort(SubscriptionSort sort) { - this.sort = sort; + @JsonSetter("dunning_exemption") + public void setDunningExemption(Boolean dunningExemption) { + this.dunningExemption = dunningExemption; + } + + /** + * Getter for PaymentGateways. + * Comma-separated payment gateway identifiers. + * @return Returns the String + */ + @JsonGetter("payment_gateways") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaymentGateways() { + return paymentGateways; + } + + /** + * Setter for PaymentGateways. + * Comma-separated payment gateway identifiers. + * @param paymentGateways Value for String + */ + @JsonSetter("payment_gateways") + public void setPaymentGateways(String paymentGateways) { + this.paymentGateways = paymentGateways; + } + + /** + * Getter for Currencies. + * Comma-separated currency codes. + * @return Returns the String + */ + @JsonGetter("currencies") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCurrencies() { + return currencies; + } + + /** + * Setter for Currencies. + * Comma-separated currency codes. + * @param currencies Value for String + */ + @JsonSetter("currencies") + public void setCurrencies(String currencies) { + this.currencies = currencies; } /** @@ -495,12 +729,17 @@ public void setInclude(List include) { */ @Override public String toString() { - return "ListSubscriptionsInput [" + "page=" + page + ", perPage=" + perPage + ", state=" - + state + ", product=" + product + ", productPricePointId=" + productPricePointId - + ", coupon=" + coupon + ", couponCode=" + couponCode + ", dateField=" + dateField + return "ListSubscriptionsInput [" + "page=" + page + ", perPage=" + perPage + ", sort=" + + sort + ", direction=" + direction + ", state=" + state + ", product=" + product + + ", q=" + q + ", qScope=" + qScope + ", customerId=" + customerId + + ", productPricePointId=" + productPricePointId + ", coupon=" + coupon + + ", couponCode=" + couponCode + ", collectionMethod=" + collectionMethod + + ", brandingThemeId=" + brandingThemeId + ", dateField=" + dateField + ", startDate=" + startDate + ", endDate=" + endDate + ", startDatetime=" + startDatetime + ", endDatetime=" + endDatetime + ", metadata=" + metadata - + ", direction=" + direction + ", sort=" + sort + ", include=" + include + "]"; + + ", groupStatus=" + groupStatus + ", dunningExemption=" + dunningExemption + + ", paymentGateways=" + paymentGateways + ", currencies=" + currencies + + ", include=" + include + "]"; } /** @@ -512,19 +751,28 @@ public Builder toBuilder() { Builder builder = new Builder() .page(getPage()) .perPage(getPerPage()) + .sort(getSort()) + .direction(getDirection()) .state(getState()) .product(getProduct()) + .q(getQ()) + .qScope(getQScope()) + .customerId(getCustomerId()) .productPricePointId(getProductPricePointId()) .coupon(getCoupon()) .couponCode(getCouponCode()) + .collectionMethod(getCollectionMethod()) + .brandingThemeId(getBrandingThemeId()) .dateField(getDateField()) .startDate(getStartDate()) .endDate(getEndDate()) .startDatetime(getStartDatetime()) .endDatetime(getEndDatetime()) .metadata(getMetadata()) - .direction(getDirection()) - .sort(getSort()) + .groupStatus(getGroupStatus()) + .dunningExemption(getDunningExemption()) + .paymentGateways(getPaymentGateways()) + .currencies(getCurrencies()) .include(getInclude()); return builder; } @@ -535,19 +783,28 @@ public Builder toBuilder() { public static class Builder { private Integer page = 1; private Integer perPage = 20; + private SubscriptionSort sort = SubscriptionSort.SIGNUP_DATE; + private SortingDirection direction; private SubscriptionStateFilter state; - private Integer product; + private ListSubscriptionsInputProduct product; + private String q; + private QScope qScope; + private Integer customerId; private Integer productPricePointId; private Integer coupon; private String couponCode; + private CollectionMethod1 collectionMethod; + private Integer brandingThemeId; private SubscriptionDateField dateField; private LocalDate startDate; private LocalDate endDate; private ZonedDateTime startDatetime; private ZonedDateTime endDatetime; private Map metadata; - private SortingDirection direction; - private SubscriptionSort sort = SubscriptionSort.SIGNUP_DATE; + private GroupStatus groupStatus; + private Boolean dunningExemption; + private String paymentGateways; + private String currencies; private List include; @@ -572,6 +829,26 @@ public Builder perPage(Integer perPage) { return this; } + /** + * Setter for sort. + * @param sort SubscriptionSort value for sort. + * @return Builder + */ + public Builder sort(SubscriptionSort sort) { + this.sort = sort; + return this; + } + + /** + * Setter for direction. + * @param direction SortingDirection value for direction. + * @return Builder + */ + public Builder direction(SortingDirection direction) { + this.direction = direction; + return this; + } + /** * Setter for state. * @param state SubscriptionStateFilter value for state. @@ -584,14 +861,44 @@ public Builder state(SubscriptionStateFilter state) { /** * Setter for product. - * @param product Integer value for product. + * @param product ListSubscriptionsInputProduct value for product. * @return Builder */ - public Builder product(Integer product) { + public Builder product(ListSubscriptionsInputProduct product) { this.product = product; return this; } + /** + * Setter for q. + * @param q String value for q. + * @return Builder + */ + public Builder q(String q) { + this.q = q; + return this; + } + + /** + * Setter for qScope. + * @param qScope QScope value for qScope. + * @return Builder + */ + public Builder qScope(QScope qScope) { + this.qScope = qScope; + return this; + } + + /** + * Setter for customerId. + * @param customerId Integer value for customerId. + * @return Builder + */ + public Builder customerId(Integer customerId) { + this.customerId = customerId; + return this; + } + /** * Setter for productPricePointId. * @param productPricePointId Integer value for productPricePointId. @@ -622,6 +929,26 @@ public Builder couponCode(String couponCode) { return this; } + /** + * Setter for collectionMethod. + * @param collectionMethod CollectionMethod1 value for collectionMethod. + * @return Builder + */ + public Builder collectionMethod(CollectionMethod1 collectionMethod) { + this.collectionMethod = collectionMethod; + return this; + } + + /** + * Setter for brandingThemeId. + * @param brandingThemeId Integer value for brandingThemeId. + * @return Builder + */ + public Builder brandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = brandingThemeId; + return this; + } + /** * Setter for dateField. * @param dateField SubscriptionDateField value for dateField. @@ -683,22 +1010,42 @@ public Builder metadata(Map metadata) { } /** - * Setter for direction. - * @param direction SortingDirection value for direction. + * Setter for groupStatus. + * @param groupStatus GroupStatus value for groupStatus. * @return Builder */ - public Builder direction(SortingDirection direction) { - this.direction = direction; + public Builder groupStatus(GroupStatus groupStatus) { + this.groupStatus = groupStatus; return this; } /** - * Setter for sort. - * @param sort SubscriptionSort value for sort. + * Setter for dunningExemption. + * @param dunningExemption Boolean value for dunningExemption. * @return Builder */ - public Builder sort(SubscriptionSort sort) { - this.sort = sort; + public Builder dunningExemption(Boolean dunningExemption) { + this.dunningExemption = dunningExemption; + return this; + } + + /** + * Setter for paymentGateways. + * @param paymentGateways String value for paymentGateways. + * @return Builder + */ + public Builder paymentGateways(String paymentGateways) { + this.paymentGateways = paymentGateways; + return this; + } + + /** + * Setter for currencies. + * @param currencies String value for currencies. + * @return Builder + */ + public Builder currencies(String currencies) { + this.currencies = currencies; return this; } @@ -717,9 +1064,10 @@ public Builder include(List include) { * @return {@link ListSubscriptionsInput} */ public ListSubscriptionsInput build() { - return new ListSubscriptionsInput(page, perPage, state, product, productPricePointId, - coupon, couponCode, dateField, startDate, endDate, startDatetime, endDatetime, - metadata, direction, sort, include); + return new ListSubscriptionsInput(page, perPage, sort, direction, state, product, q, + qScope, customerId, productPricePointId, coupon, couponCode, collectionMethod, + brandingThemeId, dateField, startDate, endDate, startDatetime, endDatetime, + metadata, groupStatus, dunningExemption, paymentGateways, currencies, include); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java b/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java index e44a8bc2..af26b355 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java @@ -120,7 +120,7 @@ public void setComponentId(ListUsagesInputComponentId componentId) { /** * Getter for SinceId. - * Returns usages with an id greater than or equal to the one specified + * Returns usages with an id greater than or equal to the one specified. * @return Returns the Long */ @JsonGetter("since_id") @@ -131,7 +131,7 @@ public Long getSinceId() { /** * Setter for SinceId. - * Returns usages with an id greater than or equal to the one specified + * Returns usages with an id greater than or equal to the one specified. * @param sinceId Value for Long */ @JsonSetter("since_id") @@ -141,7 +141,7 @@ public void setSinceId(Long sinceId) { /** * Getter for MaxId. - * Returns usages with an id less than or equal to the one specified + * Returns usages with an id less than or equal to the one specified. * @return Returns the Long */ @JsonGetter("max_id") @@ -152,7 +152,7 @@ public Long getMaxId() { /** * Setter for MaxId. - * Returns usages with an id less than or equal to the one specified + * Returns usages with an id less than or equal to the one specified. * @param maxId Value for Long */ @JsonSetter("max_id") diff --git a/src/main/java/com/maxio/advancedbilling/models/MetafieldInput.java b/src/main/java/com/maxio/advancedbilling/models/MetafieldInput.java index 236beb9f..132ddb48 100644 --- a/src/main/java/com/maxio/advancedbilling/models/MetafieldInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/MetafieldInput.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * MetafieldInput to be used. */ @@ -25,7 +24,6 @@ public enum MetafieldInput { DROPDOWN; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java b/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java index 6a8dc557..456c60ca 100644 --- a/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java @@ -36,6 +36,7 @@ public class MeteredComponent private List publicSignupPageIds; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Default constructor. @@ -61,6 +62,7 @@ public MeteredComponent() { * @param publicSignupPageIds List of Integer value for publicSignupPageIds. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ public MeteredComponent( String name, @@ -78,7 +80,8 @@ public MeteredComponent( Boolean allowFractionalQuantities, List publicSignupPageIds, Integer interval, - IntervalUnit intervalUnit) { + IntervalUnit intervalUnit, + String unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -95,6 +98,7 @@ public MeteredComponent( this.publicSignupPageIds = publicSignupPageIds; this.interval = interval; this.intervalUnit = OptionalNullable.of(intervalUnit); + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -115,6 +119,7 @@ public MeteredComponent( * @param publicSignupPageIds List of Integer value for publicSignupPageIds. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ protected MeteredComponent(String name, String unitName, PricingScheme pricingScheme, @@ -122,7 +127,7 @@ protected MeteredComponent(String name, String unitName, PricingScheme pricingSc List pricePoints, MeteredComponentUnitPrice unitPrice, String taxCode, Boolean hideDateRangeOnInvoice, Boolean displayOnHostedPage, Boolean allowFractionalQuantities, List publicSignupPageIds, Integer interval, - OptionalNullable intervalUnit) { + OptionalNullable intervalUnit, OptionalNullable unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -139,12 +144,13 @@ protected MeteredComponent(String name, String unitName, PricingScheme pricingSc this.publicSignupPageIds = publicSignupPageIds; this.interval = interval; this.intervalUnit = intervalUnit; + this.unspscCode = unspscCode; } /** * Getter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @return Returns the String */ @JsonGetter("name") @@ -155,7 +161,7 @@ public String getName() { /** * Setter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @param name Value for String */ @JsonSetter("name") @@ -166,7 +172,7 @@ public void setName(String name) { /** * Getter for UnitName. * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 + * automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 * messages” on a subscription’s component line-item * @return Returns the String */ @@ -178,7 +184,7 @@ public String getUnitName() { /** * Setter for UnitName. * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 + * automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 * messages” on a subscription’s component line-item * @param unitName Value for String */ @@ -210,7 +216,7 @@ public void setDescription(String description) { /** * Getter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @return Returns the String @@ -223,7 +229,7 @@ public String getHandle() { /** * Setter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @param handle Value for String @@ -326,8 +332,8 @@ public void setPricePoints(List pricePoints) { * Getter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For * On/Off Components, this is the amount that the customer will be charged when they turn the - * component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or - * 0.0012 or 0.00000065 + * component on for the subscription. The price can contain up to 8 decimal places. e.g., 1.00 + * or 0.0012 or 0.00000065 * @return Returns the MeteredComponentUnitPrice */ @JsonGetter("unit_price") @@ -340,8 +346,8 @@ public MeteredComponentUnitPrice getUnitPrice() { * Setter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For * On/Off Components, this is the amount that the customer will be charged when they turn the - * component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or - * 0.0012 or 0.00000065 + * component on for the subscription. The price can contain up to 8 decimal places. e.g., 1.00 + * or 0.0012 or 0.00000065 * @param unitPrice Value for MeteredComponentUnitPrice */ @JsonSetter("unit_price") @@ -456,7 +462,7 @@ public void setPublicSignupPageIds(List publicSignupPageIds) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component's default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @return Returns the Integer @@ -469,7 +475,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component's default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @param interval Value for Integer @@ -522,6 +528,53 @@ public void unsetIntervalUnit() { intervalUnit = null; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this MeteredComponent into string format. * @return String representation of this class @@ -535,8 +588,8 @@ public String toString() { + hideDateRangeOnInvoice + ", displayOnHostedPage=" + displayOnHostedPage + ", allowFractionalQuantities=" + allowFractionalQuantities + ", publicSignupPageIds=" + publicSignupPageIds + ", interval=" + interval - + ", intervalUnit=" + intervalUnit + ", additionalProperties=" - + getAdditionalProperties() + "]"; + + ", intervalUnit=" + intervalUnit + ", unspscCode=" + unspscCode + + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -559,6 +612,7 @@ public Builder toBuilder() { .publicSignupPageIds(getPublicSignupPageIds()) .interval(getInterval()); builder.intervalUnit = internalGetIntervalUnit(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -582,6 +636,7 @@ public static class Builder { private List publicSignupPageIds; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Initialization constructor. @@ -770,6 +825,25 @@ public Builder unsetIntervalUnit() { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link MeteredComponent} object using the set fields. * @return {@link MeteredComponent} @@ -778,7 +852,7 @@ public MeteredComponent build() { return new MeteredComponent(name, unitName, pricingScheme, description, handle, taxable, prices, pricePoints, unitPrice, taxCode, hideDateRangeOnInvoice, displayOnHostedPage, allowFractionalQuantities, publicSignupPageIds, interval, - intervalUnit); + intervalUnit, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/MeteredUsage.java b/src/main/java/com/maxio/advancedbilling/models/MeteredUsage.java index 9cadd39b..510c9995 100644 --- a/src/main/java/com/maxio/advancedbilling/models/MeteredUsage.java +++ b/src/main/java/com/maxio/advancedbilling/models/MeteredUsage.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.maxio.advancedbilling.models.containers.MeteredUsageNewUnitBalance; import io.apimatic.core.types.BaseModel; /** @@ -18,7 +19,7 @@ public class MeteredUsage extends BaseModel { private String previousUnitBalance; - private int newUnitBalance; + private MeteredUsageNewUnitBalance newUnitBalance; private int usageQuantity; private int componentId; private String componentHandle; @@ -33,7 +34,7 @@ public MeteredUsage() { /** * Initialization constructor. * @param previousUnitBalance String value for previousUnitBalance. - * @param newUnitBalance int value for newUnitBalance. + * @param newUnitBalance MeteredUsageNewUnitBalance value for newUnitBalance. * @param usageQuantity int value for usageQuantity. * @param componentId int value for componentId. * @param componentHandle String value for componentHandle. @@ -42,7 +43,7 @@ public MeteredUsage() { @JsonCreator public MeteredUsage( @JsonProperty("previous_unit_balance") String previousUnitBalance, - @JsonProperty("new_unit_balance") int newUnitBalance, + @JsonProperty("new_unit_balance") MeteredUsageNewUnitBalance newUnitBalance, @JsonProperty("usage_quantity") int usageQuantity, @JsonProperty("component_id") int componentId, @JsonProperty("component_handle") String componentHandle, @@ -75,19 +76,19 @@ public void setPreviousUnitBalance(String previousUnitBalance) { /** * Getter for NewUnitBalance. - * @return Returns the int + * @return Returns the MeteredUsageNewUnitBalance */ @JsonGetter("new_unit_balance") - public int getNewUnitBalance() { + public MeteredUsageNewUnitBalance getNewUnitBalance() { return newUnitBalance; } /** * Setter for NewUnitBalance. - * @param newUnitBalance Value for int + * @param newUnitBalance Value for MeteredUsageNewUnitBalance */ @JsonSetter("new_unit_balance") - public void setNewUnitBalance(int newUnitBalance) { + public void setNewUnitBalance(MeteredUsageNewUnitBalance newUnitBalance) { this.newUnitBalance = newUnitBalance; } @@ -191,7 +192,7 @@ public Builder toBuilder() { */ public static class Builder { private String previousUnitBalance; - private int newUnitBalance; + private MeteredUsageNewUnitBalance newUnitBalance; private int usageQuantity; private int componentId; private String componentHandle; @@ -206,14 +207,14 @@ public Builder() { /** * Initialization constructor. * @param previousUnitBalance String value for previousUnitBalance. - * @param newUnitBalance int value for newUnitBalance. + * @param newUnitBalance MeteredUsageNewUnitBalance value for newUnitBalance. * @param usageQuantity int value for usageQuantity. * @param componentId int value for componentId. * @param componentHandle String value for componentHandle. * @param memo String value for memo. */ - public Builder(String previousUnitBalance, int newUnitBalance, int usageQuantity, - int componentId, String componentHandle, String memo) { + public Builder(String previousUnitBalance, MeteredUsageNewUnitBalance newUnitBalance, + int usageQuantity, int componentId, String componentHandle, String memo) { this.previousUnitBalance = previousUnitBalance; this.newUnitBalance = newUnitBalance; this.usageQuantity = usageQuantity; @@ -234,10 +235,10 @@ public Builder previousUnitBalance(String previousUnitBalance) { /** * Setter for newUnitBalance. - * @param newUnitBalance int value for newUnitBalance. + * @param newUnitBalance MeteredUsageNewUnitBalance value for newUnitBalance. * @return Builder */ - public Builder newUnitBalance(int newUnitBalance) { + public Builder newUnitBalance(MeteredUsageNewUnitBalance newUnitBalance) { this.newUnitBalance = newUnitBalance; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/OfferItem.java b/src/main/java/com/maxio/advancedbilling/models/OfferItem.java index 3795ed4c..678085f4 100644 --- a/src/main/java/com/maxio/advancedbilling/models/OfferItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/OfferItem.java @@ -256,7 +256,7 @@ public void setCurrencyPrices(List currencyPrices) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -269,7 +269,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java b/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java index 31ccb49b..09de76d2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java @@ -35,6 +35,7 @@ public class OnOffComponent private List publicSignupPageIds; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Default constructor. @@ -59,6 +60,7 @@ public OnOffComponent() { * @param publicSignupPageIds List of Integer value for publicSignupPageIds. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ public OnOffComponent( String name, @@ -75,7 +77,8 @@ public OnOffComponent( Boolean allowFractionalQuantities, List publicSignupPageIds, Integer interval, - IntervalUnit intervalUnit) { + IntervalUnit intervalUnit, + String unspscCode) { this.name = name; this.description = description; this.handle = handle; @@ -91,6 +94,7 @@ public OnOffComponent( this.publicSignupPageIds = publicSignupPageIds; this.interval = interval; this.intervalUnit = OptionalNullable.of(intervalUnit); + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -110,6 +114,7 @@ public OnOffComponent( * @param publicSignupPageIds List of Integer value for publicSignupPageIds. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ protected OnOffComponent(String name, OnOffComponentUnitPrice unitPrice, String description, @@ -117,7 +122,7 @@ protected OnOffComponent(String name, OnOffComponentUnitPrice unitPrice, String OptionalNullable downgradeCredit, List pricePoints, String taxCode, Boolean hideDateRangeOnInvoice, Boolean displayOnHostedPage, Boolean allowFractionalQuantities, List publicSignupPageIds, Integer interval, - OptionalNullable intervalUnit) { + OptionalNullable intervalUnit, OptionalNullable unspscCode) { this.name = name; this.description = description; this.handle = handle; @@ -133,12 +138,13 @@ protected OnOffComponent(String name, OnOffComponentUnitPrice unitPrice, String this.publicSignupPageIds = publicSignupPageIds; this.interval = interval; this.intervalUnit = intervalUnit; + this.unspscCode = unspscCode; } /** * Getter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @return Returns the String */ @JsonGetter("name") @@ -149,7 +155,7 @@ public String getName() { /** * Setter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @param name Value for String */ @JsonSetter("name") @@ -180,7 +186,7 @@ public void setDescription(String description) { /** * Getter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @return Returns the String @@ -193,7 +199,7 @@ public String getHandle() { /** * Setter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @param handle Value for String @@ -332,7 +338,8 @@ public void setPricePoints(List pricePoints) { /** * Getter for UnitPrice. * This is the amount that the customer will be charged when they turn the component on for the - * subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * subscription. The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or + * 0.00000065 * @return Returns the OnOffComponentUnitPrice */ @JsonGetter("unit_price") @@ -343,7 +350,8 @@ public OnOffComponentUnitPrice getUnitPrice() { /** * Setter for UnitPrice. * This is the amount that the customer will be charged when they turn the component on for the - * subscription. The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * subscription. The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or + * 0.00000065 * @param unitPrice Value for OnOffComponentUnitPrice */ @JsonSetter("unit_price") @@ -458,7 +466,7 @@ public void setPublicSignupPageIds(List publicSignupPageIds) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component's default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @return Returns the Integer @@ -471,7 +479,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component's default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @param interval Value for Integer @@ -524,6 +532,53 @@ public void unsetIntervalUnit() { intervalUnit = null; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this OnOffComponent into string format. * @return String representation of this class @@ -537,8 +592,8 @@ public String toString() { + hideDateRangeOnInvoice + ", displayOnHostedPage=" + displayOnHostedPage + ", allowFractionalQuantities=" + allowFractionalQuantities + ", publicSignupPageIds=" + publicSignupPageIds + ", interval=" + interval - + ", intervalUnit=" + intervalUnit + ", additionalProperties=" - + getAdditionalProperties() + "]"; + + ", intervalUnit=" + intervalUnit + ", unspscCode=" + unspscCode + + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -561,6 +616,7 @@ public Builder toBuilder() { builder.upgradeCharge = internalGetUpgradeCharge(); builder.downgradeCredit = internalGetDowngradeCredit(); builder.intervalUnit = internalGetIntervalUnit(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -583,6 +639,7 @@ public static class Builder { private List publicSignupPageIds; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Initialization constructor. @@ -777,6 +834,25 @@ public Builder unsetIntervalUnit() { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link OnOffComponent} object using the set fields. * @return {@link OnOffComponent} @@ -785,7 +861,7 @@ public OnOffComponent build() { return new OnOffComponent(name, unitPrice, description, handle, taxable, upgradeCharge, downgradeCredit, pricePoints, taxCode, hideDateRangeOnInvoice, displayOnHostedPage, allowFractionalQuantities, publicSignupPageIds, interval, - intervalUnit); + intervalUnit, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/PayPalVault.java b/src/main/java/com/maxio/advancedbilling/models/PayPalVault.java index ee313d29..0ad5496c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PayPalVault.java +++ b/src/main/java/com/maxio/advancedbilling/models/PayPalVault.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * PayPalVault to be used. */ @@ -25,7 +24,6 @@ public enum PayPalVault { PAYPAL_COMPLETE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/PaymentProfileAttributes.java b/src/main/java/com/maxio/advancedbilling/models/PaymentProfileAttributes.java index c7ce465a..388f3fb2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PaymentProfileAttributes.java +++ b/src/main/java/com/maxio/advancedbilling/models/PaymentProfileAttributes.java @@ -201,7 +201,7 @@ protected PaymentProfileAttributes(String chargifyToken, Integer id, PaymentType * Getter for ChargifyToken. * (Optional) Token received after sending billing information using Maxio.js (formerly * Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` - * (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + * (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). * @return Returns the String */ @JsonGetter("chargify_token") @@ -214,7 +214,7 @@ public String getChargifyToken() { * Setter for ChargifyToken. * (Optional) Token received after sending billing information using Maxio.js (formerly * Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` - * (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + * (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). * @param chargifyToken Value for String */ @JsonSetter("chargify_token") @@ -327,7 +327,7 @@ public void setMaskedCardNumber(String maskedCardNumber) { /** * Getter for FullNumber. - * The full credit card number (string representation, i.e. 5424000000000015) + * The full credit card number (string representation, e.g., 5424000000000015) * @return Returns the String */ @JsonGetter("full_number") @@ -338,7 +338,7 @@ public String getFullNumber() { /** * Setter for FullNumber. - * The full credit card number (string representation, i.e. 5424000000000015) + * The full credit card number (string representation, e.g., 5424000000000015) * @param fullNumber Value for String */ @JsonSetter("full_number") @@ -348,8 +348,8 @@ public void setFullNumber(String fullNumber) { /** * Getter for CardType. - * (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) - * you may supply it here so that we may display the card type in the UI. + * (Optional, used only for Subscription Import) If you know the card type (e.g., Visa, MC, + * etc.) you may supply it here so that we may display the card type in the UI. * @return Returns the CardType */ @JsonGetter("card_type") @@ -360,8 +360,8 @@ public CardType getCardType() { /** * Setter for CardType. - * (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) - * you may supply it here so that we may display the card type in the UI. + * (Optional, used only for Subscription Import) If you know the card type (e.g., Visa, MC, + * etc.) you may supply it here so that we may display the card type in the UI. * @param cardType Value for CardType */ @JsonSetter("card_type") @@ -372,7 +372,7 @@ public void setCardType(CardType cardType) { /** * Getter for ExpirationMonth. * (Optional when performing a Subscription Import via vault_token, required otherwise) The 1- - * or 2-digit credit card expiration month, as an integer or string, i.e. 5 + * or 2-digit credit card expiration month, as an integer or string, e.g., 5 * @return Returns the PaymentProfileAttributesExpirationMonth */ @JsonGetter("expiration_month") @@ -384,7 +384,7 @@ public PaymentProfileAttributesExpirationMonth getExpirationMonth() { /** * Setter for ExpirationMonth. * (Optional when performing a Subscription Import via vault_token, required otherwise) The 1- - * or 2-digit credit card expiration month, as an integer or string, i.e. 5 + * or 2-digit credit card expiration month, as an integer or string, e.g., 5 * @param expirationMonth Value for PaymentProfileAttributesExpirationMonth */ @JsonSetter("expiration_month") @@ -395,7 +395,7 @@ public void setExpirationMonth(PaymentProfileAttributesExpirationMonth expiratio /** * Getter for ExpirationYear. * (Optional when performing a Subscription Import via vault_token, required otherwise) The - * 4-digit credit card expiration year, as an integer or string, i.e. 2012 + * 4-digit credit card expiration year, as an integer or string, e.g., 2012 * @return Returns the PaymentProfileAttributesExpirationYear */ @JsonGetter("expiration_year") @@ -407,7 +407,7 @@ public PaymentProfileAttributesExpirationYear getExpirationYear() { /** * Setter for ExpirationYear. * (Optional when performing a Subscription Import via vault_token, required otherwise) The - * 4-digit credit card expiration year, as an integer or string, i.e. 2012 + * 4-digit credit card expiration year, as an integer or string, e.g., 2012 * @param expirationYear Value for PaymentProfileAttributesExpirationYear */ @JsonSetter("expiration_year") @@ -418,7 +418,7 @@ public void setExpirationYear(PaymentProfileAttributesExpirationYear expirationY /** * Getter for BillingAddress. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing street address (i.e. 123 Main St.). This value is merely passed + * or bank account billing street address (e.g., 123 Main St.). This value is merely passed * through to the payment gateway. * @return Returns the String */ @@ -431,7 +431,7 @@ public String getBillingAddress() { /** * Setter for BillingAddress. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing street address (i.e. 123 Main St.). This value is merely passed + * or bank account billing street address (e.g., 123 Main St.). This value is merely passed * through to the payment gateway. * @param billingAddress Value for String */ @@ -442,7 +442,7 @@ public void setBillingAddress(String billingAddress) { /** * Internal Getter for BillingAddress2. - * (Optional) Second line of the customer’s billing address i.e. Apt. 100 + * (Optional) Second line of the customer’s billing address, e.g., Apt. 100 * @return Returns the Internal String */ @JsonGetter("billing_address_2") @@ -454,7 +454,7 @@ protected OptionalNullable internalGetBillingAddress2() { /** * Getter for BillingAddress2. - * (Optional) Second line of the customer’s billing address i.e. Apt. 100 + * (Optional) Second line of the customer’s billing address, e.g., Apt. 100 * @return Returns the String */ public String getBillingAddress2() { @@ -463,7 +463,7 @@ public String getBillingAddress2() { /** * Setter for BillingAddress2. - * (Optional) Second line of the customer’s billing address i.e. Apt. 100 + * (Optional) Second line of the customer’s billing address, e.g., Apt. 100 * @param billingAddress2 Value for String */ @JsonSetter("billing_address_2") @@ -473,7 +473,7 @@ public void setBillingAddress2(String billingAddress2) { /** * UnSetter for BillingAddress2. - * (Optional) Second line of the customer’s billing address i.e. Apt. 100 + * (Optional) Second line of the customer’s billing address, e.g., Apt. 100 */ public void unsetBillingAddress2() { billingAddress2 = null; @@ -482,7 +482,7 @@ public void unsetBillingAddress2() { /** * Getter for BillingCity. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing address city (i.e. “Boston”). This value is merely passed through to + * or bank account billing address city (e.g., “Boston”). This value is merely passed through to * the payment gateway. * @return Returns the String */ @@ -495,7 +495,7 @@ public String getBillingCity() { /** * Setter for BillingCity. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing address city (i.e. “Boston”). This value is merely passed through to + * or bank account billing address city (e.g., “Boston”). This value is merely passed through to * the payment gateway. * @param billingCity Value for String */ @@ -507,7 +507,7 @@ public void setBillingCity(String billingCity) { /** * Getter for BillingState. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing address state (i.e. MA). This value is merely passed through to the + * or bank account billing address state (e.g., MA). This value is merely passed through to the * payment gateway. This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for * tax locale purposes. @@ -522,7 +522,7 @@ public String getBillingState() { /** * Setter for BillingState. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing address state (i.e. MA). This value is merely passed through to the + * or bank account billing address state (e.g., MA). This value is merely passed through to the * payment gateway. This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for * tax locale purposes. @@ -537,7 +537,7 @@ public void setBillingState(String billingState) { * Getter for BillingCountry. * (Optional, may be required by your product configuration or gateway settings) The credit card * or bank account billing address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is * merely passed through to the payment gateway. Some gateways require country codes in a * specific format. Check your gateway’s documentation. If creating an ACH subscription, only US * is supported at this time. @@ -553,7 +553,7 @@ public String getBillingCountry() { * Setter for BillingCountry. * (Optional, may be required by your product configuration or gateway settings) The credit card * or bank account billing address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is * merely passed through to the payment gateway. Some gateways require country codes in a * specific format. Check your gateway’s documentation. If creating an ACH subscription, only US * is supported at this time. @@ -567,8 +567,8 @@ public void setBillingCountry(String billingCountry) { /** * Getter for BillingZip. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing address zip code (i.e. 12345). This value is merely passed through to - * the payment gateway. + * or bank account billing address zip code (e.g., 12345). This value is merely passed through + * to the payment gateway. * @return Returns the String */ @JsonGetter("billing_zip") @@ -580,8 +580,8 @@ public String getBillingZip() { /** * Setter for BillingZip. * (Optional, may be required by your product configuration or gateway settings) The credit card - * or bank account billing address zip code (i.e. 12345). This value is merely passed through to - * the payment gateway. + * or bank account billing address zip code (e.g., 12345). This value is merely passed through + * to the payment gateway. * @param billingZip Value for String */ @JsonSetter("billing_zip") @@ -780,7 +780,7 @@ public void setCvv(String cvv) { /** * Getter for LastFour. * (Optional, used only for Subscription Import) If you have the last 4 digits of the credit - * card number, you may supply them here so that we may create a masked card number (i.e. + * card number, you may supply them here so that we may create a masked card number (e.g., * XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in * Auth.Net. * @return Returns the String @@ -794,7 +794,7 @@ public String getLastFour() { /** * Setter for LastFour. * (Optional, used only for Subscription Import) If you have the last 4 digits of the credit - * card number, you may supply them here so that we may create a masked card number (i.e. + * card number, you may supply them here so that we may create a masked card number (e.g., * XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in * Auth.Net. * @param lastFour Value for String diff --git a/src/main/java/com/maxio/advancedbilling/models/PaymentType.java b/src/main/java/com/maxio/advancedbilling/models/PaymentType.java index 4c7ffa63..de170429 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PaymentType.java +++ b/src/main/java/com/maxio/advancedbilling/models/PaymentType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * PaymentType to be used. */ @@ -25,7 +24,6 @@ public enum PaymentType { APPLE_PAY; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/PrepaidUsage.java b/src/main/java/com/maxio/advancedbilling/models/PrepaidUsage.java index a68bf69f..01055289 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PrepaidUsage.java +++ b/src/main/java/com/maxio/advancedbilling/models/PrepaidUsage.java @@ -10,6 +10,8 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.maxio.advancedbilling.models.containers.PrepaidUsageNewOverageUnitBalance; +import com.maxio.advancedbilling.models.containers.PrepaidUsageNewUnitBalance; import io.apimatic.core.types.BaseModel; import java.util.List; @@ -20,8 +22,8 @@ public class PrepaidUsage extends BaseModel { private String previousUnitBalance; private String previousOverageUnitBalance; - private int newUnitBalance; - private int newOverageUnitBalance; + private PrepaidUsageNewUnitBalance newUnitBalance; + private PrepaidUsageNewOverageUnitBalance newOverageUnitBalance; private int usageQuantity; private int overageUsageQuantity; private int componentId; @@ -39,8 +41,9 @@ public PrepaidUsage() { * Initialization constructor. * @param previousUnitBalance String value for previousUnitBalance. * @param previousOverageUnitBalance String value for previousOverageUnitBalance. - * @param newUnitBalance int value for newUnitBalance. - * @param newOverageUnitBalance int value for newOverageUnitBalance. + * @param newUnitBalance PrepaidUsageNewUnitBalance value for newUnitBalance. + * @param newOverageUnitBalance PrepaidUsageNewOverageUnitBalance value for + * newOverageUnitBalance. * @param usageQuantity int value for usageQuantity. * @param overageUsageQuantity int value for overageUsageQuantity. * @param componentId int value for componentId. @@ -52,8 +55,8 @@ public PrepaidUsage() { public PrepaidUsage( @JsonProperty("previous_unit_balance") String previousUnitBalance, @JsonProperty("previous_overage_unit_balance") String previousOverageUnitBalance, - @JsonProperty("new_unit_balance") int newUnitBalance, - @JsonProperty("new_overage_unit_balance") int newOverageUnitBalance, + @JsonProperty("new_unit_balance") PrepaidUsageNewUnitBalance newUnitBalance, + @JsonProperty("new_overage_unit_balance") PrepaidUsageNewOverageUnitBalance newOverageUnitBalance, @JsonProperty("usage_quantity") int usageQuantity, @JsonProperty("overage_usage_quantity") int overageUsageQuantity, @JsonProperty("component_id") int componentId, @@ -110,37 +113,37 @@ public void setPreviousOverageUnitBalance(String previousOverageUnitBalance) { /** * Getter for NewUnitBalance. - * @return Returns the int + * @return Returns the PrepaidUsageNewUnitBalance */ @JsonGetter("new_unit_balance") - public int getNewUnitBalance() { + public PrepaidUsageNewUnitBalance getNewUnitBalance() { return newUnitBalance; } /** * Setter for NewUnitBalance. - * @param newUnitBalance Value for int + * @param newUnitBalance Value for PrepaidUsageNewUnitBalance */ @JsonSetter("new_unit_balance") - public void setNewUnitBalance(int newUnitBalance) { + public void setNewUnitBalance(PrepaidUsageNewUnitBalance newUnitBalance) { this.newUnitBalance = newUnitBalance; } /** * Getter for NewOverageUnitBalance. - * @return Returns the int + * @return Returns the PrepaidUsageNewOverageUnitBalance */ @JsonGetter("new_overage_unit_balance") - public int getNewOverageUnitBalance() { + public PrepaidUsageNewOverageUnitBalance getNewOverageUnitBalance() { return newOverageUnitBalance; } /** * Setter for NewOverageUnitBalance. - * @param newOverageUnitBalance Value for int + * @param newOverageUnitBalance Value for PrepaidUsageNewOverageUnitBalance */ @JsonSetter("new_overage_unit_balance") - public void setNewOverageUnitBalance(int newOverageUnitBalance) { + public void setNewOverageUnitBalance(PrepaidUsageNewOverageUnitBalance newOverageUnitBalance) { this.newOverageUnitBalance = newOverageUnitBalance; } @@ -285,8 +288,8 @@ public Builder toBuilder() { public static class Builder { private String previousUnitBalance; private String previousOverageUnitBalance; - private int newUnitBalance; - private int newOverageUnitBalance; + private PrepaidUsageNewUnitBalance newUnitBalance; + private PrepaidUsageNewOverageUnitBalance newOverageUnitBalance; private int usageQuantity; private int overageUsageQuantity; private int componentId; @@ -304,8 +307,9 @@ public Builder() { * Initialization constructor. * @param previousUnitBalance String value for previousUnitBalance. * @param previousOverageUnitBalance String value for previousOverageUnitBalance. - * @param newUnitBalance int value for newUnitBalance. - * @param newOverageUnitBalance int value for newOverageUnitBalance. + * @param newUnitBalance PrepaidUsageNewUnitBalance value for newUnitBalance. + * @param newOverageUnitBalance PrepaidUsageNewOverageUnitBalance value for + * newOverageUnitBalance. * @param usageQuantity int value for usageQuantity. * @param overageUsageQuantity int value for overageUsageQuantity. * @param componentId int value for componentId. @@ -315,7 +319,8 @@ public Builder() { * allocationDetails. */ public Builder(String previousUnitBalance, String previousOverageUnitBalance, - int newUnitBalance, int newOverageUnitBalance, int usageQuantity, + PrepaidUsageNewUnitBalance newUnitBalance, + PrepaidUsageNewOverageUnitBalance newOverageUnitBalance, int usageQuantity, int overageUsageQuantity, int componentId, String componentHandle, String memo, List allocationDetails) { this.previousUnitBalance = previousUnitBalance; @@ -352,20 +357,22 @@ public Builder previousOverageUnitBalance(String previousOverageUnitBalance) { /** * Setter for newUnitBalance. - * @param newUnitBalance int value for newUnitBalance. + * @param newUnitBalance PrepaidUsageNewUnitBalance value for newUnitBalance. * @return Builder */ - public Builder newUnitBalance(int newUnitBalance) { + public Builder newUnitBalance(PrepaidUsageNewUnitBalance newUnitBalance) { this.newUnitBalance = newUnitBalance; return this; } /** * Setter for newOverageUnitBalance. - * @param newOverageUnitBalance int value for newOverageUnitBalance. + * @param newOverageUnitBalance PrepaidUsageNewOverageUnitBalance value for + * newOverageUnitBalance. * @return Builder */ - public Builder newOverageUnitBalance(int newOverageUnitBalance) { + public Builder newOverageUnitBalance( + PrepaidUsageNewOverageUnitBalance newOverageUnitBalance) { this.newOverageUnitBalance = newOverageUnitBalance; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java b/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java index f485a76d..df29d742 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java @@ -41,6 +41,7 @@ public class PrepaidUsageComponent private Boolean displayOnHostedPage; private Boolean allowFractionalQuantities; private List publicSignupPageIds; + private OptionalNullable unspscCode; /** * Default constructor. @@ -71,6 +72,7 @@ public PrepaidUsageComponent() { * @param displayOnHostedPage Boolean value for displayOnHostedPage. * @param allowFractionalQuantities Boolean value for allowFractionalQuantities. * @param publicSignupPageIds List of Integer value for publicSignupPageIds. + * @param unspscCode String value for unspscCode. */ public PrepaidUsageComponent( String name, @@ -93,7 +95,8 @@ public PrepaidUsageComponent( ExpirationIntervalUnit expirationIntervalUnit, Boolean displayOnHostedPage, Boolean allowFractionalQuantities, - List publicSignupPageIds) { + List publicSignupPageIds, + String unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -115,6 +118,7 @@ public PrepaidUsageComponent( this.displayOnHostedPage = displayOnHostedPage; this.allowFractionalQuantities = allowFractionalQuantities; this.publicSignupPageIds = publicSignupPageIds; + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -140,6 +144,7 @@ public PrepaidUsageComponent( * @param displayOnHostedPage Boolean value for displayOnHostedPage. * @param allowFractionalQuantities Boolean value for allowFractionalQuantities. * @param publicSignupPageIds List of Integer value for publicSignupPageIds. + * @param unspscCode String value for unspscCode. */ protected PrepaidUsageComponent(String name, String unitName, PricingScheme pricingScheme, @@ -152,7 +157,7 @@ protected PrepaidUsageComponent(String name, String unitName, PricingScheme pric Boolean renewPrepaidAllocation, Double expirationInterval, OptionalNullable expirationIntervalUnit, Boolean displayOnHostedPage, Boolean allowFractionalQuantities, - List publicSignupPageIds) { + List publicSignupPageIds, OptionalNullable unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -174,12 +179,13 @@ protected PrepaidUsageComponent(String name, String unitName, PricingScheme pric this.displayOnHostedPage = displayOnHostedPage; this.allowFractionalQuantities = allowFractionalQuantities; this.publicSignupPageIds = publicSignupPageIds; + this.unspscCode = unspscCode; } /** * Getter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @return Returns the String */ @JsonGetter("name") @@ -190,7 +196,7 @@ public String getName() { /** * Setter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @param name Value for String */ @JsonSetter("name") @@ -201,7 +207,7 @@ public void setName(String name) { /** * Getter for UnitName. * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 + * automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 * messages” on a subscription’s component line-item * @return Returns the String */ @@ -213,7 +219,7 @@ public String getUnitName() { /** * Setter for UnitName. * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 + * automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 * messages” on a subscription’s component line-item * @param unitName Value for String */ @@ -245,7 +251,7 @@ public void setDescription(String description) { /** * Getter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @return Returns the String @@ -258,7 +264,7 @@ public String getHandle() { /** * Setter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @param handle Value for String @@ -447,8 +453,8 @@ public void setPricePoints(List pricePoin * Getter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For * On/Off Components, this is the amount that the customer will be charged when they turn the - * component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or - * 0.0012 or 0.00000065 + * component on for the subscription. The price can contain up to 8 decimal places. e.g., 1.00 + * or 0.0012 or 0.00000065 * @return Returns the PrepaidUsageComponentUnitPrice */ @JsonGetter("unit_price") @@ -461,8 +467,8 @@ public PrepaidUsageComponentUnitPrice getUnitPrice() { * Setter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For * On/Off Components, this is the amount that the customer will be charged when they turn the - * component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or - * 0.0012 or 0.00000065 + * component on for the subscription. The price can contain up to 8 decimal places. e.g., 1.00 + * or 0.0012 or 0.00000065 * @param unitPrice Value for PrepaidUsageComponentUnitPrice */ @JsonSetter("unit_price") @@ -539,7 +545,7 @@ public void setOveragePricing(OveragePricing overagePricing) { /** * Getter for RolloverPrepaidRemainder. * Boolean which controls whether or not remaining units should be rolled over to the next - * period + * period. * @return Returns the Boolean */ @JsonGetter("rollover_prepaid_remainder") @@ -551,7 +557,7 @@ public Boolean getRolloverPrepaidRemainder() { /** * Setter for RolloverPrepaidRemainder. * Boolean which controls whether or not remaining units should be rolled over to the next - * period + * period. * @param rolloverPrepaidRemainder Value for Boolean */ @JsonSetter("rollover_prepaid_remainder") @@ -562,7 +568,7 @@ public void setRolloverPrepaidRemainder(Boolean rolloverPrepaidRemainder) { /** * Getter for RenewPrepaidAllocation. * Boolean which controls whether or not the allocated quantity should be renewed at the - * beginning of each period + * beginning of each period. * @return Returns the Boolean */ @JsonGetter("renew_prepaid_allocation") @@ -574,7 +580,7 @@ public Boolean getRenewPrepaidAllocation() { /** * Setter for RenewPrepaidAllocation. * Boolean which controls whether or not the allocated quantity should be renewed at the - * beginning of each period + * beginning of each period. * @param renewPrepaidAllocation Value for Boolean */ @JsonSetter("renew_prepaid_allocation") @@ -697,6 +703,53 @@ public void setPublicSignupPageIds(List publicSignupPageIds) { this.publicSignupPageIds = publicSignupPageIds; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this PrepaidUsageComponent into string format. * @return String representation of this class @@ -714,7 +767,8 @@ public String toString() { + expirationInterval + ", expirationIntervalUnit=" + expirationIntervalUnit + ", displayOnHostedPage=" + displayOnHostedPage + ", allowFractionalQuantities=" + allowFractionalQuantities + ", publicSignupPageIds=" + publicSignupPageIds - + ", additionalProperties=" + getAdditionalProperties() + "]"; + + ", unspscCode=" + unspscCode + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -741,6 +795,7 @@ public Builder toBuilder() { builder.upgradeCharge = internalGetUpgradeCharge(); builder.downgradeCredit = internalGetDowngradeCredit(); builder.expirationIntervalUnit = internalGetExpirationIntervalUnit(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -769,6 +824,7 @@ public static class Builder { private Boolean displayOnHostedPage; private Boolean allowFractionalQuantities; private List publicSignupPageIds; + private OptionalNullable unspscCode; /** * Initialization constructor. @@ -1028,6 +1084,25 @@ public Builder publicSignupPageIds(List publicSignupPageIds) { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link PrepaidUsageComponent} object using the set fields. * @return {@link PrepaidUsageComponent} @@ -1038,7 +1113,7 @@ public PrepaidUsageComponent build() { pricePoints, unitPrice, taxCode, hideDateRangeOnInvoice, rolloverPrepaidRemainder, renewPrepaidAllocation, expirationInterval, expirationIntervalUnit, displayOnHostedPage, allowFractionalQuantities, - publicSignupPageIds); + publicSignupPageIds, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java b/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java index 4d20d5a9..7f3d8d4a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java +++ b/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * PrepaymentMethod to be used. */ @@ -31,7 +30,6 @@ public enum PrepaymentMethod { OTHER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Price.java b/src/main/java/com/maxio/advancedbilling/models/Price.java index 27561fbe..157bc08f 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Price.java +++ b/src/main/java/com/maxio/advancedbilling/models/Price.java @@ -115,7 +115,7 @@ public void unsetEndingQuantity() { /** * Getter for UnitPrice. - * The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 * @return Returns the PriceUnitPrice */ @JsonGetter("unit_price") @@ -125,7 +125,7 @@ public PriceUnitPrice getUnitPrice() { /** * Setter for UnitPrice. - * The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 * @param unitPrice Value for PriceUnitPrice */ @JsonSetter("unit_price") diff --git a/src/main/java/com/maxio/advancedbilling/models/PricePointType.java b/src/main/java/com/maxio/advancedbilling/models/PricePointType.java index c7c0d3f5..5741c0bf 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PricePointType.java +++ b/src/main/java/com/maxio/advancedbilling/models/PricePointType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * PricePointType to be used. */ @@ -23,7 +22,6 @@ public enum PricePointType { CUSTOM; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/PricingScheme.java b/src/main/java/com/maxio/advancedbilling/models/PricingScheme.java index 3f2cf806..0c4479c9 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PricingScheme.java +++ b/src/main/java/com/maxio/advancedbilling/models/PricingScheme.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * PricingScheme to be used. */ @@ -25,7 +24,6 @@ public enum PricingScheme { TIERED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Product.java b/src/main/java/com/maxio/advancedbilling/models/Product.java index 6d1cafdf..da848b33 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Product.java +++ b/src/main/java/com/maxio/advancedbilling/models/Product.java @@ -59,6 +59,7 @@ public class Product private OptionalNullable itemCategory; private Integer productPricePointId; private OptionalNullable productPricePointHandle; + private OptionalNullable unspscCode; /** * Default constructor. @@ -105,6 +106,7 @@ public Product() { * @param itemCategory String value for itemCategory. * @param productPricePointId Integer value for productPricePointId. * @param productPricePointHandle String value for productPricePointHandle. + * @param unspscCode String value for unspscCode. */ public Product( Integer id, @@ -143,7 +145,8 @@ public Product( Boolean useSiteExchangeRate, String itemCategory, Integer productPricePointId, - String productPricePointHandle) { + String productPricePointHandle, + String unspscCode) { this.id = id; this.name = name; this.handle = OptionalNullable.of(handle); @@ -181,6 +184,7 @@ public Product( this.itemCategory = OptionalNullable.of(itemCategory); this.productPricePointId = productPricePointId; this.productPricePointHandle = OptionalNullable.of(productPricePointHandle); + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -222,6 +226,7 @@ public Product( * @param itemCategory String value for itemCategory. * @param productPricePointId Integer value for productPricePointId. * @param productPricePointHandle String value for productPricePointHandle. + * @param unspscCode String value for unspscCode. */ protected Product(Integer id, String name, OptionalNullable handle, @@ -242,7 +247,8 @@ protected Product(Integer id, String name, OptionalNullable handle, Boolean requireShippingAddress, OptionalNullable taxCode, Integer defaultProductPricePointId, OptionalNullable useSiteExchangeRate, OptionalNullable itemCategory, Integer productPricePointId, - OptionalNullable productPricePointHandle) { + OptionalNullable productPricePointHandle, + OptionalNullable unspscCode) { this.id = id; this.name = name; this.handle = handle; @@ -280,6 +286,7 @@ protected Product(Integer id, String name, OptionalNullable handle, this.itemCategory = itemCategory; this.productPricePointId = productPricePointId; this.productPricePointHandle = productPricePointHandle; + this.unspscCode = unspscCode; } /** @@ -402,7 +409,7 @@ public void unsetDescription() { /** * Internal Getter for AccountingCode. - * E.g. Internal ID or SKU Number + * E.g., Internal ID or SKU Number * @return Returns the Internal String */ @JsonGetter("accounting_code") @@ -414,7 +421,7 @@ protected OptionalNullable internalGetAccountingCode() { /** * Getter for AccountingCode. - * E.g. Internal ID or SKU Number + * E.g., Internal ID or SKU Number * @return Returns the String */ public String getAccountingCode() { @@ -423,7 +430,7 @@ public String getAccountingCode() { /** * Setter for AccountingCode. - * E.g. Internal ID or SKU Number + * E.g., Internal ID or SKU Number * @param accountingCode Value for String */ @JsonSetter("accounting_code") @@ -433,7 +440,7 @@ public void setAccountingCode(String accountingCode) { /** * UnSetter for AccountingCode. - * E.g. Internal ID or SKU Number + * E.g., Internal ID or SKU Number */ public void unsetAccountingCode() { accountingCode = null; @@ -466,7 +473,7 @@ public void setRequestCreditCard(Boolean requestCreditCard) { * Internal Getter for ExpirationInterval. * A numerical interval for the length a subscription to this product will run before it * expires. See the description of interval for a description of how this value is coupled with - * an interval unit to calculate the full interval + * an interval unit to calculate the full interval. * @return Returns the Internal Integer */ @JsonGetter("expiration_interval") @@ -480,7 +487,7 @@ protected OptionalNullable internalGetExpirationInterval() { * Getter for ExpirationInterval. * A numerical interval for the length a subscription to this product will run before it * expires. See the description of interval for a description of how this value is coupled with - * an interval unit to calculate the full interval + * an interval unit to calculate the full interval. * @return Returns the Integer */ public Integer getExpirationInterval() { @@ -491,7 +498,7 @@ public Integer getExpirationInterval() { * Setter for ExpirationInterval. * A numerical interval for the length a subscription to this product will run before it * expires. See the description of interval for a description of how this value is coupled with - * an interval unit to calculate the full interval + * an interval unit to calculate the full interval. * @param expirationInterval Value for Integer */ @JsonSetter("expiration_interval") @@ -503,7 +510,7 @@ public void setExpirationInterval(Integer expirationInterval) { * UnSetter for ExpirationInterval. * A numerical interval for the length a subscription to this product will run before it * expires. See the description of interval for a description of how this value is coupled with - * an interval unit to calculate the full interval + * an interval unit to calculate the full interval. */ public void unsetExpirationInterval() { expirationInterval = null; @@ -621,8 +628,8 @@ public void setPriceInCents(Long priceInCents) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product would renew every 30 days. * @return Returns the Integer */ @JsonGetter("interval") @@ -633,8 +640,8 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product would renew every 30 days. * @param interval Value for Integer */ @JsonSetter("interval") @@ -745,7 +752,7 @@ public void unsetTrialPriceInCents() { * Internal Getter for TrialInterval. * A numerical interval for the length of the trial period of a subscription to this product. * See the description of interval for a description of how this value is coupled with an - * interval unit to calculate the full interval + * interval unit to calculate the full interval. * @return Returns the Internal Integer */ @JsonGetter("trial_interval") @@ -759,7 +766,7 @@ protected OptionalNullable internalGetTrialInterval() { * Getter for TrialInterval. * A numerical interval for the length of the trial period of a subscription to this product. * See the description of interval for a description of how this value is coupled with an - * interval unit to calculate the full interval + * interval unit to calculate the full interval. * @return Returns the Integer */ public Integer getTrialInterval() { @@ -770,7 +777,7 @@ public Integer getTrialInterval() { * Setter for TrialInterval. * A numerical interval for the length of the trial period of a subscription to this product. * See the description of interval for a description of how this value is coupled with an - * interval unit to calculate the full interval + * interval unit to calculate the full interval. * @param trialInterval Value for Integer */ @JsonSetter("trial_interval") @@ -782,7 +789,7 @@ public void setTrialInterval(Integer trialInterval) { * UnSetter for TrialInterval. * A numerical interval for the length of the trial period of a subscription to this product. * See the description of interval for a description of how this value is coupled with an - * interval unit to calculate the full interval + * interval unit to calculate the full interval. */ public void unsetTrialInterval() { trialInterval = null; @@ -1042,7 +1049,7 @@ public void setVersionNumber(Integer versionNumber) { /** * Internal Getter for UpdateReturnParams. * The parameters will append to the url after a successful account update. See [help - * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) + * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). * @return Returns the Internal String */ @JsonGetter("update_return_params") @@ -1055,7 +1062,7 @@ protected OptionalNullable internalGetUpdateReturnParams() { /** * Getter for UpdateReturnParams. * The parameters will append to the url after a successful account update. See [help - * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) + * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). * @return Returns the String */ public String getUpdateReturnParams() { @@ -1065,7 +1072,7 @@ public String getUpdateReturnParams() { /** * Setter for UpdateReturnParams. * The parameters will append to the url after a successful account update. See [help - * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) + * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). * @param updateReturnParams Value for String */ @JsonSetter("update_return_params") @@ -1076,7 +1083,7 @@ public void setUpdateReturnParams(String updateReturnParams) { /** * UnSetter for UpdateReturnParams. * The parameters will append to the url after a successful account update. See [help - * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) + * documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). */ public void unsetUpdateReturnParams() { updateReturnParams = null; @@ -1402,6 +1409,53 @@ public void unsetProductPricePointHandle() { productPricePointHandle = null; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this product instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this Product into string format. * @return String representation of this class @@ -1427,8 +1481,8 @@ public String toString() { + ", defaultProductPricePointId=" + defaultProductPricePointId + ", useSiteExchangeRate=" + useSiteExchangeRate + ", itemCategory=" + itemCategory + ", productPricePointId=" + productPricePointId + ", productPricePointHandle=" - + productPricePointHandle + ", additionalProperties=" + getAdditionalProperties() - + "]"; + + productPricePointHandle + ", unspscCode=" + unspscCode + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -1475,6 +1529,7 @@ public Builder toBuilder() { builder.useSiteExchangeRate = internalGetUseSiteExchangeRate(); builder.itemCategory = internalGetItemCategory(); builder.productPricePointHandle = internalGetProductPricePointHandle(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -1519,6 +1574,7 @@ public static class Builder { private OptionalNullable itemCategory; private Integer productPricePointId; private OptionalNullable productPricePointHandle; + private OptionalNullable unspscCode; @@ -2054,6 +2110,25 @@ public Builder unsetProductPricePointHandle() { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link Product} object using the set fields. * @return {@link Product} @@ -2067,7 +2142,7 @@ public Product build() { productFamily, publicSignupPages, productPricePointName, requestBillingAddress, requireBillingAddress, requireShippingAddress, taxCode, defaultProductPricePointId, useSiteExchangeRate, itemCategory, - productPricePointId, productPricePointHandle); + productPricePointId, productPricePointHandle, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ProductFamily.java b/src/main/java/com/maxio/advancedbilling/models/ProductFamily.java index aef758f3..9f2a7416 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProductFamily.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProductFamily.java @@ -26,6 +26,7 @@ public class ProductFamily private String handle; private OptionalNullable accountingCode; private OptionalNullable description; + private Boolean surcharging; private ZonedDateTime createdAt; private ZonedDateTime updatedAt; private OptionalNullable archivedAt; @@ -43,6 +44,7 @@ public ProductFamily() { * @param handle String value for handle. * @param accountingCode String value for accountingCode. * @param description String value for description. + * @param surcharging Boolean value for surcharging. * @param createdAt ZonedDateTime value for createdAt. * @param updatedAt ZonedDateTime value for updatedAt. * @param archivedAt ZonedDateTime value for archivedAt. @@ -53,6 +55,7 @@ public ProductFamily( String handle, String accountingCode, String description, + Boolean surcharging, ZonedDateTime createdAt, ZonedDateTime updatedAt, ZonedDateTime archivedAt) { @@ -61,6 +64,7 @@ public ProductFamily( this.handle = handle; this.accountingCode = OptionalNullable.of(accountingCode); this.description = OptionalNullable.of(description); + this.surcharging = surcharging; this.createdAt = createdAt; this.updatedAt = updatedAt; this.archivedAt = OptionalNullable.of(archivedAt); @@ -73,6 +77,7 @@ public ProductFamily( * @param handle String value for handle. * @param accountingCode String value for accountingCode. * @param description String value for description. + * @param surcharging Boolean value for surcharging. * @param createdAt ZonedDateTime value for createdAt. * @param updatedAt ZonedDateTime value for updatedAt. * @param archivedAt ZonedDateTime value for archivedAt. @@ -80,13 +85,14 @@ public ProductFamily( protected ProductFamily(Integer id, String name, String handle, OptionalNullable accountingCode, OptionalNullable description, - ZonedDateTime createdAt, ZonedDateTime updatedAt, + Boolean surcharging, ZonedDateTime createdAt, ZonedDateTime updatedAt, OptionalNullable archivedAt) { this.id = id; this.name = name; this.handle = handle; this.accountingCode = accountingCode; this.description = description; + this.surcharging = surcharging; this.createdAt = createdAt; this.updatedAt = updatedAt; this.archivedAt = archivedAt; @@ -219,6 +225,29 @@ public void unsetDescription() { description = null; } + /** + * Getter for Surcharging. + * Whether surcharging applies to this product family. Only included on sites where surcharging + * is enabled. + * @return Returns the Boolean + */ + @JsonGetter("surcharging") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getSurcharging() { + return surcharging; + } + + /** + * Setter for Surcharging. + * Whether surcharging applies to this product family. Only included on sites where surcharging + * is enabled. + * @param surcharging Value for Boolean + */ + @JsonSetter("surcharging") + public void setSurcharging(Boolean surcharging) { + this.surcharging = surcharging; + } + /** * Getter for CreatedAt. * @return Returns the ZonedDateTime @@ -313,8 +342,9 @@ public void unsetArchivedAt() { public String toString() { return "ProductFamily [" + "id=" + id + ", name=" + name + ", handle=" + handle + ", accountingCode=" + accountingCode + ", description=" + description - + ", createdAt=" + createdAt + ", updatedAt=" + updatedAt + ", archivedAt=" - + archivedAt + ", additionalProperties=" + getAdditionalProperties() + "]"; + + ", surcharging=" + surcharging + ", createdAt=" + createdAt + ", updatedAt=" + + updatedAt + ", archivedAt=" + archivedAt + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -327,6 +357,7 @@ public Builder toBuilder() { .id(getId()) .name(getName()) .handle(getHandle()) + .surcharging(getSurcharging()) .createdAt(getCreatedAt()) .updatedAt(getUpdatedAt()); builder.accountingCode = internalGetAccountingCode(); @@ -344,6 +375,7 @@ public static class Builder { private String handle; private OptionalNullable accountingCode; private OptionalNullable description; + private Boolean surcharging; private ZonedDateTime createdAt; private ZonedDateTime updatedAt; private OptionalNullable archivedAt; @@ -418,6 +450,16 @@ public Builder unsetDescription() { return this; } + /** + * Setter for surcharging. + * @param surcharging Boolean value for surcharging. + * @return Builder + */ + public Builder surcharging(Boolean surcharging) { + this.surcharging = surcharging; + return this; + } + /** * Setter for createdAt. * @param createdAt ZonedDateTime value for createdAt. @@ -462,8 +504,8 @@ public Builder unsetArchivedAt() { * @return {@link ProductFamily} */ public ProductFamily build() { - return new ProductFamily(id, name, handle, accountingCode, description, createdAt, - updatedAt, archivedAt); + return new ProductFamily(id, name, handle, accountingCode, description, surcharging, + createdAt, updatedAt, archivedAt); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java index 1bcf7065..45ef3bf4 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java @@ -300,8 +300,8 @@ public void setPriceInCents(Long priceInCents) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product price point would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product price point would renew every 30 days. * @return Returns the Integer */ @JsonGetter("interval") @@ -312,8 +312,8 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this product price point would renew every 30 days + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this product price point would renew every 30 days. * @param interval Value for Integer */ @JsonSetter("interval") @@ -383,8 +383,8 @@ public void unsetTrialPriceInCents() { /** * Internal Getter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of - * day would mean this product price point trial would last 30 days + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days. * @return Returns the Internal Integer */ @JsonGetter("trial_interval") @@ -396,8 +396,8 @@ protected OptionalNullable internalGetTrialInterval() { /** * Getter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of - * day would mean this product price point trial would last 30 days + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days. * @return Returns the Integer */ public Integer getTrialInterval() { @@ -406,8 +406,8 @@ public Integer getTrialInterval() { /** * Setter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of - * day would mean this product price point trial would last 30 days + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days. * @param trialInterval Value for Integer */ @JsonSetter("trial_interval") @@ -417,8 +417,8 @@ public void setTrialInterval(Integer trialInterval) { /** * UnSetter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of - * day would mean this product price point trial would last 30 days + * The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days. */ public void unsetTrialInterval() { trialInterval = null; @@ -469,7 +469,7 @@ public void unsetTrialIntervalUnit() { /** * Internal Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -485,7 +485,7 @@ protected OptionalNullable internalGetTrialType() { /** * Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -498,7 +498,7 @@ public TrialType getTrialType() { /** * Setter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -512,7 +512,7 @@ public void setTrialType(TrialType trialType) { /** * UnSetter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -637,9 +637,9 @@ public void unsetInitialChargeAfterTrial() { /** * Internal Getter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 - * days + * days. * @return Returns the Internal Integer */ @JsonGetter("expiration_interval") @@ -651,9 +651,9 @@ protected OptionalNullable internalGetExpirationInterval() { /** * Getter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 - * days + * days. * @return Returns the Integer */ public Integer getExpirationInterval() { @@ -662,9 +662,9 @@ public Integer getExpirationInterval() { /** * Setter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 - * days + * days. * @param expirationInterval Value for Integer */ @JsonSetter("expiration_interval") @@ -674,9 +674,9 @@ public void setExpirationInterval(Integer expirationInterval) { /** * UnSetter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 - * days + * days. */ public void unsetExpirationInterval() { expirationInterval = null; diff --git a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java index efc4f886..272e0235 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java @@ -654,7 +654,7 @@ public void setProductFamilyName(String productFamilyName) { /** * Getter for Role. - * 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic + * 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. * @return Returns the ProformaInvoiceRole */ @JsonGetter("role") @@ -665,7 +665,7 @@ public ProformaInvoiceRole getRole() { /** * Setter for Role. - * 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic + * 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. * @param role Value for ProformaInvoiceRole */ @JsonSetter("role") @@ -696,7 +696,7 @@ public void setSeller(InvoiceSeller seller) { /** * Getter for Customer. - * Information about the customer who is owner or recipient the invoiced subscription. + * Information about the customer who is owner or recipient of the invoiced subscription. * @return Returns the InvoiceCustomer */ @JsonGetter("customer") @@ -707,7 +707,7 @@ public InvoiceCustomer getCustomer() { /** * Setter for Customer. - * Information about the customer who is owner or recipient the invoiced subscription. + * Information about the customer who is owner or recipient of the invoiced subscription. * @param customer Value for InvoiceCustomer */ @JsonSetter("customer") diff --git a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceDiscountSourceType.java b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceDiscountSourceType.java index 0bf4e07a..d43358cd 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceDiscountSourceType.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceDiscountSourceType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ProformaInvoiceDiscountSourceType to be used. */ @@ -21,7 +20,6 @@ public enum ProformaInvoiceDiscountSourceType { REFERRAL; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceRole.java b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceRole.java index b9f73606..4ce14b1c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceRole.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceRole.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ProformaInvoiceRole to be used. */ @@ -25,7 +24,6 @@ public enum ProformaInvoiceRole { PROFORMA_AUTOMATIC; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceStatus.java b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceStatus.java index 9764dae8..e4e08012 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceStatus.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceStatus.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ProformaInvoiceStatus to be used. */ @@ -23,7 +22,6 @@ public enum ProformaInvoiceStatus { ARCHIVED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceTaxSourceType.java b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceTaxSourceType.java index 61e1339e..7f044b35 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceTaxSourceType.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoiceTaxSourceType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ProformaInvoiceTaxSourceType to be used. */ @@ -21,7 +20,6 @@ public enum ProformaInvoiceTaxSourceType { AVALARA; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/PublicSignupPage.java b/src/main/java/com/maxio/advancedbilling/models/PublicSignupPage.java index 295a71ea..14097761 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PublicSignupPage.java +++ b/src/main/java/com/maxio/advancedbilling/models/PublicSignupPage.java @@ -87,7 +87,7 @@ public void setId(Integer id) { /** * Internal Getter for ReturnUrl. * The url to which a customer will be returned after a successful signup (public_signup_pages - * only) + * only). * @return Returns the Internal String */ @JsonGetter("return_url") @@ -100,7 +100,7 @@ protected OptionalNullable internalGetReturnUrl() { /** * Getter for ReturnUrl. * The url to which a customer will be returned after a successful signup (public_signup_pages - * only) + * only). * @return Returns the String */ public String getReturnUrl() { @@ -110,7 +110,7 @@ public String getReturnUrl() { /** * Setter for ReturnUrl. * The url to which a customer will be returned after a successful signup (public_signup_pages - * only) + * only). * @param returnUrl Value for String */ @JsonSetter("return_url") @@ -121,7 +121,7 @@ public void setReturnUrl(String returnUrl) { /** * UnSetter for ReturnUrl. * The url to which a customer will be returned after a successful signup (public_signup_pages - * only) + * only). */ public void unsetReturnUrl() { returnUrl = null; @@ -168,7 +168,7 @@ public void unsetReturnParams() { /** * Getter for Url. - * The url where the signup page can be viewed (public_signup_pages only) + * The url where the signup page can be viewed (public_signup_pages only). * @return Returns the String */ @JsonGetter("url") @@ -179,7 +179,7 @@ public String getUrl() { /** * Setter for Url. - * The url where the signup page can be viewed (public_signup_pages only) + * The url where the signup page can be viewed (public_signup_pages only). * @param url Value for String */ @JsonSetter("url") diff --git a/src/main/java/com/maxio/advancedbilling/models/QScope.java b/src/main/java/com/maxio/advancedbilling/models/QScope.java new file mode 100644 index 00000000..9818553e --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/QScope.java @@ -0,0 +1,106 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + +/** + * QScope to be used. + */ +public enum QScope { + FULL_NAME, + + FIRST_NAME, + + LAST_NAME, + + ORGANIZATION, + + CUSTOMER_REFERENCE, + + SUBSCRIPTION_REFERENCE; + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + FULL_NAME.value = "full_name"; + FIRST_NAME.value = "first_name"; + LAST_NAME.value = "last_name"; + ORGANIZATION.value = "organization"; + CUSTOMER_REFERENCE.value = "customer_reference"; + SUBSCRIPTION_REFERENCE.value = "subscription_reference"; + + valueMap.put("full_name", FULL_NAME); + valueMap.put("first_name", FIRST_NAME); + valueMap.put("last_name", LAST_NAME); + valueMap.put("organization", ORGANIZATION); + valueMap.put("customer_reference", CUSTOMER_REFERENCE); + valueMap.put("subscription_reference", SUBSCRIPTION_REFERENCE); + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + * @throws IOException when provided value is not mapped to any enum member. + */ + @JsonCreator + public static QScope constructFromString(String toConvert) throws IOException { + QScope enumValue = fromString(toConvert); + if (enumValue == null) { + throw new IOException("Unable to create enum instance with value: " + toConvert); + } + return enumValue; + } + + /** + * Returns the enum member associated with the given string value. + * @param toConvert String value to get enum member. + * @return The enum member against the given string value. + */ + public static QScope fromString(String toConvert) { + return valueMap.get(toConvert); + } + + /** + * Returns the string value associated with the enum member. + * @return The string value against enum member. + */ + @JsonValue + public String value() { + return value; + } + + /** + * Get string representation of this enum. + */ + @Override + public String toString() { + return value.toString(); + } + + /** + * Convert list of QScope values to list of string values. + * @param toConvert The list of QScope values to convert. + * @return List of representative string values. + */ + public static List toValue(List toConvert) { + if (toConvert == null) { + return null; + } + List convertedValues = new ArrayList<>(); + for (QScope enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java b/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java index f3405398..604d3e31 100644 --- a/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java @@ -39,6 +39,7 @@ public class QuantityBasedComponent private List publicSignupPageIds; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Default constructor. @@ -67,6 +68,7 @@ public QuantityBasedComponent() { * @param publicSignupPageIds List of Integer value for publicSignupPageIds. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ public QuantityBasedComponent( String name, @@ -87,7 +89,8 @@ public QuantityBasedComponent( Boolean allowFractionalQuantities, List publicSignupPageIds, Integer interval, - IntervalUnit intervalUnit) { + IntervalUnit intervalUnit, + String unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -107,6 +110,7 @@ public QuantityBasedComponent( this.publicSignupPageIds = publicSignupPageIds; this.interval = interval; this.intervalUnit = OptionalNullable.of(intervalUnit); + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -130,6 +134,7 @@ public QuantityBasedComponent( * @param publicSignupPageIds List of Integer value for publicSignupPageIds. * @param interval Integer value for interval. * @param intervalUnit IntervalUnit value for intervalUnit. + * @param unspscCode String value for unspscCode. */ protected QuantityBasedComponent(String name, String unitName, PricingScheme pricingScheme, @@ -139,7 +144,7 @@ protected QuantityBasedComponent(String name, String unitName, PricingScheme pri QuantityBasedComponentUnitPrice unitPrice, String taxCode, Boolean hideDateRangeOnInvoice, Boolean recurring, Boolean displayOnHostedPage, Boolean allowFractionalQuantities, List publicSignupPageIds, Integer interval, - OptionalNullable intervalUnit) { + OptionalNullable intervalUnit, OptionalNullable unspscCode) { this.name = name; this.unitName = unitName; this.description = description; @@ -159,12 +164,13 @@ protected QuantityBasedComponent(String name, String unitName, PricingScheme pri this.publicSignupPageIds = publicSignupPageIds; this.interval = interval; this.intervalUnit = intervalUnit; + this.unspscCode = unspscCode; } /** * Getter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @return Returns the String */ @JsonGetter("name") @@ -175,7 +181,7 @@ public String getName() { /** * Setter for Name. * A name for this component that is suitable for showing customers and displaying on billing - * statements, ie. "Minutes". + * statements, e.g., "Minutes". * @param name Value for String */ @JsonSetter("name") @@ -185,9 +191,9 @@ public void setName(String name) { /** * Getter for UnitName. - * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 - * messages” on a subscription’s component line-item + * “The name of the unit of measurement for the component. It should be singular since it will + * be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 + * messages” on a subscription’s component line-item.” * @return Returns the String */ @JsonGetter("unit_name") @@ -197,9 +203,9 @@ public String getUnitName() { /** * Setter for UnitName. - * The name of the unit of measurement for the component. It should be singular since it will be - * automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 - * messages” on a subscription’s component line-item + * “The name of the unit of measurement for the component. It should be singular since it will + * be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 + * messages” on a subscription’s component line-item.” * @param unitName Value for String */ @JsonSetter("unit_name") @@ -230,7 +236,7 @@ public void setDescription(String description) { /** * Getter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @return Returns the String @@ -243,7 +249,7 @@ public String getHandle() { /** * Setter for Handle. - * A unique identifier for your use that can be used to retrieve this component is subsequent + * A unique identifier for your use that can be used to retrieve this component in subsequent * requests. Must start with a letter or number and may only contain lowercase letters, numbers, * or the characters '.', ':', '-', or '_'. * @param handle Value for String @@ -432,8 +438,8 @@ public void setPricePoints(List pricePoints) { * Getter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For * On/Off Components, this is the amount that the customer will be charged when they turn the - * component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or - * 0.0012 or 0.00000065 + * component on for the subscription. The price can contain up to 8 decimal places. e.g., 1.00 + * or 0.0012 or 0.00000065 * @return Returns the QuantityBasedComponentUnitPrice */ @JsonGetter("unit_price") @@ -446,8 +452,8 @@ public QuantityBasedComponentUnitPrice getUnitPrice() { * Setter for UnitPrice. * The amount the customer will be charged per unit when the pricing scheme is “per_unit”. For * On/Off Components, this is the amount that the customer will be charged when they turn the - * component on for the subscription. The price can contain up to 8 decimal places. i.e. 1.00 or - * 0.0012 or 0.00000065 + * component on for the subscription. The price can contain up to 8 decimal places. e.g., 1.00 + * or 0.0012 or 0.00000065 * @param unitPrice Value for QuantityBasedComponentUnitPrice */ @JsonSetter("unit_price") @@ -581,8 +587,8 @@ public void setPublicSignupPageIds(List publicSignupPageIds) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this component's default price point would renew every 30 days. This property is only + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this component’s default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @return Returns the Integer */ @@ -594,8 +600,8 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would - * mean this component's default price point would renew every 30 days. This property is only + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would + * mean this component’s default price point would renew every 30 days. This property is only * available for sites with Multifrequency enabled. * @param interval Value for Integer */ @@ -647,6 +653,53 @@ public void unsetIntervalUnit() { intervalUnit = null; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this QuantityBasedComponent into string format. * @return String representation of this class @@ -661,8 +714,8 @@ public String toString() { + ", hideDateRangeOnInvoice=" + hideDateRangeOnInvoice + ", recurring=" + recurring + ", displayOnHostedPage=" + displayOnHostedPage + ", allowFractionalQuantities=" + allowFractionalQuantities + ", publicSignupPageIds=" + publicSignupPageIds - + ", interval=" + interval + ", intervalUnit=" + intervalUnit - + ", additionalProperties=" + getAdditionalProperties() + "]"; + + ", interval=" + interval + ", intervalUnit=" + intervalUnit + ", unspscCode=" + + unspscCode + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -688,6 +741,7 @@ public Builder toBuilder() { builder.upgradeCharge = internalGetUpgradeCharge(); builder.downgradeCredit = internalGetDowngradeCredit(); builder.intervalUnit = internalGetIntervalUnit(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -714,6 +768,7 @@ public static class Builder { private List publicSignupPageIds; private Integer interval; private OptionalNullable intervalUnit; + private OptionalNullable unspscCode; /** * Initialization constructor. @@ -950,6 +1005,25 @@ public Builder unsetIntervalUnit() { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link QuantityBasedComponent} object using the set fields. * @return {@link QuantityBasedComponent} @@ -958,7 +1032,8 @@ public QuantityBasedComponent build() { return new QuantityBasedComponent(name, unitName, pricingScheme, description, handle, taxable, prices, upgradeCharge, downgradeCredit, pricePoints, unitPrice, taxCode, hideDateRangeOnInvoice, recurring, displayOnHostedPage, - allowFractionalQuantities, publicSignupPageIds, interval, intervalUnit); + allowFractionalQuantities, publicSignupPageIds, interval, intervalUnit, + unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ReactivateSubscriptionRequest.java b/src/main/java/com/maxio/advancedbilling/models/ReactivateSubscriptionRequest.java index 679c7243..c40aee61 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ReactivateSubscriptionRequest.java +++ b/src/main/java/com/maxio/advancedbilling/models/ReactivateSubscriptionRequest.java @@ -56,7 +56,7 @@ public ReactivateSubscriptionRequest( /** * Getter for CalendarBilling. - * These values are only applicable to subscriptions using calendar billing + * These values are only applicable to subscriptions using calendar billing. * @return Returns the ReactivationBilling */ @JsonGetter("calendar_billing") @@ -67,7 +67,7 @@ public ReactivationBilling getCalendarBilling() { /** * Setter for CalendarBilling. - * These values are only applicable to subscriptions using calendar billing + * These values are only applicable to subscriptions using calendar billing. * @param calendarBilling Value for ReactivationBilling */ @JsonSetter("calendar_billing") diff --git a/src/main/java/com/maxio/advancedbilling/models/ReactivationBilling.java b/src/main/java/com/maxio/advancedbilling/models/ReactivationBilling.java index fe428d69..2c168d49 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ReactivationBilling.java +++ b/src/main/java/com/maxio/advancedbilling/models/ReactivationBilling.java @@ -37,9 +37,9 @@ public ReactivationBilling( /** * Getter for ReactivationCharge. * You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A - * prorated charge for the product price will be attempted for to complete the period 2) - * `immediate` A full-price charge for the product price will be attempted immediately 3) - * `delayed` A full-price charge for the product price will be attempted at the next renewal + * prorated charge for the product price will be attempted to complete the period 2) `immediate` + * A full-price charge for the product price will be attempted immediately 3) `delayed` A + * full-price charge for the product price will be attempted at the next renewal. * @return Returns the ReactivationCharge */ @JsonGetter("reactivation_charge") @@ -51,9 +51,9 @@ public ReactivationCharge getReactivationCharge() { /** * Setter for ReactivationCharge. * You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A - * prorated charge for the product price will be attempted for to complete the period 2) - * `immediate` A full-price charge for the product price will be attempted immediately 3) - * `delayed` A full-price charge for the product price will be attempted at the next renewal + * prorated charge for the product price will be attempted to complete the period 2) `immediate` + * A full-price charge for the product price will be attempted immediately 3) `delayed` A + * full-price charge for the product price will be attempted at the next renewal. * @param reactivationCharge Value for ReactivationCharge */ @JsonSetter("reactivation_charge") diff --git a/src/main/java/com/maxio/advancedbilling/models/ReactivationCharge.java b/src/main/java/com/maxio/advancedbilling/models/ReactivationCharge.java index 6349bc8d..cfcf8256 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ReactivationCharge.java +++ b/src/main/java/com/maxio/advancedbilling/models/ReactivationCharge.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ReactivationCharge to be used. */ @@ -23,7 +22,6 @@ public enum ReactivationCharge { DELAYED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java b/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java index 2025eb08..f73f6ab4 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java @@ -111,7 +111,7 @@ public void setPerPage(Integer perPage) { /** * Getter for SinceId. - * Returns events with an id greater than or equal to the one specified + * Returns events with an id greater than or equal to the one specified. * @return Returns the Long */ @JsonGetter("since_id") @@ -122,7 +122,7 @@ public Long getSinceId() { /** * Setter for SinceId. - * Returns events with an id greater than or equal to the one specified + * Returns events with an id greater than or equal to the one specified. * @param sinceId Value for Long */ @JsonSetter("since_id") @@ -132,7 +132,7 @@ public void setSinceId(Long sinceId) { /** * Getter for MaxId. - * Returns events with an id less than or equal to the one specified + * Returns events with an id less than or equal to the one specified. * @return Returns the Long */ @JsonGetter("max_id") @@ -143,7 +143,7 @@ public Long getMaxId() { /** * Setter for MaxId. - * Returns events with an id less than or equal to the one specified + * Returns events with an id less than or equal to the one specified. * @param maxId Value for Long */ @JsonSetter("max_id") diff --git a/src/main/java/com/maxio/advancedbilling/models/RecurringScheme.java b/src/main/java/com/maxio/advancedbilling/models/RecurringScheme.java index 20c8c4fc..9d8d9ce8 100644 --- a/src/main/java/com/maxio/advancedbilling/models/RecurringScheme.java +++ b/src/main/java/com/maxio/advancedbilling/models/RecurringScheme.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * RecurringScheme to be used. */ @@ -23,7 +22,6 @@ public enum RecurringScheme { RECUR_WITH_DURATION; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/RefundInvoice.java b/src/main/java/com/maxio/advancedbilling/models/RefundInvoice.java index d10dacc2..22dc9179 100644 --- a/src/main/java/com/maxio/advancedbilling/models/RefundInvoice.java +++ b/src/main/java/com/maxio/advancedbilling/models/RefundInvoice.java @@ -177,8 +177,8 @@ public void setApplyCredit(Boolean applyCredit) { /** * Getter for VoidInvoice. - * If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, - * invoice will be voided after refund. Defaults to `false`. + * If `apply_credit` is set to false and refunding full amount, if `void_invoice` is set to + * true, invoice will be voided after refund. Defaults to `false`. * @return Returns the Boolean */ @JsonGetter("void_invoice") @@ -189,8 +189,8 @@ public Boolean getVoidInvoice() { /** * Setter for VoidInvoice. - * If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, - * invoice will be voided after refund. Defaults to `false`. + * If `apply_credit` is set to false and refunding full amount, if `void_invoice` is set to + * true, invoice will be voided after refund. Defaults to `false`. * @param voidInvoice Value for Boolean */ @JsonSetter("void_invoice") diff --git a/src/main/java/com/maxio/advancedbilling/models/Register.java b/src/main/java/com/maxio/advancedbilling/models/Register.java index cfd7b1c3..f1e3e036 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Register.java +++ b/src/main/java/com/maxio/advancedbilling/models/Register.java @@ -104,7 +104,7 @@ public void setName(String name) { /** * Getter for CurrencyCode. - * The ISO 4217 currency code (3 character string) representing the currency of invoice + * The ISO 4217 currency code (3 character string) representing the currency of an invoice * transaction. * @return Returns the String */ @@ -116,7 +116,7 @@ public String getCurrencyCode() { /** * Setter for CurrencyCode. - * The ISO 4217 currency code (3 character string) representing the currency of invoice + * The ISO 4217 currency code (3 character string) representing the currency of an invoice * transaction. * @param currencyCode Value for String */ diff --git a/src/main/java/com/maxio/advancedbilling/models/RenewalPreviewRequest.java b/src/main/java/com/maxio/advancedbilling/models/RenewalPreviewRequest.java index 107aa98e..e2fd233a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/RenewalPreviewRequest.java +++ b/src/main/java/com/maxio/advancedbilling/models/RenewalPreviewRequest.java @@ -36,7 +36,7 @@ public RenewalPreviewRequest( /** * Getter for Components. - * An optional array of component definitions to preview. Providing any component definitions + * (Optional) Array of component definitions to preview. Providing any component definitions * here will override the actual components on the subscription (and their quantities), and the * billing preview will contain only these components (in addition to any product base fees). * @return Returns the List of RenewalPreviewComponent @@ -49,7 +49,7 @@ public List getComponents() { /** * Setter for Components. - * An optional array of component definitions to preview. Providing any component definitions + * (Optional) Array of component definitions to preview. Providing any component definitions * here will override the actual components on the subscription (and their quantities), and the * billing preview will contain only these components (in addition to any product base fees). * @param components Value for List of RenewalPreviewComponent diff --git a/src/main/java/com/maxio/advancedbilling/models/ResourceType.java b/src/main/java/com/maxio/advancedbilling/models/ResourceType.java index 67b05fdd..2779fb0b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ResourceType.java +++ b/src/main/java/com/maxio/advancedbilling/models/ResourceType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ResourceType to be used. */ @@ -21,7 +20,6 @@ public enum ResourceType { CUSTOMERS; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/RestrictionType.java b/src/main/java/com/maxio/advancedbilling/models/RestrictionType.java index 5b7bfdc7..f46fc87e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/RestrictionType.java +++ b/src/main/java/com/maxio/advancedbilling/models/RestrictionType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * RestrictionType to be used. */ @@ -21,7 +20,6 @@ public enum RestrictionType { PRODUCT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ResumptionCharge.java b/src/main/java/com/maxio/advancedbilling/models/ResumptionCharge.java index 31524f9c..fa1b2267 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ResumptionCharge.java +++ b/src/main/java/com/maxio/advancedbilling/models/ResumptionCharge.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ResumptionCharge to be used. */ @@ -23,7 +22,6 @@ public enum ResumptionCharge { DELAYED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalComponentCustomPrice.java b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalComponentCustomPrice.java index df97e6d1..6ac01e9c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalComponentCustomPrice.java +++ b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalComponentCustomPrice.java @@ -65,7 +65,7 @@ public void setTaxIncluded(Boolean taxIncluded) { /** * Getter for PricingScheme. - * Omit for On/Off components + * Omit for On/Off components. * @return Returns the PricingScheme */ @JsonGetter("pricing_scheme") @@ -75,7 +75,7 @@ public PricingScheme getPricingScheme() { /** * Setter for PricingScheme. - * Omit for On/Off components + * Omit for On/Off components. * @param pricingScheme Value for PricingScheme */ @JsonSetter("pricing_scheme") diff --git a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyComponent.java b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyComponent.java index 147e216f..d463934d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyComponent.java @@ -127,7 +127,7 @@ public void setPricePointId(Integer pricePointId) { /** * Getter for Quantity. - * Optional quantity for the item. + * (Optional) Quantity for the item. * @return Returns the Integer */ @JsonGetter("quantity") @@ -138,7 +138,7 @@ public Integer getQuantity() { /** * Setter for Quantity. - * Optional quantity for the item. + * (Optional) Quantity for the item. * @param quantity Value for Integer */ @JsonSetter("quantity") diff --git a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyProduct.java b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyProduct.java index 495666e9..802eb45a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyProduct.java +++ b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalItemRequestBodyProduct.java @@ -127,7 +127,7 @@ public void setPricePointId(Integer pricePointId) { /** * Getter for Quantity. - * Optional quantity for the item. + * (Optional) Quantity for the item. * @return Returns the Integer */ @JsonGetter("quantity") @@ -138,7 +138,7 @@ public Integer getQuantity() { /** * Setter for Quantity. - * Optional quantity for the item. + * (Optional) Quantity for the item. * @param quantity Value for Integer */ @JsonSetter("quantity") diff --git a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalProductPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalProductPricePoint.java index f42a3c43..3fb38005 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalProductPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/ScheduledRenewalProductPricePoint.java @@ -245,7 +245,7 @@ public void setInitialChargeInCents(Long initialChargeInCents) { /** * Getter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 * days. * @return Returns the Integer @@ -258,7 +258,7 @@ public Integer getExpirationInterval() { /** * Setter for ExpirationInterval. - * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an * expiration_interval_unit of day would mean this product price point would expire after 30 * days. * @param expirationInterval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/ServiceCredit1.java b/src/main/java/com/maxio/advancedbilling/models/ServiceCredit1.java index b6d7db41..d6beaa7c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ServiceCredit1.java +++ b/src/main/java/com/maxio/advancedbilling/models/ServiceCredit1.java @@ -196,7 +196,7 @@ public void setMemo(String memo) { /** * Internal Getter for InvoiceUid. - * The invoice uid associated with the entry. Only present for debit entries + * The invoice uid associated with the entry. Only present for debit entries. * @return Returns the Internal String */ @JsonGetter("invoice_uid") @@ -208,7 +208,7 @@ protected OptionalNullable internalGetInvoiceUid() { /** * Getter for InvoiceUid. - * The invoice uid associated with the entry. Only present for debit entries + * The invoice uid associated with the entry. Only present for debit entries. * @return Returns the String */ public String getInvoiceUid() { @@ -217,7 +217,7 @@ public String getInvoiceUid() { /** * Setter for InvoiceUid. - * The invoice uid associated with the entry. Only present for debit entries + * The invoice uid associated with the entry. Only present for debit entries. * @param invoiceUid Value for String */ @JsonSetter("invoice_uid") @@ -227,7 +227,7 @@ public void setInvoiceUid(String invoiceUid) { /** * UnSetter for InvoiceUid. - * The invoice uid associated with the entry. Only present for debit entries + * The invoice uid associated with the entry. Only present for debit entries. */ public void unsetInvoiceUid() { invoiceUid = null; diff --git a/src/main/java/com/maxio/advancedbilling/models/ServiceCreditType.java b/src/main/java/com/maxio/advancedbilling/models/ServiceCreditType.java index 6f174402..620a3d93 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ServiceCreditType.java +++ b/src/main/java/com/maxio/advancedbilling/models/ServiceCreditType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * ServiceCreditType to be used. */ @@ -21,7 +20,6 @@ public enum ServiceCreditType { DEBIT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SortingDirection.java b/src/main/java/com/maxio/advancedbilling/models/SortingDirection.java index e3f4c997..deb5ad41 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SortingDirection.java +++ b/src/main/java/com/maxio/advancedbilling/models/SortingDirection.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SortingDirection to be used. */ @@ -21,7 +20,6 @@ public enum SortingDirection { DESC; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Status.java b/src/main/java/com/maxio/advancedbilling/models/Status.java index 4470021a..b878c229 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Status.java +++ b/src/main/java/com/maxio/advancedbilling/models/Status.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * Status to be used. */ @@ -29,7 +28,6 @@ public enum Status { FULFILLED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Subscription.java b/src/main/java/com/maxio/advancedbilling/models/Subscription.java index 33c4aac3..060f1549 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Subscription.java +++ b/src/main/java/com/maxio/advancedbilling/models/Subscription.java @@ -629,9 +629,9 @@ public void setTotalRevenueInCents(Long totalRevenueInCents) { /** * Getter for ProductPriceInCents. - * (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. - * NOTE: this may differ from the current price of,the product, if you’ve changed the price of - * the product but haven’t,moved this subscription to a newer version. + * (Added Nov 5 2013) The recurring amount of the product (and version), currently subscribed. + * NOTE: this may differ from the current price of the product, if you’ve changed the price of + * the product but haven’t moved this subscription to a newer version. * @return Returns the Long */ @JsonGetter("product_price_in_cents") @@ -642,9 +642,9 @@ public Long getProductPriceInCents() { /** * Setter for ProductPriceInCents. - * (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. - * NOTE: this may differ from the current price of,the product, if you’ve changed the price of - * the product but haven’t,moved this subscription to a newer version. + * (Added Nov 5 2013) The recurring amount of the product (and version), currently subscribed. + * NOTE: this may differ from the current price of the product, if you’ve changed the price of + * the product but haven’t moved this subscription to a newer version. * @param productPriceInCents Value for Long */ @JsonSetter("product_price_in_cents") @@ -677,8 +677,8 @@ public void setProductVersionNumber(Integer productVersionNumber) { /** * Internal Getter for CurrentPeriodEndsAt. - * Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly - * scheduled attempted charge will occur) + * Timestamp relating to the end of the current (recurring) period (i.e., when the next + * regularly scheduled attempted charge will occur) * @return Returns the Internal ZonedDateTime */ @JsonGetter("current_period_ends_at") @@ -690,8 +690,8 @@ protected OptionalNullable internalGetCurrentPeriodEndsAt() { /** * Getter for CurrentPeriodEndsAt. - * Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly - * scheduled attempted charge will occur) + * Timestamp relating to the end of the current (recurring) period (i.e., when the next + * regularly scheduled attempted charge will occur) * @return Returns the ZonedDateTime */ public ZonedDateTime getCurrentPeriodEndsAt() { @@ -700,8 +700,8 @@ public ZonedDateTime getCurrentPeriodEndsAt() { /** * Setter for CurrentPeriodEndsAt. - * Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly - * scheduled attempted charge will occur) + * Timestamp relating to the end of the current (recurring) period (i.e., when the next + * regularly scheduled attempted charge will occur) * @param currentPeriodEndsAt Value for ZonedDateTime */ @JsonSetter("current_period_ends_at") @@ -712,8 +712,8 @@ public void setCurrentPeriodEndsAt(ZonedDateTime currentPeriodEndsAt) { /** * UnSetter for CurrentPeriodEndsAt. - * Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly - * scheduled attempted charge will occur) + * Timestamp relating to the end of the current (recurring) period (i.e., when the next + * regularly scheduled attempted charge will occur) */ public void unsetCurrentPeriodEndsAt() { currentPeriodEndsAt = null; @@ -721,11 +721,11 @@ public void unsetCurrentPeriodEndsAt() { /** * Internal Getter for NextAssessmentAt. - * Timestamp that indicates when capture of payment will be tried or,retried. This value will - * usually track the current_period_ends_at, but,will diverge if a renewal payment fails and - * must be retried. In that,case, the current_period_ends_at will advance to the end of the - * next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will - * be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) + * Timestamp that indicates when capture of payment will be tried or retried. This value will + * usually track the current_period_ends_at, but will diverge if a renewal payment fails and + * must be retried. In that case, the current_period_ends_at will advance to the end of the next + * period (time doesn’t stop because a payment was missed) but the next_assessment_at will be + * scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). * @return Returns the Internal ZonedDateTime */ @JsonGetter("next_assessment_at") @@ -737,11 +737,11 @@ protected OptionalNullable internalGetNextAssessmentAt() { /** * Getter for NextAssessmentAt. - * Timestamp that indicates when capture of payment will be tried or,retried. This value will - * usually track the current_period_ends_at, but,will diverge if a renewal payment fails and - * must be retried. In that,case, the current_period_ends_at will advance to the end of the - * next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will - * be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) + * Timestamp that indicates when capture of payment will be tried or retried. This value will + * usually track the current_period_ends_at, but will diverge if a renewal payment fails and + * must be retried. In that case, the current_period_ends_at will advance to the end of the next + * period (time doesn’t stop because a payment was missed) but the next_assessment_at will be + * scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). * @return Returns the ZonedDateTime */ public ZonedDateTime getNextAssessmentAt() { @@ -750,11 +750,11 @@ public ZonedDateTime getNextAssessmentAt() { /** * Setter for NextAssessmentAt. - * Timestamp that indicates when capture of payment will be tried or,retried. This value will - * usually track the current_period_ends_at, but,will diverge if a renewal payment fails and - * must be retried. In that,case, the current_period_ends_at will advance to the end of the - * next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will - * be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) + * Timestamp that indicates when capture of payment will be tried or retried. This value will + * usually track the current_period_ends_at, but will diverge if a renewal payment fails and + * must be retried. In that case, the current_period_ends_at will advance to the end of the next + * period (time doesn’t stop because a payment was missed) but the next_assessment_at will be + * scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). * @param nextAssessmentAt Value for ZonedDateTime */ @JsonSetter("next_assessment_at") @@ -765,11 +765,11 @@ public void setNextAssessmentAt(ZonedDateTime nextAssessmentAt) { /** * UnSetter for NextAssessmentAt. - * Timestamp that indicates when capture of payment will be tried or,retried. This value will - * usually track the current_period_ends_at, but,will diverge if a renewal payment fails and - * must be retried. In that,case, the current_period_ends_at will advance to the end of the - * next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will - * be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) + * Timestamp that indicates when capture of payment will be tried or retried. This value will + * usually track the current_period_ends_at, but will diverge if a renewal payment fails and + * must be retried. In that case, the current_period_ends_at will advance to the end of the next + * period (time doesn’t stop because a payment was missed) but the next_assessment_at will be + * scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). */ public void unsetNextAssessmentAt() { nextAssessmentAt = null; @@ -857,7 +857,7 @@ public void unsetTrialEndedAt() { /** * Internal Getter for ActivatedAt. - * Timestamp for when the subscription began (i.e. when it came out of trial, or when it began + * Timestamp for when the subscription began (i.e., when it came out of trial, or when it began * in the case of no trial) * @return Returns the Internal ZonedDateTime */ @@ -870,7 +870,7 @@ protected OptionalNullable internalGetActivatedAt() { /** * Getter for ActivatedAt. - * Timestamp for when the subscription began (i.e. when it came out of trial, or when it began + * Timestamp for when the subscription began (i.e., when it came out of trial, or when it began * in the case of no trial) * @return Returns the ZonedDateTime */ @@ -880,7 +880,7 @@ public ZonedDateTime getActivatedAt() { /** * Setter for ActivatedAt. - * Timestamp for when the subscription began (i.e. when it came out of trial, or when it began + * Timestamp for when the subscription began (i.e., when it came out of trial, or when it began * in the case of no trial) * @param activatedAt Value for ZonedDateTime */ @@ -892,7 +892,7 @@ public void setActivatedAt(ZonedDateTime activatedAt) { /** * UnSetter for ActivatedAt. - * Timestamp for when the subscription began (i.e. when it came out of trial, or when it began + * Timestamp for when the subscription began (i.e., when it came out of trial, or when it began * in the case of no trial) */ public void unsetActivatedAt() { @@ -1189,7 +1189,7 @@ public void unsetCurrentPeriodStartedAt() { /** * Getter for PreviousState. * Only valid for webhook payloads The previous state for webhooks that have indicated a change - * in state. For normal API calls, this will always be the same as the state (current state) + * in state. For normal API calls, this will always be the same as the state (current state). * @return Returns the SubscriptionState */ @JsonGetter("previous_state") @@ -1201,7 +1201,7 @@ public SubscriptionState getPreviousState() { /** * Setter for PreviousState. * Only valid for webhook payloads The previous state for webhooks that have indicated a change - * in state. For normal API calls, this will always be the same as the state (current state) + * in state. For normal API calls, this will always be the same as the state (current state). * @param previousState Value for SubscriptionState */ @JsonSetter("previous_state") @@ -1232,8 +1232,8 @@ public void setSignupPaymentId(Integer signupPaymentId) { /** * Getter for SignupRevenue. - * The revenue, formatted as a string of decimal separated dollars and,cents, from the - * subscription signup ($50.00 would be formatted as,50.00) + * The revenue, formatted as a string of decimal separated dollars and cents, from the + * subscription signup ($50.00 would be formatted as 50.00) * @return Returns the String */ @JsonGetter("signup_revenue") @@ -1244,8 +1244,8 @@ public String getSignupRevenue() { /** * Setter for SignupRevenue. - * The revenue, formatted as a string of decimal separated dollars and,cents, from the - * subscription signup ($50.00 would be formatted as,50.00) + * The revenue, formatted as a string of decimal separated dollars and cents, from the + * subscription signup ($50.00 would be formatted as 50.00) * @param signupRevenue Value for String */ @JsonSetter("signup_revenue") @@ -1763,7 +1763,7 @@ public void unsetCouponUsesAllowed() { /** * Internal Getter for ReasonCode. - * The churn reason code associated to a cancelled subscription. + * The churn reason code associated to a canceled subscription. * @return Returns the Internal String */ @JsonGetter("reason_code") @@ -1775,7 +1775,7 @@ protected OptionalNullable internalGetReasonCode() { /** * Getter for ReasonCode. - * The churn reason code associated to a cancelled subscription. + * The churn reason code associated to a canceled subscription. * @return Returns the String */ public String getReasonCode() { @@ -1784,7 +1784,7 @@ public String getReasonCode() { /** * Setter for ReasonCode. - * The churn reason code associated to a cancelled subscription. + * The churn reason code associated to a canceled subscription. * @param reasonCode Value for String */ @JsonSetter("reason_code") @@ -1794,7 +1794,7 @@ public void setReasonCode(String reasonCode) { /** * UnSetter for ReasonCode. - * The churn reason code associated to a cancelled subscription. + * The churn reason code associated to a canceled subscription. */ public void unsetReasonCode() { reasonCode = null; @@ -2145,7 +2145,7 @@ public void unsetStoredCredentialTransactionId() { /** * Internal Getter for Reference. - * The reference value (provided by your app) for the subscription istelf. + * The reference value (provided by your app) for the subscription itself. * @return Returns the Internal String */ @JsonGetter("reference") @@ -2157,7 +2157,7 @@ protected OptionalNullable internalGetReference() { /** * Getter for Reference. - * The reference value (provided by your app) for the subscription istelf. + * The reference value (provided by your app) for the subscription itself. * @return Returns the String */ public String getReference() { @@ -2166,7 +2166,7 @@ public String getReference() { /** * Setter for Reference. - * The reference value (provided by your app) for the subscription istelf. + * The reference value (provided by your app) for the subscription itself. * @param reference Value for String */ @JsonSetter("reference") @@ -2176,7 +2176,7 @@ public void setReference(String reference) { /** * UnSetter for Reference. - * The reference value (provided by your app) for the subscription istelf. + * The reference value (provided by your app) for the subscription itself. */ public void unsetReference() { reference = null; @@ -2225,7 +2225,7 @@ public void unsetOnHoldAt() { /** * Getter for PrepaidDunning. * Boolean representing whether the subscription is prepaid and currently in dunning. Only - * returned for Relationship Invoicing sites with the feature enabled + * returned for Relationship Invoicing sites with the feature enabled. * @return Returns the Boolean */ @JsonGetter("prepaid_dunning") @@ -2237,7 +2237,7 @@ public Boolean getPrepaidDunning() { /** * Setter for PrepaidDunning. * Boolean representing whether the subscription is prepaid and currently in dunning. Only - * returned for Relationship Invoicing sites with the feature enabled + * returned for Relationship Invoicing sites with the feature enabled. * @param prepaidDunning Value for Boolean */ @JsonSetter("prepaid_dunning") @@ -2248,7 +2248,7 @@ public void setPrepaidDunning(Boolean prepaidDunning) { /** * Getter for Coupons. * Additional coupon data. To use this data you also have to include the following param in the - * request`include[]=coupons`. Only in Read Subscription Endpoint. + * request: `include[]=coupons`. Only in Read Subscription Endpoint. * @return Returns the List of SubscriptionIncludedCoupon */ @JsonGetter("coupons") @@ -2260,7 +2260,7 @@ public List getCoupons() { /** * Setter for Coupons. * Additional coupon data. To use this data you also have to include the following param in the - * request`include[]=coupons`. Only in Read Subscription Endpoint. + * request: `include[]=coupons`. Only in Read Subscription Endpoint. * @param coupons Value for List of SubscriptionIncludedCoupon */ @JsonSetter("coupons") diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java index 08983383..6ddc011c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java @@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.maxio.advancedbilling.DateTimeHelper; import com.maxio.advancedbilling.models.containers.SubscriptionComponentAllocatedQuantity; +import com.maxio.advancedbilling.models.containers.SubscriptionComponentUnitBalance; import io.apimatic.core.types.BaseModel; import io.apimatic.core.types.OptionalNullable; import java.time.ZonedDateTime; @@ -28,7 +29,7 @@ public class SubscriptionComponent private ComponentKind kind; private String unitName; private Boolean enabled; - private Integer unitBalance; + private SubscriptionComponentUnitBalance unitBalance; private String currency; private SubscriptionComponentAllocatedQuantity allocatedQuantity; private OptionalNullable pricingScheme; @@ -69,7 +70,7 @@ public SubscriptionComponent() { * @param kind ComponentKind value for kind. * @param unitName String value for unitName. * @param enabled Boolean value for enabled. - * @param unitBalance Integer value for unitBalance. + * @param unitBalance SubscriptionComponentUnitBalance value for unitBalance. * @param currency String value for currency. * @param allocatedQuantity SubscriptionComponentAllocatedQuantity value for * allocatedQuantity. @@ -104,7 +105,7 @@ public SubscriptionComponent( ComponentKind kind, String unitName, Boolean enabled, - Integer unitBalance, + SubscriptionComponentUnitBalance unitBalance, String currency, SubscriptionComponentAllocatedQuantity allocatedQuantity, PricingScheme pricingScheme, @@ -172,7 +173,7 @@ public SubscriptionComponent( * @param kind ComponentKind value for kind. * @param unitName String value for unitName. * @param enabled Boolean value for enabled. - * @param unitBalance Integer value for unitBalance. + * @param unitBalance SubscriptionComponentUnitBalance value for unitBalance. * @param currency String value for currency. * @param allocatedQuantity SubscriptionComponentAllocatedQuantity value for * allocatedQuantity. @@ -203,7 +204,7 @@ public SubscriptionComponent( */ protected SubscriptionComponent(Integer id, String name, ComponentKind kind, String unitName, - Boolean enabled, Integer unitBalance, String currency, + Boolean enabled, SubscriptionComponentUnitBalance unitBalance, String currency, SubscriptionComponentAllocatedQuantity allocatedQuantity, OptionalNullable pricingScheme, Integer componentId, OptionalNullable componentHandle, Integer subscriptionId, Boolean recurring, @@ -332,7 +333,7 @@ public void setUnitName(String unitName) { /** * Getter for Enabled. - * (for on/off components) indicates if the component is enabled for the subscription + * (for on/off components) indicates if the component is enabled for the subscription. * @return Returns the Boolean */ @JsonGetter("enabled") @@ -343,7 +344,7 @@ public Boolean getEnabled() { /** * Setter for Enabled. - * (for on/off components) indicates if the component is enabled for the subscription + * (for on/off components) indicates if the component is enabled for the subscription. * @param enabled Value for Boolean */ @JsonSetter("enabled") @@ -353,20 +354,20 @@ public void setEnabled(Boolean enabled) { /** * Getter for UnitBalance. - * @return Returns the Integer + * @return Returns the SubscriptionComponentUnitBalance */ @JsonGetter("unit_balance") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getUnitBalance() { + public SubscriptionComponentUnitBalance getUnitBalance() { return unitBalance; } /** * Setter for UnitBalance. - * @param unitBalance Value for Integer + * @param unitBalance Value for SubscriptionComponentUnitBalance */ @JsonSetter("unit_balance") - public void setUnitBalance(Integer unitBalance) { + public void setUnitBalance(SubscriptionComponentUnitBalance unitBalance) { this.unitBalance = unitBalance; } @@ -972,7 +973,8 @@ public void setAllowFractionalQuantities(Boolean allowFractionalQuantities) { /** * Getter for Subscription. - * An optional object, will be returned if provided `include=subscription` query param. + * (Optional) Object that will be returned if the `include=subscription` query param is + * provided. * @return Returns the SubscriptionComponentSubscription */ @JsonGetter("subscription") @@ -983,7 +985,8 @@ public SubscriptionComponentSubscription getSubscription() { /** * Setter for Subscription. - * An optional object, will be returned if provided `include=subscription` query param. + * (Optional) Object that will be returned if the `include=subscription` query param is + * provided. * @param subscription Value for SubscriptionComponentSubscription */ @JsonSetter("subscription") @@ -1031,7 +1034,7 @@ public void setDisplayOnHostedPage(Boolean displayOnHostedPage) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -1044,7 +1047,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer @@ -1172,7 +1175,7 @@ public static class Builder { private ComponentKind kind; private String unitName; private Boolean enabled; - private Integer unitBalance; + private SubscriptionComponentUnitBalance unitBalance; private String currency; private SubscriptionComponentAllocatedQuantity allocatedQuantity; private OptionalNullable pricingScheme; @@ -1254,10 +1257,10 @@ public Builder enabled(Boolean enabled) { /** * Setter for unitBalance. - * @param unitBalance Integer value for unitBalance. + * @param unitBalance SubscriptionComponentUnitBalance value for unitBalance. * @return Builder */ - public Builder unitBalance(Integer unitBalance) { + public Builder unitBalance(SubscriptionComponentUnitBalance unitBalance) { this.unitBalance = unitBalance; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionCustomPrice.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionCustomPrice.java index 5a65a516..50f54b30 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionCustomPrice.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionCustomPrice.java @@ -310,7 +310,7 @@ public void setTrialIntervalUnit(IntervalUnit trialIntervalUnit) { /** * Internal Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -326,7 +326,7 @@ protected OptionalNullable internalGetTrialType() { /** * Getter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -339,7 +339,7 @@ public TrialType getTrialType() { /** * Setter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other @@ -353,7 +353,7 @@ public void setTrialType(TrialType trialType) { /** * UnSetter for TrialType. - * Indicates how a trial is handled when the trail period ends and there is no credit card on + * Indicates how a trial is handled when the trial period ends and there is no credit card on * file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will * not send any emails or statements. For `payment_expected`, the subscription transitions to a * Past Due state. Maxio will send normal dunning emails and statements according to your other diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionDateField.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionDateField.java index 34c5a0bb..a4f8c188 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionDateField.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionDateField.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionDateField to be used. */ @@ -35,7 +34,6 @@ public enum SubscriptionDateField { UPDATED_AT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupBankAccount.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupBankAccount.java index 787a56db..4db409fd 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupBankAccount.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupBankAccount.java @@ -142,8 +142,8 @@ public void setBankAccountNumber(String bankAccountNumber) { /** * Getter for BankRoutingNumber. * (Required when creating a subscription with ACH. Optional when creating a subscription with - * GoCardless). The routing number of the bank. It becomes bank_code while passing via - * GoCardless API + * GoCardless.) The routing number of the bank. It becomes bank_code while passing via + * GoCardless API. * @return Returns the String */ @JsonGetter("bank_routing_number") @@ -155,8 +155,8 @@ public String getBankRoutingNumber() { /** * Setter for BankRoutingNumber. * (Required when creating a subscription with ACH. Optional when creating a subscription with - * GoCardless). The routing number of the bank. It becomes bank_code while passing via - * GoCardless API + * GoCardless.) The routing number of the bank. It becomes bank_code while passing via + * GoCardless API. * @param bankRoutingNumber Value for String */ @JsonSetter("bank_routing_number") @@ -167,7 +167,7 @@ public void setBankRoutingNumber(String bankRoutingNumber) { /** * Getter for BankIban. * (Optional when creating a subscription with GoCardless). International Bank Account Number. - * Alternatively, local bank details can be provided + * Alternatively, local bank details can be provided. * @return Returns the String */ @JsonGetter("bank_iban") @@ -179,7 +179,7 @@ public String getBankIban() { /** * Setter for BankIban. * (Optional when creating a subscription with GoCardless). International Bank Account Number. - * Alternatively, local bank details can be provided + * Alternatively, local bank details can be provided. * @param bankIban Value for String */ @JsonSetter("bank_iban") @@ -190,7 +190,7 @@ public void setBankIban(String bankIban) { /** * Getter for BankBranchCode. * (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN - * can be provided + * can be provided. * @return Returns the String */ @JsonGetter("bank_branch_code") @@ -202,7 +202,7 @@ public String getBankBranchCode() { /** * Setter for BankBranchCode. * (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN - * can be provided + * can be provided. * @param bankBranchCode Value for String */ @JsonSetter("bank_branch_code") diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupInclude.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupInclude.java index 55c9cf4f..c15a8601 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupInclude.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionGroupInclude to be used. */ public enum SubscriptionGroupInclude { CURRENT_BILLING_AMOUNT_IN_CENTS; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupPrepaymentMethod.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupPrepaymentMethod.java index 5fe83808..96db3834 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupPrepaymentMethod.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupPrepaymentMethod.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionGroupPrepaymentMethod to be used. */ @@ -29,7 +28,6 @@ public enum SubscriptionGroupPrepaymentMethod { OTHER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupSignupItem.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupSignupItem.java index d648501b..704e9e60 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupSignupItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupSignupItem.java @@ -175,7 +175,7 @@ public void setProductPricePointHandle(String productPricePointHandle) { * Getter for OfferId. * Use in place of passing product and component information to set up the subscription with an * existing offer. May be either the Chargify ID of the offer or its handle prefixed with - * `handle:` + * `handle:`. * @return Returns the Integer */ @JsonGetter("offer_id") @@ -188,7 +188,7 @@ public Integer getOfferId() { * Setter for OfferId. * Use in place of passing product and component information to set up the subscription with an * existing offer. May be either the Chargify ID of the offer or its handle prefixed with - * `handle:` + * `handle:`. * @param offerId Value for Integer */ @JsonSetter("offer_id") @@ -198,7 +198,7 @@ public void setOfferId(Integer offerId) { /** * Getter for Reference. - * The reference value (provided by your app) for the subscription itelf. + * The reference value (provided by your app) for the subscription itself. * @return Returns the String */ @JsonGetter("reference") @@ -209,7 +209,7 @@ public String getReference() { /** * Setter for Reference. - * The reference value (provided by your app) for the subscription itelf. + * The reference value (provided by your app) for the subscription itself. * @param reference Value for String */ @JsonSetter("reference") @@ -330,7 +330,7 @@ public void setCustomPrice(SubscriptionCustomPrice customPrice) { /** * Getter for CalendarBilling. - * (Optional). Cannot be used when also specifying next_billing_at + * (Optional). Cannot be used when also specifying next_billing_at. * @return Returns the CalendarBilling */ @JsonGetter("calendar_billing") @@ -341,7 +341,7 @@ public CalendarBilling getCalendarBilling() { /** * Setter for CalendarBilling. - * (Optional). Cannot be used when also specifying next_billing_at + * (Optional). Cannot be used when also specifying next_billing_at. * @param calendarBilling Value for CalendarBilling */ @JsonSetter("calendar_billing") diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupsListInclude.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupsListInclude.java index 62577c04..ae541575 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupsListInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionGroupsListInclude.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionGroupsListInclude to be used. */ public enum SubscriptionGroupsListInclude { ACCOUNT_BALANCES; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionInclude.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionInclude.java index 60a30026..98d0813c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionInclude.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionInclude to be used. */ @@ -21,7 +20,6 @@ public enum SubscriptionInclude { SELF_SERVICE_PAGE_TOKEN; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionListDateField.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionListDateField.java index 7af52000..895362e2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionListDateField.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionListDateField.java @@ -12,14 +12,12 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionListDateField to be used. */ public enum SubscriptionListDateField { UPDATED_AT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionListInclude.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionListInclude.java index 8980fd15..2d694f0b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionListInclude.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionListInclude.java @@ -12,21 +12,31 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionListInclude to be used. */ public enum SubscriptionListInclude { - SELF_SERVICE_PAGE_TOKEN; + SELF_SERVICE_PAGE_TOKEN, + + CURRENT_ACCOUNT_BALANCE_IN_CENTS, + + CURRENT_BILLING_AMOUNT, + COUPONS; private static TreeMap valueMap = new TreeMap<>(); private String value; static { SELF_SERVICE_PAGE_TOKEN.value = "self_service_page_token"; + CURRENT_ACCOUNT_BALANCE_IN_CENTS.value = "current_account_balance_in_cents"; + CURRENT_BILLING_AMOUNT.value = "current_billing_amount"; + COUPONS.value = "coupons"; valueMap.put("self_service_page_token", SELF_SERVICE_PAGE_TOKEN); + valueMap.put("current_account_balance_in_cents", CURRENT_ACCOUNT_BALANCE_IN_CENTS); + valueMap.put("current_billing_amount", CURRENT_BILLING_AMOUNT); + valueMap.put("coupons", COUPONS); } /** diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionProductChange.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionProductChange.java index 60c71fe1..4ec80934 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionProductChange.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionProductChange.java @@ -8,9 +8,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.maxio.advancedbilling.DateTimeHelper; import io.apimatic.core.types.BaseModel; +import io.apimatic.core.types.OptionalNullable; +import java.time.ZonedDateTime; /** * This is a model class for SubscriptionProductChange type. @@ -19,6 +25,9 @@ public class SubscriptionProductChange extends BaseModel { private int previousProductId; private int newProductId; + private OptionalNullable previousProductPricePointId; + private OptionalNullable newProductPricePointId; + private OptionalNullable effectiveAt; /** * Default constructor. @@ -30,13 +39,57 @@ public SubscriptionProductChange() { * Initialization constructor. * @param previousProductId int value for previousProductId. * @param newProductId int value for newProductId. + * @param previousProductPricePointId Integer value for previousProductPricePointId. + * @param newProductPricePointId Integer value for newProductPricePointId. + * @param effectiveAt ZonedDateTime value for effectiveAt. */ - @JsonCreator public SubscriptionProductChange( - @JsonProperty("previous_product_id") int previousProductId, - @JsonProperty("new_product_id") int newProductId) { + int previousProductId, + int newProductId, + Integer previousProductPricePointId, + Integer newProductPricePointId, + ZonedDateTime effectiveAt) { + this.previousProductId = previousProductId; + this.newProductId = newProductId; + this.previousProductPricePointId = OptionalNullable.of(previousProductPricePointId); + this.newProductPricePointId = OptionalNullable.of(newProductPricePointId); + this.effectiveAt = OptionalNullable.of(effectiveAt); + } + + /** + * Initialization constructor. + * @param previousProductId int value for previousProductId. + * @param newProductId int value for newProductId. + * @param previousProductPricePointId Integer value for previousProductPricePointId. + * @param newProductPricePointId Integer value for newProductPricePointId. + * @param effectiveAt ZonedDateTime value for effectiveAt. + */ + + protected SubscriptionProductChange(int previousProductId, int newProductId, + OptionalNullable previousProductPricePointId, + OptionalNullable newProductPricePointId, + OptionalNullable effectiveAt) { this.previousProductId = previousProductId; this.newProductId = newProductId; + this.previousProductPricePointId = previousProductPricePointId; + this.newProductPricePointId = newProductPricePointId; + this.effectiveAt = effectiveAt; + } + + /** + * Initialization constructor. + * @param previousProductId int value for previousProductId. + * @param newProductId int value for newProductId. + */ + @JsonCreator + protected SubscriptionProductChange( + @JsonProperty("previous_product_id") int previousProductId, + @JsonProperty("new_product_id") int newProductId) { + this(previousProductId, newProductId, OptionalNullable.of(null), OptionalNullable.of(null), + OptionalNullable.of(null)); + unsetPreviousProductPricePointId(); + unsetNewProductPricePointId(); + unsetEffectiveAt(); } /** @@ -75,6 +128,120 @@ public void setNewProductId(int newProductId) { this.newProductId = newProductId; } + /** + * Internal Getter for PreviousProductPricePointId. + * @return Returns the Internal Integer + */ + @JsonGetter("previous_product_price_point_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetPreviousProductPricePointId() { + return this.previousProductPricePointId; + } + + /** + * Getter for PreviousProductPricePointId. + * @return Returns the Integer + */ + public Integer getPreviousProductPricePointId() { + return OptionalNullable.getFrom(previousProductPricePointId); + } + + /** + * Setter for PreviousProductPricePointId. + * @param previousProductPricePointId Value for Integer + */ + @JsonSetter("previous_product_price_point_id") + public void setPreviousProductPricePointId(Integer previousProductPricePointId) { + this.previousProductPricePointId = OptionalNullable.of(previousProductPricePointId); + } + + /** + * UnSetter for PreviousProductPricePointId. + */ + public void unsetPreviousProductPricePointId() { + previousProductPricePointId = null; + } + + /** + * Internal Getter for NewProductPricePointId. + * @return Returns the Internal Integer + */ + @JsonGetter("new_product_price_point_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetNewProductPricePointId() { + return this.newProductPricePointId; + } + + /** + * Getter for NewProductPricePointId. + * @return Returns the Integer + */ + public Integer getNewProductPricePointId() { + return OptionalNullable.getFrom(newProductPricePointId); + } + + /** + * Setter for NewProductPricePointId. + * @param newProductPricePointId Value for Integer + */ + @JsonSetter("new_product_price_point_id") + public void setNewProductPricePointId(Integer newProductPricePointId) { + this.newProductPricePointId = OptionalNullable.of(newProductPricePointId); + } + + /** + * UnSetter for NewProductPricePointId. + */ + public void unsetNewProductPricePointId() { + newProductPricePointId = null; + } + + /** + * Internal Getter for EffectiveAt. + * When the scheduled product change takes effect (the subscription's next renewal). Only sent + * for `subscription_product_change_scheduled`. + * @return Returns the Internal ZonedDateTime + */ + @JsonGetter("effective_at") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) + protected OptionalNullable internalGetEffectiveAt() { + return this.effectiveAt; + } + + /** + * Getter for EffectiveAt. + * When the scheduled product change takes effect (the subscription's next renewal). Only sent + * for `subscription_product_change_scheduled`. + * @return Returns the ZonedDateTime + */ + public ZonedDateTime getEffectiveAt() { + return OptionalNullable.getFrom(effectiveAt); + } + + /** + * Setter for EffectiveAt. + * When the scheduled product change takes effect (the subscription's next renewal). Only sent + * for `subscription_product_change_scheduled`. + * @param effectiveAt Value for ZonedDateTime + */ + @JsonSetter("effective_at") + @JsonDeserialize(using = DateTimeHelper.Rfc8601DateTimeDeserializer.class) + public void setEffectiveAt(ZonedDateTime effectiveAt) { + this.effectiveAt = OptionalNullable.of(effectiveAt); + } + + /** + * UnSetter for EffectiveAt. + * When the scheduled product change takes effect (the subscription's next renewal). Only sent + * for `subscription_product_change_scheduled`. + */ + public void unsetEffectiveAt() { + effectiveAt = null; + } + /** * Converts this SubscriptionProductChange into string format. * @return String representation of this class @@ -82,7 +249,9 @@ public void setNewProductId(int newProductId) { @Override public String toString() { return "SubscriptionProductChange [" + "previousProductId=" + previousProductId - + ", newProductId=" + newProductId + ", additionalProperties=" + + ", newProductId=" + newProductId + ", previousProductPricePointId=" + + previousProductPricePointId + ", newProductPricePointId=" + newProductPricePointId + + ", effectiveAt=" + effectiveAt + ", additionalProperties=" + getAdditionalProperties() + "]"; } @@ -93,6 +262,9 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder(previousProductId, newProductId); + builder.previousProductPricePointId = internalGetPreviousProductPricePointId(); + builder.newProductPricePointId = internalGetNewProductPricePointId(); + builder.effectiveAt = internalGetEffectiveAt(); return builder; } @@ -102,6 +274,9 @@ public Builder toBuilder() { public static class Builder { private int previousProductId; private int newProductId; + private OptionalNullable previousProductPricePointId; + private OptionalNullable newProductPricePointId; + private OptionalNullable effectiveAt; /** * Initialization constructor. @@ -139,12 +314,70 @@ public Builder newProductId(int newProductId) { return this; } + /** + * Setter for previousProductPricePointId. + * @param previousProductPricePointId Integer value for previousProductPricePointId. + * @return Builder + */ + public Builder previousProductPricePointId(Integer previousProductPricePointId) { + this.previousProductPricePointId = OptionalNullable.of(previousProductPricePointId); + return this; + } + + /** + * UnSetter for previousProductPricePointId. + * @return Builder + */ + public Builder unsetPreviousProductPricePointId() { + previousProductPricePointId = null; + return this; + } + + /** + * Setter for newProductPricePointId. + * @param newProductPricePointId Integer value for newProductPricePointId. + * @return Builder + */ + public Builder newProductPricePointId(Integer newProductPricePointId) { + this.newProductPricePointId = OptionalNullable.of(newProductPricePointId); + return this; + } + + /** + * UnSetter for newProductPricePointId. + * @return Builder + */ + public Builder unsetNewProductPricePointId() { + newProductPricePointId = null; + return this; + } + + /** + * Setter for effectiveAt. + * @param effectiveAt ZonedDateTime value for effectiveAt. + * @return Builder + */ + public Builder effectiveAt(ZonedDateTime effectiveAt) { + this.effectiveAt = OptionalNullable.of(effectiveAt); + return this; + } + + /** + * UnSetter for effectiveAt. + * @return Builder + */ + public Builder unsetEffectiveAt() { + effectiveAt = null; + return this; + } + /** * Builds a new {@link SubscriptionProductChange} object using the set fields. * @return {@link SubscriptionProductChange} */ public SubscriptionProductChange build() { - return new SubscriptionProductChange(previousProductId, newProductId); + return new SubscriptionProductChange(previousProductId, newProductId, + previousProductPricePointId, newProductPricePointId, effectiveAt); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionPurgeType.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionPurgeType.java index 28b132c9..51feaa8e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionPurgeType.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionPurgeType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionPurgeType to be used. */ @@ -21,7 +20,6 @@ public enum SubscriptionPurgeType { PAYMENT_PROFILE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionSort.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionSort.java index f0583e17..1d39cb8a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionSort.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionSort.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionSort to be used. */ @@ -37,7 +36,6 @@ public enum SubscriptionSort { EXPIRES_AT; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionState.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionState.java index 61b7f8ae..3dd3ade5 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionState.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionState.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionState to be used. */ @@ -47,7 +46,6 @@ public enum SubscriptionState { AWAITING_SIGNUP; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionStateFilter.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionStateFilter.java index 666e445a..39d2ba0a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionStateFilter.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionStateFilter.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * SubscriptionStateFilter to be used. */ @@ -25,14 +24,24 @@ public enum SubscriptionStateFilter { EXPIRED_CARDS, + ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS, + + ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS, + ON_HOLD, + AWAITING_SIGNUP, + + AWAITING_SIGNUP_DATE, + PAST_DUE, PENDING_CANCELLATION, PENDING_RENEWAL, + PREPAID_DUNNING, + SUSPENDED, TRIAL_ENDED, @@ -41,7 +50,6 @@ public enum SubscriptionStateFilter { UNPAID; - private static TreeMap valueMap = new TreeMap<>(); private String value; @@ -50,10 +58,15 @@ public enum SubscriptionStateFilter { CANCELED.value = "canceled"; EXPIRED.value = "expired"; EXPIRED_CARDS.value = "expired_cards"; + ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS.value = "expired_cards_(live_subscriptions)"; + ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS.value = "expired_cards_(all_subscriptions)"; ON_HOLD.value = "on_hold"; + AWAITING_SIGNUP.value = "awaiting_signup"; + AWAITING_SIGNUP_DATE.value = "awaiting_signup_date"; PAST_DUE.value = "past_due"; PENDING_CANCELLATION.value = "pending_cancellation"; PENDING_RENEWAL.value = "pending_renewal"; + PREPAID_DUNNING.value = "prepaid_dunning"; SUSPENDED.value = "suspended"; TRIAL_ENDED.value = "trial_ended"; TRIALING.value = "trialing"; @@ -63,10 +76,15 @@ public enum SubscriptionStateFilter { valueMap.put("canceled", CANCELED); valueMap.put("expired", EXPIRED); valueMap.put("expired_cards", EXPIRED_CARDS); + valueMap.put("expired_cards_(live_subscriptions)", ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS); + valueMap.put("expired_cards_(all_subscriptions)", ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS); valueMap.put("on_hold", ON_HOLD); + valueMap.put("awaiting_signup", AWAITING_SIGNUP); + valueMap.put("awaiting_signup_date", AWAITING_SIGNUP_DATE); valueMap.put("past_due", PAST_DUE); valueMap.put("pending_cancellation", PENDING_CANCELLATION); valueMap.put("pending_renewal", PENDING_RENEWAL); + valueMap.put("prepaid_dunning", PREPAID_DUNNING); valueMap.put("suspended", SUSPENDED); valueMap.put("trial_ended", TRIAL_ENDED); valueMap.put("trialing", TRIALING); diff --git a/src/main/java/com/maxio/advancedbilling/models/TaxConfigurationKind.java b/src/main/java/com/maxio/advancedbilling/models/TaxConfigurationKind.java index d6ae4133..efdba67a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/TaxConfigurationKind.java +++ b/src/main/java/com/maxio/advancedbilling/models/TaxConfigurationKind.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * TaxConfigurationKind to be used. */ @@ -25,7 +24,6 @@ public enum TaxConfigurationKind { ENUM_DIGITAL_RIVER; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/TaxDestinationAddress.java b/src/main/java/com/maxio/advancedbilling/models/TaxDestinationAddress.java index 4f3cd85c..dc24cf5b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/TaxDestinationAddress.java +++ b/src/main/java/com/maxio/advancedbilling/models/TaxDestinationAddress.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * TaxDestinationAddress to be used. */ @@ -25,7 +24,6 @@ public enum TaxDestinationAddress { BILLING_ONLY; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/TrialType.java b/src/main/java/com/maxio/advancedbilling/models/TrialType.java index 160b186e..19c7360b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/TrialType.java +++ b/src/main/java/com/maxio/advancedbilling/models/TrialType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * TrialType to be used. */ @@ -21,7 +20,6 @@ public enum TrialType { PAYMENT_EXPECTED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java b/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java index 7157fba2..4e2e3591 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java @@ -27,6 +27,7 @@ public class UpdateComponent private OptionalNullable itemCategory; private Boolean displayOnHostedPage; private OptionalNullable upgradeCharge; + private OptionalNullable unspscCode; /** * Default constructor. @@ -45,6 +46,7 @@ public UpdateComponent() { * @param itemCategory ItemCategory value for itemCategory. * @param displayOnHostedPage Boolean value for displayOnHostedPage. * @param upgradeCharge CreditType value for upgradeCharge. + * @param unspscCode String value for unspscCode. */ public UpdateComponent( String handle, @@ -55,7 +57,8 @@ public UpdateComponent( String taxCode, ItemCategory itemCategory, Boolean displayOnHostedPage, - CreditType upgradeCharge) { + CreditType upgradeCharge, + String unspscCode) { this.handle = handle; this.name = name; this.description = OptionalNullable.of(description); @@ -65,6 +68,7 @@ public UpdateComponent( this.itemCategory = OptionalNullable.of(itemCategory); this.displayOnHostedPage = displayOnHostedPage; this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.unspscCode = OptionalNullable.of(unspscCode); } /** @@ -78,12 +82,14 @@ public UpdateComponent( * @param itemCategory ItemCategory value for itemCategory. * @param displayOnHostedPage Boolean value for displayOnHostedPage. * @param upgradeCharge CreditType value for upgradeCharge. + * @param unspscCode String value for unspscCode. */ protected UpdateComponent(String handle, String name, OptionalNullable description, OptionalNullable accountingCode, Boolean taxable, OptionalNullable taxCode, OptionalNullable itemCategory, - Boolean displayOnHostedPage, OptionalNullable upgradeCharge) { + Boolean displayOnHostedPage, OptionalNullable upgradeCharge, + OptionalNullable unspscCode) { this.handle = handle; this.name = name; this.description = description; @@ -93,6 +99,7 @@ protected UpdateComponent(String handle, String name, OptionalNullable d this.itemCategory = itemCategory; this.displayOnHostedPage = displayOnHostedPage; this.upgradeCharge = upgradeCharge; + this.unspscCode = unspscCode; } /** @@ -116,7 +123,7 @@ public void setHandle(String handle) { /** * Getter for Name. - * The name of the Component, suitable for display on statements. i.e. Text Messages. + * The name of the Component, suitable for display on statements. e.g., Text Messages. * @return Returns the String */ @JsonGetter("name") @@ -127,7 +134,7 @@ public String getName() { /** * Setter for Name. - * The name of the Component, suitable for display on statements. i.e. Text Messages. + * The name of the Component, suitable for display on statements. e.g., Text Messages. * @param name Value for String */ @JsonSetter("name") @@ -382,6 +389,53 @@ public void unsetUpgradeCharge() { upgradeCharge = null; } + /** + * Internal Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the Internal String + */ + @JsonGetter("unspsc_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUnspscCode() { + return this.unspscCode; + } + + /** + * Getter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @return Returns the String + */ + public String getUnspscCode() { + return OptionalNullable.getFrom(unspscCode); + } + + /** + * Setter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + * @param unspscCode Value for String + */ + @JsonSetter("unspsc_code") + public void setUnspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + } + + /** + * UnSetter for UnspscCode. + * (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value + * is sent as the commodity code on invoice line items for this component instead of the default + * derived from item_category. + */ + public void unsetUnspscCode() { + unspscCode = null; + } + /** * Converts this UpdateComponent into string format. * @return String representation of this class @@ -392,7 +446,8 @@ public String toString() { + description + ", accountingCode=" + accountingCode + ", taxable=" + taxable + ", taxCode=" + taxCode + ", itemCategory=" + itemCategory + ", displayOnHostedPage=" + displayOnHostedPage + ", upgradeCharge=" - + upgradeCharge + ", additionalProperties=" + getAdditionalProperties() + "]"; + + upgradeCharge + ", unspscCode=" + unspscCode + ", additionalProperties=" + + getAdditionalProperties() + "]"; } /** @@ -411,6 +466,7 @@ public Builder toBuilder() { builder.taxCode = internalGetTaxCode(); builder.itemCategory = internalGetItemCategory(); builder.upgradeCharge = internalGetUpgradeCharge(); + builder.unspscCode = internalGetUnspscCode(); return builder; } @@ -427,6 +483,7 @@ public static class Builder { private OptionalNullable itemCategory; private Boolean displayOnHostedPage; private OptionalNullable upgradeCharge; + private OptionalNullable unspscCode; @@ -565,13 +622,32 @@ public Builder unsetUpgradeCharge() { return this; } + /** + * Setter for unspscCode. + * @param unspscCode String value for unspscCode. + * @return Builder + */ + public Builder unspscCode(String unspscCode) { + this.unspscCode = OptionalNullable.of(unspscCode); + return this; + } + + /** + * UnSetter for unspscCode. + * @return Builder + */ + public Builder unsetUnspscCode() { + unspscCode = null; + return this; + } + /** * Builds a new {@link UpdateComponent} object using the set fields. * @return {@link UpdateComponent} */ public UpdateComponent build() { return new UpdateComponent(handle, name, description, accountingCode, taxable, taxCode, - itemCategory, displayOnHostedPage, upgradeCharge); + itemCategory, displayOnHostedPage, upgradeCharge, unspscCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateComponentPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/UpdateComponentPricePoint.java index 6a6e997d..f4e622f5 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpdateComponentPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateComponentPricePoint.java @@ -198,7 +198,7 @@ public void setTaxIncluded(Boolean taxIncluded) { /** * Getter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @return Returns the Integer @@ -211,7 +211,7 @@ public Integer getInterval() { /** * Setter for Interval. - * The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would + * The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would * mean this component price point would renew every 30 days. This property is only available * for sites with Multifrequency enabled. * @param interval Value for Integer diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateCustomer.java b/src/main/java/com/maxio/advancedbilling/models/UpdateCustomer.java index 7ebe5729..3cf7653e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpdateCustomer.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateCustomer.java @@ -34,10 +34,12 @@ public class UpdateCustomer private String locale; private String vatNumber; private Boolean taxExempt; + private Boolean surcharging; private String taxExemptReason; private OptionalNullable parentId; private OptionalNullable verified; private OptionalNullable salesforceId; + private OptionalNullable brandingThemeId; /** * Default constructor. @@ -63,10 +65,12 @@ public UpdateCustomer() { * @param locale String value for locale. * @param vatNumber String value for vatNumber. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param taxExemptReason String value for taxExemptReason. * @param parentId Integer value for parentId. * @param verified Boolean value for verified. * @param salesforceId String value for salesforceId. + * @param brandingThemeId Integer value for brandingThemeId. */ public UpdateCustomer( String firstName, @@ -85,10 +89,12 @@ public UpdateCustomer( String locale, String vatNumber, Boolean taxExempt, + Boolean surcharging, String taxExemptReason, Integer parentId, Boolean verified, - String salesforceId) { + String salesforceId, + Integer brandingThemeId) { this.firstName = firstName; this.lastName = lastName; this.email = email; @@ -105,10 +111,12 @@ public UpdateCustomer( this.locale = locale; this.vatNumber = vatNumber; this.taxExempt = taxExempt; + this.surcharging = surcharging; this.taxExemptReason = taxExemptReason; this.parentId = OptionalNullable.of(parentId); this.verified = OptionalNullable.of(verified); this.salesforceId = OptionalNullable.of(salesforceId); + this.brandingThemeId = OptionalNullable.of(brandingThemeId); } /** @@ -129,17 +137,20 @@ public UpdateCustomer( * @param locale String value for locale. * @param vatNumber String value for vatNumber. * @param taxExempt Boolean value for taxExempt. + * @param surcharging Boolean value for surcharging. * @param taxExemptReason String value for taxExemptReason. * @param parentId Integer value for parentId. * @param verified Boolean value for verified. * @param salesforceId String value for salesforceId. + * @param brandingThemeId Integer value for brandingThemeId. */ protected UpdateCustomer(String firstName, String lastName, String email, String ccEmails, String organization, String reference, String address, String address2, String city, String state, String zip, String country, String phone, String locale, String vatNumber, - Boolean taxExempt, String taxExemptReason, OptionalNullable parentId, - OptionalNullable verified, OptionalNullable salesforceId) { + Boolean taxExempt, Boolean surcharging, String taxExemptReason, + OptionalNullable parentId, OptionalNullable verified, + OptionalNullable salesforceId, OptionalNullable brandingThemeId) { this.firstName = firstName; this.lastName = lastName; this.email = email; @@ -156,10 +167,12 @@ protected UpdateCustomer(String firstName, String lastName, String email, String this.locale = locale; this.vatNumber = vatNumber; this.taxExempt = taxExempt; + this.surcharging = surcharging; this.taxExemptReason = taxExemptReason; this.parentId = parentId; this.verified = verified; this.salesforceId = salesforceId; + this.brandingThemeId = brandingThemeId; } /** @@ -468,6 +481,29 @@ public void setTaxExempt(Boolean taxExempt) { this.taxExempt = taxExempt; } + /** + * Getter for Surcharging. + * Whether surcharging is enabled for the customer. Only applied on sites where surcharging + * control is enabled. + * @return Returns the Boolean + */ + @JsonGetter("surcharging") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getSurcharging() { + return surcharging; + } + + /** + * Setter for Surcharging. + * Whether surcharging is enabled for the customer. Only applied on sites where surcharging + * control is enabled. + * @param surcharging Value for Boolean + */ + @JsonSetter("surcharging") + public void setSurcharging(Boolean surcharging) { + this.surcharging = surcharging; + } + /** * Getter for TaxExemptReason. * @return Returns the String @@ -524,8 +560,8 @@ public void unsetParentId() { /** * Internal Getter for Verified. - * Is the customer verified to use ACH as a payment method. Available only on Authorize.Net - * gateway + * Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net + * gateway. * @return Returns the Internal Boolean */ @JsonGetter("verified") @@ -537,8 +573,8 @@ protected OptionalNullable internalGetVerified() { /** * Getter for Verified. - * Is the customer verified to use ACH as a payment method. Available only on Authorize.Net - * gateway + * Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net + * gateway. * @return Returns the Boolean */ public Boolean getVerified() { @@ -547,8 +583,8 @@ public Boolean getVerified() { /** * Setter for Verified. - * Is the customer verified to use ACH as a payment method. Available only on Authorize.Net - * gateway + * Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net + * gateway. * @param verified Value for Boolean */ @JsonSetter("verified") @@ -558,8 +594,8 @@ public void setVerified(Boolean verified) { /** * UnSetter for Verified. - * Is the customer verified to use ACH as a payment method. Available only on Authorize.Net - * gateway + * Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net + * gateway. */ public void unsetVerified() { verified = null; @@ -604,6 +640,57 @@ public void unsetSalesforceId() { salesforceId = null; } + /** + * Internal Getter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @return Returns the Internal Integer + */ + @JsonGetter("branding_theme_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBrandingThemeId() { + return this.brandingThemeId; + } + + /** + * Getter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @return Returns the Integer + */ + public Integer getBrandingThemeId() { + return OptionalNullable.getFrom(brandingThemeId); + } + + /** + * Setter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + * @param brandingThemeId Value for Integer + */ + @JsonSetter("branding_theme_id") + public void setBrandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + } + + /** + * UnSetter for BrandingThemeId. + * The ID of the Branding Theme assigned to this customer as the customer's default Branding + * Theme. This customer-level Branding Theme is used when a subscription does not have its own + * subscription-level Branding Theme. Available only when Branding Themes are enabled for the + * site. + */ + public void unsetBrandingThemeId() { + brandingThemeId = null; + } + /** * Converts this UpdateCustomer into string format. * @return String representation of this class @@ -615,9 +702,10 @@ public String toString() { + ", reference=" + reference + ", address=" + address + ", address2=" + address2 + ", city=" + city + ", state=" + state + ", zip=" + zip + ", country=" + country + ", phone=" + phone + ", locale=" + locale + ", vatNumber=" + vatNumber - + ", taxExempt=" + taxExempt + ", taxExemptReason=" + taxExemptReason - + ", parentId=" + parentId + ", verified=" + verified + ", salesforceId=" - + salesforceId + ", additionalProperties=" + getAdditionalProperties() + "]"; + + ", taxExempt=" + taxExempt + ", surcharging=" + surcharging + ", taxExemptReason=" + + taxExemptReason + ", parentId=" + parentId + ", verified=" + verified + + ", salesforceId=" + salesforceId + ", brandingThemeId=" + brandingThemeId + + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -643,10 +731,12 @@ public Builder toBuilder() { .locale(getLocale()) .vatNumber(getVatNumber()) .taxExempt(getTaxExempt()) + .surcharging(getSurcharging()) .taxExemptReason(getTaxExemptReason()); builder.parentId = internalGetParentId(); builder.verified = internalGetVerified(); builder.salesforceId = internalGetSalesforceId(); + builder.brandingThemeId = internalGetBrandingThemeId(); return builder; } @@ -670,10 +760,12 @@ public static class Builder { private String locale; private String vatNumber; private Boolean taxExempt; + private Boolean surcharging; private String taxExemptReason; private OptionalNullable parentId; private OptionalNullable verified; private OptionalNullable salesforceId; + private OptionalNullable brandingThemeId; @@ -837,6 +929,16 @@ public Builder taxExempt(Boolean taxExempt) { return this; } + /** + * Setter for surcharging. + * @param surcharging Boolean value for surcharging. + * @return Builder + */ + public Builder surcharging(Boolean surcharging) { + this.surcharging = surcharging; + return this; + } + /** * Setter for taxExemptReason. * @param taxExemptReason String value for taxExemptReason. @@ -904,6 +1006,25 @@ public Builder unsetSalesforceId() { return this; } + /** + * Setter for brandingThemeId. + * @param brandingThemeId Integer value for brandingThemeId. + * @return Builder + */ + public Builder brandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + return this; + } + + /** + * UnSetter for brandingThemeId. + * @return Builder + */ + public Builder unsetBrandingThemeId() { + brandingThemeId = null; + return this; + } + /** * Builds a new {@link UpdateCustomer} object using the set fields. * @return {@link UpdateCustomer} @@ -911,7 +1032,8 @@ public Builder unsetSalesforceId() { public UpdateCustomer build() { return new UpdateCustomer(firstName, lastName, email, ccEmails, organization, reference, address, address2, city, state, zip, country, phone, locale, vatNumber, - taxExempt, taxExemptReason, parentId, verified, salesforceId); + taxExempt, surcharging, taxExemptReason, parentId, verified, salesforceId, + brandingThemeId); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateInvoice.java b/src/main/java/com/maxio/advancedbilling/models/UpdateInvoice.java new file mode 100644 index 00000000..33c0abd6 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateInvoice.java @@ -0,0 +1,423 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.maxio.advancedbilling.DateTimeHelper; +import io.apimatic.core.types.BaseModel; +import java.time.LocalDate; +import java.util.List; + +/** + * This is a model class for UpdateInvoice type. + */ +public class UpdateInvoice + extends BaseModel { + private List lineItems; + private LocalDate issueDate; + private Integer netTerms; + private String paymentInstructions; + private String memo; + private CreateInvoiceAddress sellerAddress; + private CreateInvoiceAddress billingAddress; + private CreateInvoiceAddress shippingAddress; + private List coupons; + + /** + * Default constructor. + */ + public UpdateInvoice() { + } + + /** + * Initialization constructor. + * @param lineItems List of UpdateInvoiceItem value for lineItems. + * @param issueDate LocalDate value for issueDate. + * @param netTerms Integer value for netTerms. + * @param paymentInstructions String value for paymentInstructions. + * @param memo String value for memo. + * @param sellerAddress CreateInvoiceAddress value for sellerAddress. + * @param billingAddress CreateInvoiceAddress value for billingAddress. + * @param shippingAddress CreateInvoiceAddress value for shippingAddress. + * @param coupons List of CreateInvoiceCoupon value for coupons. + */ + public UpdateInvoice( + List lineItems, + LocalDate issueDate, + Integer netTerms, + String paymentInstructions, + String memo, + CreateInvoiceAddress sellerAddress, + CreateInvoiceAddress billingAddress, + CreateInvoiceAddress shippingAddress, + List coupons) { + this.lineItems = lineItems; + this.issueDate = issueDate; + this.netTerms = netTerms; + this.paymentInstructions = paymentInstructions; + this.memo = memo; + this.sellerAddress = sellerAddress; + this.billingAddress = billingAddress; + this.shippingAddress = shippingAddress; + this.coupons = coupons; + } + + /** + * Getter for LineItems. + * Line item changes to apply. Line items without a `uid` are added, line items with a `uid` are + * updated, and line items with a `uid` and `_destroy` set to `true` are removed. Existing line + * items not referenced in the array remain unchanged. + * @return Returns the List of UpdateInvoiceItem + */ + @JsonGetter("line_items") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLineItems() { + return lineItems; + } + + /** + * Setter for LineItems. + * Line item changes to apply. Line items without a `uid` are added, line items with a `uid` are + * updated, and line items with a `uid` and `_destroy` set to `true` are removed. Existing line + * items not referenced in the array remain unchanged. + * @param lineItems Value for List of UpdateInvoiceItem + */ + @JsonSetter("line_items") + public void setLineItems(List lineItems) { + this.lineItems = lineItems; + } + + /** + * Getter for IssueDate. + * New issue date for the invoice (format YYYY-MM-DD). This date is interpreted and validated in + * your site's time zone. It must be today or a date in the past — future dates are not + * accepted. The due date is recalculated from the issue date and net terms. + * @return Returns the LocalDate + */ + @JsonGetter("issue_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.SimpleDateSerializer.class) + public LocalDate getIssueDate() { + return issueDate; + } + + /** + * Setter for IssueDate. + * New issue date for the invoice (format YYYY-MM-DD). This date is interpreted and validated in + * your site's time zone. It must be today or a date in the past — future dates are not + * accepted. The due date is recalculated from the issue date and net terms. + * @param issueDate Value for LocalDate + */ + @JsonSetter("issue_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setIssueDate(LocalDate issueDate) { + this.issueDate = issueDate; + } + + /** + * Getter for NetTerms. + * Number of days after the issue date on which the invoice is due. The due date is recalculated + * when net terms or the issue date change. + * @return Returns the Integer + */ + @JsonGetter("net_terms") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getNetTerms() { + return netTerms; + } + + /** + * Setter for NetTerms. + * Number of days after the issue date on which the invoice is due. The due date is recalculated + * when net terms or the issue date change. + * @param netTerms Value for Integer + */ + @JsonSetter("net_terms") + public void setNetTerms(Integer netTerms) { + this.netTerms = netTerms; + } + + /** + * Getter for PaymentInstructions. + * Custom payment instructions displayed on the invoice. + * @return Returns the String + */ + @JsonGetter("payment_instructions") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaymentInstructions() { + return paymentInstructions; + } + + /** + * Setter for PaymentInstructions. + * Custom payment instructions displayed on the invoice. + * @param paymentInstructions Value for String + */ + @JsonSetter("payment_instructions") + public void setPaymentInstructions(String paymentInstructions) { + this.paymentInstructions = paymentInstructions; + } + + /** + * Getter for Memo. + * A custom memo displayed on the invoice. + * @return Returns the String + */ + @JsonGetter("memo") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getMemo() { + return memo; + } + + /** + * Setter for Memo. + * A custom memo displayed on the invoice. + * @param memo Value for String + */ + @JsonSetter("memo") + public void setMemo(String memo) { + this.memo = memo; + } + + /** + * Getter for SellerAddress. + * Replaces the seller address on the invoice + * @return Returns the CreateInvoiceAddress + */ + @JsonGetter("seller_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CreateInvoiceAddress getSellerAddress() { + return sellerAddress; + } + + /** + * Setter for SellerAddress. + * Replaces the seller address on the invoice + * @param sellerAddress Value for CreateInvoiceAddress + */ + @JsonSetter("seller_address") + public void setSellerAddress(CreateInvoiceAddress sellerAddress) { + this.sellerAddress = sellerAddress; + } + + /** + * Getter for BillingAddress. + * Replaces the billing address on the invoice + * @return Returns the CreateInvoiceAddress + */ + @JsonGetter("billing_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CreateInvoiceAddress getBillingAddress() { + return billingAddress; + } + + /** + * Setter for BillingAddress. + * Replaces the billing address on the invoice + * @param billingAddress Value for CreateInvoiceAddress + */ + @JsonSetter("billing_address") + public void setBillingAddress(CreateInvoiceAddress billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * Getter for ShippingAddress. + * Replaces the shipping address on the invoice + * @return Returns the CreateInvoiceAddress + */ + @JsonGetter("shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CreateInvoiceAddress getShippingAddress() { + return shippingAddress; + } + + /** + * Setter for ShippingAddress. + * Replaces the shipping address on the invoice + * @param shippingAddress Value for CreateInvoiceAddress + */ + @JsonSetter("shipping_address") + public void setShippingAddress(CreateInvoiceAddress shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * Getter for Coupons. + * When present, replaces all discounts currently applied to the invoice. Send an empty array to + * remove all discounts. + * @return Returns the List of CreateInvoiceCoupon + */ + @JsonGetter("coupons") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getCoupons() { + return coupons; + } + + /** + * Setter for Coupons. + * When present, replaces all discounts currently applied to the invoice. Send an empty array to + * remove all discounts. + * @param coupons Value for List of CreateInvoiceCoupon + */ + @JsonSetter("coupons") + public void setCoupons(List coupons) { + this.coupons = coupons; + } + + /** + * Converts this UpdateInvoice into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "UpdateInvoice [" + "lineItems=" + lineItems + ", issueDate=" + issueDate + + ", netTerms=" + netTerms + ", paymentInstructions=" + paymentInstructions + + ", memo=" + memo + ", sellerAddress=" + sellerAddress + ", billingAddress=" + + billingAddress + ", shippingAddress=" + shippingAddress + ", coupons=" + coupons + + ", additionalProperties=" + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link UpdateInvoice.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link UpdateInvoice.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .lineItems(getLineItems()) + .issueDate(getIssueDate()) + .netTerms(getNetTerms()) + .paymentInstructions(getPaymentInstructions()) + .memo(getMemo()) + .sellerAddress(getSellerAddress()) + .billingAddress(getBillingAddress()) + .shippingAddress(getShippingAddress()) + .coupons(getCoupons()); + return builder; + } + + /** + * Class to build instances of {@link UpdateInvoice}. + */ + public static class Builder { + private List lineItems; + private LocalDate issueDate; + private Integer netTerms; + private String paymentInstructions; + private String memo; + private CreateInvoiceAddress sellerAddress; + private CreateInvoiceAddress billingAddress; + private CreateInvoiceAddress shippingAddress; + private List coupons; + + + + /** + * Setter for lineItems. + * @param lineItems List of UpdateInvoiceItem value for lineItems. + * @return Builder + */ + public Builder lineItems(List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * Setter for issueDate. + * @param issueDate LocalDate value for issueDate. + * @return Builder + */ + public Builder issueDate(LocalDate issueDate) { + this.issueDate = issueDate; + return this; + } + + /** + * Setter for netTerms. + * @param netTerms Integer value for netTerms. + * @return Builder + */ + public Builder netTerms(Integer netTerms) { + this.netTerms = netTerms; + return this; + } + + /** + * Setter for paymentInstructions. + * @param paymentInstructions String value for paymentInstructions. + * @return Builder + */ + public Builder paymentInstructions(String paymentInstructions) { + this.paymentInstructions = paymentInstructions; + return this; + } + + /** + * Setter for memo. + * @param memo String value for memo. + * @return Builder + */ + public Builder memo(String memo) { + this.memo = memo; + return this; + } + + /** + * Setter for sellerAddress. + * @param sellerAddress CreateInvoiceAddress value for sellerAddress. + * @return Builder + */ + public Builder sellerAddress(CreateInvoiceAddress sellerAddress) { + this.sellerAddress = sellerAddress; + return this; + } + + /** + * Setter for billingAddress. + * @param billingAddress CreateInvoiceAddress value for billingAddress. + * @return Builder + */ + public Builder billingAddress(CreateInvoiceAddress billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + /** + * Setter for shippingAddress. + * @param shippingAddress CreateInvoiceAddress value for shippingAddress. + * @return Builder + */ + public Builder shippingAddress(CreateInvoiceAddress shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Setter for coupons. + * @param coupons List of CreateInvoiceCoupon value for coupons. + * @return Builder + */ + public Builder coupons(List coupons) { + this.coupons = coupons; + return this; + } + + /** + * Builds a new {@link UpdateInvoice} object using the set fields. + * @return {@link UpdateInvoice} + */ + public UpdateInvoice build() { + return new UpdateInvoice(lineItems, issueDate, netTerms, paymentInstructions, memo, + sellerAddress, billingAddress, shippingAddress, coupons); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateInvoiceItem.java b/src/main/java/com/maxio/advancedbilling/models/UpdateInvoiceItem.java new file mode 100644 index 00000000..8eb9bbcc --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateInvoiceItem.java @@ -0,0 +1,613 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemComponentId; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemPricePointId; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemProductId; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemProductPricePointId; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemQuantity; +import com.maxio.advancedbilling.models.containers.UpdateInvoiceItemUnitPrice; +import io.apimatic.core.types.BaseModel; + +/** + * This is a model class for UpdateInvoiceItem type. + */ +public class UpdateInvoiceItem + extends BaseModel { + private String title; + private UpdateInvoiceItemQuantity quantity; + private UpdateInvoiceItemUnitPrice unitPrice; + private Boolean taxable; + private String taxCode; + private String periodRangeStart; + private String periodRangeEnd; + private UpdateInvoiceItemProductId productId; + private UpdateInvoiceItemComponentId componentId; + private UpdateInvoiceItemPricePointId pricePointId; + private UpdateInvoiceItemProductPricePointId productPricePointId; + private String description; + private String uid; + private Boolean destroy; + + /** + * Default constructor. + */ + public UpdateInvoiceItem() { + } + + /** + * Initialization constructor. + * @param title String value for title. + * @param quantity UpdateInvoiceItemQuantity value for quantity. + * @param unitPrice UpdateInvoiceItemUnitPrice value for unitPrice. + * @param taxable Boolean value for taxable. + * @param taxCode String value for taxCode. + * @param periodRangeStart String value for periodRangeStart. + * @param periodRangeEnd String value for periodRangeEnd. + * @param productId UpdateInvoiceItemProductId value for productId. + * @param componentId UpdateInvoiceItemComponentId value for componentId. + * @param pricePointId UpdateInvoiceItemPricePointId value for pricePointId. + * @param productPricePointId UpdateInvoiceItemProductPricePointId value for + * productPricePointId. + * @param description String value for description. + * @param uid String value for uid. + * @param destroy Boolean value for destroy. + */ + public UpdateInvoiceItem( + String title, + UpdateInvoiceItemQuantity quantity, + UpdateInvoiceItemUnitPrice unitPrice, + Boolean taxable, + String taxCode, + String periodRangeStart, + String periodRangeEnd, + UpdateInvoiceItemProductId productId, + UpdateInvoiceItemComponentId componentId, + UpdateInvoiceItemPricePointId pricePointId, + UpdateInvoiceItemProductPricePointId productPricePointId, + String description, + String uid, + Boolean destroy) { + this.title = title; + this.quantity = quantity; + this.unitPrice = unitPrice; + this.taxable = taxable; + this.taxCode = taxCode; + this.periodRangeStart = periodRangeStart; + this.periodRangeEnd = periodRangeEnd; + this.productId = productId; + this.componentId = componentId; + this.pricePointId = pricePointId; + this.productPricePointId = productPricePointId; + this.description = description; + this.uid = uid; + this.destroy = destroy; + } + + /** + * Getter for Title. + * @return Returns the String + */ + @JsonGetter("title") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTitle() { + return title; + } + + /** + * Setter for Title. + * @param title Value for String + */ + @JsonSetter("title") + public void setTitle(String title) { + this.title = title; + } + + /** + * Getter for Quantity. + * The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you + * submit a value with more than 8 decimal places, we will round it down to the 8th decimal + * place. + * @return Returns the UpdateInvoiceItemQuantity + */ + @JsonGetter("quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UpdateInvoiceItemQuantity getQuantity() { + return quantity; + } + + /** + * Setter for Quantity. + * The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you + * submit a value with more than 8 decimal places, we will round it down to the 8th decimal + * place. + * @param quantity Value for UpdateInvoiceItemQuantity + */ + @JsonSetter("quantity") + public void setQuantity(UpdateInvoiceItemQuantity quantity) { + this.quantity = quantity; + } + + /** + * Getter for UnitPrice. + * The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you + * submit a value with more than 8 decimal places, we will round it down to the 8th decimal + * place. + * @return Returns the UpdateInvoiceItemUnitPrice + */ + @JsonGetter("unit_price") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UpdateInvoiceItemUnitPrice getUnitPrice() { + return unitPrice; + } + + /** + * Setter for UnitPrice. + * The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you + * submit a value with more than 8 decimal places, we will round it down to the 8th decimal + * place. + * @param unitPrice Value for UpdateInvoiceItemUnitPrice + */ + @JsonSetter("unit_price") + public void setUnitPrice(UpdateInvoiceItemUnitPrice unitPrice) { + this.unitPrice = unitPrice; + } + + /** + * Getter for Taxable. + * Set to true to automatically calculate taxes. Site must be configured to use and calculate + * taxes. If using AvaTax, a tax_code parameter must also be sent. + * @return Returns the Boolean + */ + @JsonGetter("taxable") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getTaxable() { + return taxable; + } + + /** + * Setter for Taxable. + * Set to true to automatically calculate taxes. Site must be configured to use and calculate + * taxes. If using AvaTax, a tax_code parameter must also be sent. + * @param taxable Value for Boolean + */ + @JsonSetter("taxable") + public void setTaxable(Boolean taxable) { + this.taxable = taxable; + } + + /** + * Getter for TaxCode. + * A string representing the tax code related to the product type. This is especially important + * when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. + * @return Returns the String + */ + @JsonGetter("tax_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTaxCode() { + return taxCode; + } + + /** + * Setter for TaxCode. + * A string representing the tax code related to the product type. This is especially important + * when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. + * @param taxCode Value for String + */ + @JsonSetter("tax_code") + public void setTaxCode(String taxCode) { + this.taxCode = taxCode; + } + + /** + * Getter for PeriodRangeStart. + * YYYY-MM-DD + * @return Returns the String + */ + @JsonGetter("period_range_start") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPeriodRangeStart() { + return periodRangeStart; + } + + /** + * Setter for PeriodRangeStart. + * YYYY-MM-DD + * @param periodRangeStart Value for String + */ + @JsonSetter("period_range_start") + public void setPeriodRangeStart(String periodRangeStart) { + this.periodRangeStart = periodRangeStart; + } + + /** + * Getter for PeriodRangeEnd. + * YYYY-MM-DD + * @return Returns the String + */ + @JsonGetter("period_range_end") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPeriodRangeEnd() { + return periodRangeEnd; + } + + /** + * Setter for PeriodRangeEnd. + * YYYY-MM-DD + * @param periodRangeEnd Value for String + */ + @JsonSetter("period_range_end") + public void setPeriodRangeEnd(String periodRangeEnd) { + this.periodRangeEnd = periodRangeEnd; + } + + /** + * Getter for ProductId. + * Product handle or product id. + * @return Returns the UpdateInvoiceItemProductId + */ + @JsonGetter("product_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UpdateInvoiceItemProductId getProductId() { + return productId; + } + + /** + * Setter for ProductId. + * Product handle or product id. + * @param productId Value for UpdateInvoiceItemProductId + */ + @JsonSetter("product_id") + public void setProductId(UpdateInvoiceItemProductId productId) { + this.productId = productId; + } + + /** + * Getter for ComponentId. + * Component handle or component id. + * @return Returns the UpdateInvoiceItemComponentId + */ + @JsonGetter("component_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UpdateInvoiceItemComponentId getComponentId() { + return componentId; + } + + /** + * Setter for ComponentId. + * Component handle or component id. + * @param componentId Value for UpdateInvoiceItemComponentId + */ + @JsonSetter("component_id") + public void setComponentId(UpdateInvoiceItemComponentId componentId) { + this.componentId = componentId; + } + + /** + * Getter for PricePointId. + * Price point handle or id. For component. + * @return Returns the UpdateInvoiceItemPricePointId + */ + @JsonGetter("price_point_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UpdateInvoiceItemPricePointId getPricePointId() { + return pricePointId; + } + + /** + * Setter for PricePointId. + * Price point handle or id. For component. + * @param pricePointId Value for UpdateInvoiceItemPricePointId + */ + @JsonSetter("price_point_id") + public void setPricePointId(UpdateInvoiceItemPricePointId pricePointId) { + this.pricePointId = pricePointId; + } + + /** + * Getter for ProductPricePointId. + * @return Returns the UpdateInvoiceItemProductPricePointId + */ + @JsonGetter("product_price_point_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public UpdateInvoiceItemProductPricePointId getProductPricePointId() { + return productPricePointId; + } + + /** + * Setter for ProductPricePointId. + * @param productPricePointId Value for UpdateInvoiceItemProductPricePointId + */ + @JsonSetter("product_price_point_id") + public void setProductPricePointId(UpdateInvoiceItemProductPricePointId productPricePointId) { + this.productPricePointId = productPricePointId; + } + + /** + * Getter for Description. + * @return Returns the String + */ + @JsonGetter("description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Getter for Uid. + * Unique identifier of an existing line item on the invoice. When provided, the matching line + * item is updated with the submitted attributes. When omitted, a new line item is added to the + * invoice. + * @return Returns the String + */ + @JsonGetter("uid") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUid() { + return uid; + } + + /** + * Setter for Uid. + * Unique identifier of an existing line item on the invoice. When provided, the matching line + * item is updated with the submitted attributes. When omitted, a new line item is added to the + * invoice. + * @param uid Value for String + */ + @JsonSetter("uid") + public void setUid(String uid) { + this.uid = uid; + } + + /** + * Getter for Destroy. + * Set to `true` together with `uid` to remove the matching line item from the invoice. Line + * items not referenced in the request remain unchanged. + * @return Returns the Boolean + */ + @JsonGetter("_destroy") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getDestroy() { + return destroy; + } + + /** + * Setter for Destroy. + * Set to `true` together with `uid` to remove the matching line item from the invoice. Line + * items not referenced in the request remain unchanged. + * @param destroy Value for Boolean + */ + @JsonSetter("_destroy") + public void setDestroy(Boolean destroy) { + this.destroy = destroy; + } + + /** + * Converts this UpdateInvoiceItem into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "UpdateInvoiceItem [" + "title=" + title + ", quantity=" + quantity + ", unitPrice=" + + unitPrice + ", taxable=" + taxable + ", taxCode=" + taxCode + + ", periodRangeStart=" + periodRangeStart + ", periodRangeEnd=" + periodRangeEnd + + ", productId=" + productId + ", componentId=" + componentId + ", pricePointId=" + + pricePointId + ", productPricePointId=" + productPricePointId + ", description=" + + description + ", uid=" + uid + ", destroy=" + destroy + ", additionalProperties=" + + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link UpdateInvoiceItem.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link UpdateInvoiceItem.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .title(getTitle()) + .quantity(getQuantity()) + .unitPrice(getUnitPrice()) + .taxable(getTaxable()) + .taxCode(getTaxCode()) + .periodRangeStart(getPeriodRangeStart()) + .periodRangeEnd(getPeriodRangeEnd()) + .productId(getProductId()) + .componentId(getComponentId()) + .pricePointId(getPricePointId()) + .productPricePointId(getProductPricePointId()) + .description(getDescription()) + .uid(getUid()) + .destroy(getDestroy()); + return builder; + } + + /** + * Class to build instances of {@link UpdateInvoiceItem}. + */ + public static class Builder { + private String title; + private UpdateInvoiceItemQuantity quantity; + private UpdateInvoiceItemUnitPrice unitPrice; + private Boolean taxable; + private String taxCode; + private String periodRangeStart; + private String periodRangeEnd; + private UpdateInvoiceItemProductId productId; + private UpdateInvoiceItemComponentId componentId; + private UpdateInvoiceItemPricePointId pricePointId; + private UpdateInvoiceItemProductPricePointId productPricePointId; + private String description; + private String uid; + private Boolean destroy; + + + + /** + * Setter for title. + * @param title String value for title. + * @return Builder + */ + public Builder title(String title) { + this.title = title; + return this; + } + + /** + * Setter for quantity. + * @param quantity UpdateInvoiceItemQuantity value for quantity. + * @return Builder + */ + public Builder quantity(UpdateInvoiceItemQuantity quantity) { + this.quantity = quantity; + return this; + } + + /** + * Setter for unitPrice. + * @param unitPrice UpdateInvoiceItemUnitPrice value for unitPrice. + * @return Builder + */ + public Builder unitPrice(UpdateInvoiceItemUnitPrice unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + /** + * Setter for taxable. + * @param taxable Boolean value for taxable. + * @return Builder + */ + public Builder taxable(Boolean taxable) { + this.taxable = taxable; + return this; + } + + /** + * Setter for taxCode. + * @param taxCode String value for taxCode. + * @return Builder + */ + public Builder taxCode(String taxCode) { + this.taxCode = taxCode; + return this; + } + + /** + * Setter for periodRangeStart. + * @param periodRangeStart String value for periodRangeStart. + * @return Builder + */ + public Builder periodRangeStart(String periodRangeStart) { + this.periodRangeStart = periodRangeStart; + return this; + } + + /** + * Setter for periodRangeEnd. + * @param periodRangeEnd String value for periodRangeEnd. + * @return Builder + */ + public Builder periodRangeEnd(String periodRangeEnd) { + this.periodRangeEnd = periodRangeEnd; + return this; + } + + /** + * Setter for productId. + * @param productId UpdateInvoiceItemProductId value for productId. + * @return Builder + */ + public Builder productId(UpdateInvoiceItemProductId productId) { + this.productId = productId; + return this; + } + + /** + * Setter for componentId. + * @param componentId UpdateInvoiceItemComponentId value for componentId. + * @return Builder + */ + public Builder componentId(UpdateInvoiceItemComponentId componentId) { + this.componentId = componentId; + return this; + } + + /** + * Setter for pricePointId. + * @param pricePointId UpdateInvoiceItemPricePointId value for pricePointId. + * @return Builder + */ + public Builder pricePointId(UpdateInvoiceItemPricePointId pricePointId) { + this.pricePointId = pricePointId; + return this; + } + + /** + * Setter for productPricePointId. + * @param productPricePointId UpdateInvoiceItemProductPricePointId value for + * productPricePointId. + * @return Builder + */ + public Builder productPricePointId( + UpdateInvoiceItemProductPricePointId productPricePointId) { + this.productPricePointId = productPricePointId; + return this; + } + + /** + * Setter for description. + * @param description String value for description. + * @return Builder + */ + public Builder description(String description) { + this.description = description; + return this; + } + + /** + * Setter for uid. + * @param uid String value for uid. + * @return Builder + */ + public Builder uid(String uid) { + this.uid = uid; + return this; + } + + /** + * Setter for destroy. + * @param destroy Boolean value for destroy. + * @return Builder + */ + public Builder destroy(Boolean destroy) { + this.destroy = destroy; + return this; + } + + /** + * Builds a new {@link UpdateInvoiceItem} object using the set fields. + * @return {@link UpdateInvoiceItem} + */ + public UpdateInvoiceItem build() { + return new UpdateInvoiceItem(title, quantity, unitPrice, taxable, taxCode, + periodRangeStart, periodRangeEnd, productId, componentId, pricePointId, + productPricePointId, description, uid, destroy); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateInvoiceRequest.java b/src/main/java/com/maxio/advancedbilling/models/UpdateInvoiceRequest.java new file mode 100644 index 00000000..4f2e9968 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateInvoiceRequest.java @@ -0,0 +1,115 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; + +import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonSetter; +import io.apimatic.core.types.BaseModel; + +/** + * This is a model class for UpdateInvoiceRequest type. + */ +public class UpdateInvoiceRequest + extends BaseModel { + private UpdateInvoice invoice; + + /** + * Default constructor. + */ + public UpdateInvoiceRequest() { + } + + /** + * Initialization constructor. + * @param invoice UpdateInvoice value for invoice. + */ + public UpdateInvoiceRequest( + UpdateInvoice invoice) { + this.invoice = invoice; + } + + /** + * Getter for Invoice. + * Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are + * changed. + * @return Returns the UpdateInvoice + */ + @JsonGetter("invoice") + public UpdateInvoice getInvoice() { + return invoice; + } + + /** + * Setter for Invoice. + * Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are + * changed. + * @param invoice Value for UpdateInvoice + */ + @JsonSetter("invoice") + public void setInvoice(UpdateInvoice invoice) { + this.invoice = invoice; + } + + /** + * Converts this UpdateInvoiceRequest into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "UpdateInvoiceRequest [" + "invoice=" + invoice + ", additionalProperties=" + + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link UpdateInvoiceRequest.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link UpdateInvoiceRequest.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(invoice); + return builder; + } + + /** + * Class to build instances of {@link UpdateInvoiceRequest}. + */ + public static class Builder { + private UpdateInvoice invoice; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param invoice UpdateInvoice value for invoice. + */ + public Builder(UpdateInvoice invoice) { + this.invoice = invoice; + } + + /** + * Setter for invoice. + * @param invoice UpdateInvoice value for invoice. + * @return Builder + */ + public Builder invoice(UpdateInvoice invoice) { + this.invoice = invoice; + return this; + } + + /** + * Builds a new {@link UpdateInvoiceRequest} object using the set fields. + * @return {@link UpdateInvoiceRequest} + */ + public UpdateInvoiceRequest build() { + return new UpdateInvoiceRequest(invoice); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdatePaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/UpdatePaymentProfile.java index 3af84b81..b5185aa2 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpdatePaymentProfile.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpdatePaymentProfile.java @@ -206,7 +206,7 @@ public void setCardType(CardType cardType) { /** * Getter for ExpirationMonth. * (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit - * credit card expiration month, as an integer or string, i.e. 5 + * credit card expiration month, as an integer or string, e.g., 5 * @return Returns the String */ @JsonGetter("expiration_month") @@ -218,7 +218,7 @@ public String getExpirationMonth() { /** * Setter for ExpirationMonth. * (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit - * credit card expiration month, as an integer or string, i.e. 5 + * credit card expiration month, as an integer or string, e.g., 5 * @param expirationMonth Value for String */ @JsonSetter("expiration_month") @@ -228,8 +228,8 @@ public void setExpirationMonth(String expirationMonth) { /** * Getter for ExpirationYear. - * (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit - * card expiration year, as an integer or string, i.e. 2012 + * (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit + * card expiration year, as an integer or string, e.g., 2012 * @return Returns the String */ @JsonGetter("expiration_year") @@ -240,8 +240,8 @@ public String getExpirationYear() { /** * Setter for ExpirationYear. - * (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit - * card expiration year, as an integer or string, i.e. 2012 + * (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit + * card expiration year, as an integer or string, e.g., 2012 * @param expirationYear Value for String */ @JsonSetter("expiration_year") @@ -274,7 +274,7 @@ public void setCurrentVault(AllVaults currentVault) { /** * Getter for BillingAddress. - * The credit card or bank account billing street address (i.e. 123 Main St.). This value is + * The credit card or bank account billing street address (e.g., 123 Main St.). This value is * merely passed through to the payment gateway. * @return Returns the String */ @@ -286,7 +286,7 @@ public String getBillingAddress() { /** * Setter for BillingAddress. - * The credit card or bank account billing street address (i.e. 123 Main St.). This value is + * The credit card or bank account billing street address (e.g., 123 Main St.). This value is * merely passed through to the payment gateway. * @param billingAddress Value for String */ @@ -297,7 +297,7 @@ public void setBillingAddress(String billingAddress) { /** * Getter for BillingCity. - * The credit card or bank account billing address city (i.e. “Boston”). This value is merely + * The credit card or bank account billing address city (e.g., “Boston”). This value is merely * passed through to the payment gateway. * @return Returns the String */ @@ -309,7 +309,7 @@ public String getBillingCity() { /** * Setter for BillingCity. - * The credit card or bank account billing address city (i.e. “Boston”). This value is merely + * The credit card or bank account billing address city (e.g., “Boston”). This value is merely * passed through to the payment gateway. * @param billingCity Value for String */ @@ -320,7 +320,7 @@ public void setBillingCity(String billingCity) { /** * Getter for BillingState. - * The credit card or bank account billing address state (i.e. MA). This value is merely passed + * The credit card or bank account billing address state (e.g., MA). This value is merely passed * through to the payment gateway. This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for * tax locale purposes. @@ -334,7 +334,7 @@ public String getBillingState() { /** * Setter for BillingState. - * The credit card or bank account billing address state (i.e. MA). This value is merely passed + * The credit card or bank account billing address state (e.g., MA). This value is merely passed * through to the payment gateway. This must conform to the * [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for * tax locale purposes. @@ -347,7 +347,7 @@ public void setBillingState(String billingState) { /** * Getter for BillingZip. - * The credit card or bank account billing address zip code (i.e. 12345). This value is merely + * The credit card or bank account billing address zip code (e.g., 12345). This value is merely * passed through to the payment gateway. * @return Returns the String */ @@ -359,7 +359,7 @@ public String getBillingZip() { /** * Setter for BillingZip. - * The credit card or bank account billing address zip code (i.e. 12345). This value is merely + * The credit card or bank account billing address zip code (e.g., 12345). This value is merely * passed through to the payment gateway. * @param billingZip Value for String */ @@ -371,7 +371,7 @@ public void setBillingZip(String billingZip) { /** * Getter for BillingCountry. * The credit card or bank account billing address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is * merely passed through to the payment gateway. Some gateways require country codes in a * specific format. Check your gateway’s documentation. If creating an ACH subscription, only US * is supported at this time. @@ -386,7 +386,7 @@ public String getBillingCountry() { /** * Setter for BillingCountry. * The credit card or bank account billing address country, required in [ISO_3166-1 - * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is * merely passed through to the payment gateway. Some gateways require country codes in a * specific format. Check your gateway’s documentation. If creating an ACH subscription, only US * is supported at this time. @@ -399,7 +399,7 @@ public void setBillingCountry(String billingCountry) { /** * Internal Getter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address, e.g., Apt. 100 * @return Returns the Internal String */ @JsonGetter("billing_address_2") @@ -411,7 +411,7 @@ protected OptionalNullable internalGetBillingAddress2() { /** * Getter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address, e.g., Apt. 100 * @return Returns the String */ public String getBillingAddress2() { @@ -420,7 +420,7 @@ public String getBillingAddress2() { /** * Setter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address, e.g., Apt. 100 * @param billingAddress2 Value for String */ @JsonSetter("billing_address_2") @@ -430,7 +430,7 @@ public void setBillingAddress2(String billingAddress2) { /** * UnSetter for BillingAddress2. - * Second line of the customer’s billing address i.e. Apt. 100 + * Second line of the customer’s billing address, e.g., Apt. 100 */ public void unsetBillingAddress2() { billingAddress2 = null; diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdatePrice.java b/src/main/java/com/maxio/advancedbilling/models/UpdatePrice.java index e21ee0b9..c8746f0a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpdatePrice.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpdatePrice.java @@ -92,7 +92,7 @@ public void setEndingQuantity(UpdatePriceEndingQuantity endingQuantity) { /** * Getter for UnitPrice. - * The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 * @return Returns the UpdatePriceUnitPrice */ @JsonGetter("unit_price") @@ -103,7 +103,7 @@ public UpdatePriceUnitPrice getUnitPrice() { /** * Setter for UnitPrice. - * The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 + * The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 * @param unitPrice Value for UpdatePriceUnitPrice */ @JsonSetter("unit_price") diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateSubscription.java b/src/main/java/com/maxio/advancedbilling/models/UpdateSubscription.java index 43ad063a..ac9b726d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpdateSubscription.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateSubscription.java @@ -34,6 +34,7 @@ public class UpdateSubscription private ZonedDateTime initialBillingAt; private Boolean deferSignup; private ZonedDateTime nextBillingAt; + private OptionalNullable brandingThemeId; private ZonedDateTime expiresAt; private String paymentCollectionMethod; private Boolean receivesInvoiceEmails; @@ -66,6 +67,7 @@ public UpdateSubscription() { * @param initialBillingAt ZonedDateTime value for initialBillingAt. * @param deferSignup Boolean value for deferSignup. * @param nextBillingAt ZonedDateTime value for nextBillingAt. + * @param brandingThemeId Integer value for brandingThemeId. * @param expiresAt ZonedDateTime value for expiresAt. * @param paymentCollectionMethod String value for paymentCollectionMethod. * @param receivesInvoiceEmails Boolean value for receivesInvoiceEmails. @@ -91,6 +93,7 @@ public UpdateSubscription( ZonedDateTime initialBillingAt, Boolean deferSignup, ZonedDateTime nextBillingAt, + Integer brandingThemeId, ZonedDateTime expiresAt, String paymentCollectionMethod, Boolean receivesInvoiceEmails, @@ -113,6 +116,7 @@ public UpdateSubscription( this.initialBillingAt = initialBillingAt; this.deferSignup = deferSignup; this.nextBillingAt = nextBillingAt; + this.brandingThemeId = OptionalNullable.of(brandingThemeId); this.expiresAt = expiresAt; this.paymentCollectionMethod = paymentCollectionMethod; this.receivesInvoiceEmails = receivesInvoiceEmails; @@ -140,6 +144,7 @@ public UpdateSubscription( * @param initialBillingAt ZonedDateTime value for initialBillingAt. * @param deferSignup Boolean value for deferSignup. * @param nextBillingAt ZonedDateTime value for nextBillingAt. + * @param brandingThemeId Integer value for brandingThemeId. * @param expiresAt ZonedDateTime value for expiresAt. * @param paymentCollectionMethod String value for paymentCollectionMethod. * @param receivesInvoiceEmails Boolean value for receivesInvoiceEmails. @@ -159,7 +164,8 @@ protected UpdateSubscription(CreditCardAttributes creditCardAttributes, String p Integer productId, Boolean productChangeDelayed, String nextProductId, String nextProductPricePointId, UpdateSubscriptionSnapDay snapDay, ZonedDateTime initialBillingAt, Boolean deferSignup, ZonedDateTime nextBillingAt, - ZonedDateTime expiresAt, String paymentCollectionMethod, Boolean receivesInvoiceEmails, + OptionalNullable brandingThemeId, ZonedDateTime expiresAt, + String paymentCollectionMethod, Boolean receivesInvoiceEmails, UpdateSubscriptionNetTerms netTerms, Integer storedCredentialTransactionId, String reference, SubscriptionCustomPrice customPrice, List components, Boolean dunningCommunicationDelayEnabled, @@ -175,6 +181,7 @@ protected UpdateSubscription(CreditCardAttributes creditCardAttributes, String p this.initialBillingAt = initialBillingAt; this.deferSignup = deferSignup; this.nextBillingAt = nextBillingAt; + this.brandingThemeId = brandingThemeId; this.expiresAt = expiresAt; this.paymentCollectionMethod = paymentCollectionMethod; this.receivesInvoiceEmails = receivesInvoiceEmails; @@ -210,7 +217,7 @@ public void setCreditCardAttributes(CreditCardAttributes creditCardAttributes) { /** * Getter for ProductHandle. - * Set to the handle of a different product to change the subscription's product + * Set to the handle of a different product to change the subscription's product. * @return Returns the String */ @JsonGetter("product_handle") @@ -221,7 +228,7 @@ public String getProductHandle() { /** * Setter for ProductHandle. - * Set to the handle of a different product to change the subscription's product + * Set to the handle of a different product to change the subscription's product. * @param productHandle Value for String */ @JsonSetter("product_handle") @@ -231,7 +238,7 @@ public void setProductHandle(String productHandle) { /** * Getter for ProductId. - * Set to the id of a different product to change the subscription's product + * Set to the id of a different product to change the subscription's product. * @return Returns the Integer */ @JsonGetter("product_id") @@ -242,7 +249,7 @@ public Integer getProductId() { /** * Setter for ProductId. - * Set to the id of a different product to change the subscription's product + * Set to the id of a different product to change the subscription's product. * @param productId Value for Integer */ @JsonSetter("product_id") @@ -334,7 +341,7 @@ public void setSnapDay(UpdateSubscriptionSnapDay snapDay) { * Getter for InitialBillingAt. * (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting * Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves - * like any other. It can be canceled, allocated to, or have its billing date changed. etc. When + * like any other. It can be canceled, allocated to, or have its billing date changed, etc. When * the `initial_billing_at` date hits, the subscription will transition to the expected state. * If the product has a trial, the subscription will enter a trial, otherwise it will go active. * Setup fees will be respected either before or after the trial, as configured on the price @@ -356,7 +363,7 @@ public ZonedDateTime getInitialBillingAt() { * Setter for InitialBillingAt. * (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting * Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves - * like any other. It can be canceled, allocated to, or have its billing date changed. etc. When + * like any other. It can be canceled, allocated to, or have its billing date changed, etc. When * the `initial_billing_at` date hits, the subscription will transition to the expected state. * If the product has a trial, the subscription will enter a trial, otherwise it will go active. * Setup fees will be respected either before or after the trial, as configured on the price @@ -429,6 +436,61 @@ public void setNextBillingAt(ZonedDateTime nextBillingAt) { this.nextBillingAt = nextBillingAt; } + /** + * Internal Getter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + * @return Returns the Internal Integer + */ + @JsonGetter("branding_theme_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBrandingThemeId() { + return this.brandingThemeId; + } + + /** + * Getter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + * @return Returns the Integer + */ + public Integer getBrandingThemeId() { + return OptionalNullable.getFrom(brandingThemeId); + } + + /** + * Setter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + * @param brandingThemeId Value for Integer + */ + @JsonSetter("branding_theme_id") + public void setBrandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + } + + /** + * UnSetter for BrandingThemeId. + * The ID of the Branding Theme to assign to this subscription. When set, this + * subscription-level Branding Theme is used instead of the customer's default Branding Theme + * for subscription-related documents and communications that use subscription theming. Pass + * null or an empty value to clear the subscription-level Branding Theme. Available only when + * Branding Themes are enabled for the site. Not returned in the response. + */ + public void unsetBrandingThemeId() { + brandingThemeId = null; + } + /** * Getter for ExpiresAt. * Timestamp giving the expiration date of this subscription (if any). You may manually change @@ -713,11 +775,12 @@ public String toString() { + nextProductId + ", nextProductPricePointId=" + nextProductPricePointId + ", snapDay=" + snapDay + ", initialBillingAt=" + initialBillingAt + ", deferSignup=" + deferSignup + ", nextBillingAt=" + nextBillingAt - + ", expiresAt=" + expiresAt + ", paymentCollectionMethod=" - + paymentCollectionMethod + ", receivesInvoiceEmails=" + receivesInvoiceEmails - + ", netTerms=" + netTerms + ", storedCredentialTransactionId=" - + storedCredentialTransactionId + ", reference=" + reference + ", customPrice=" - + customPrice + ", components=" + components + ", dunningCommunicationDelayEnabled=" + + ", brandingThemeId=" + brandingThemeId + ", expiresAt=" + expiresAt + + ", paymentCollectionMethod=" + paymentCollectionMethod + + ", receivesInvoiceEmails=" + receivesInvoiceEmails + ", netTerms=" + netTerms + + ", storedCredentialTransactionId=" + storedCredentialTransactionId + + ", reference=" + reference + ", customPrice=" + customPrice + ", components=" + + components + ", dunningCommunicationDelayEnabled=" + dunningCommunicationDelayEnabled + ", dunningCommunicationDelayTimeZone=" + dunningCommunicationDelayTimeZone + ", productPricePointId=" + productPricePointId + ", productPricePointHandle=" + productPricePointHandle + ", additionalProperties=" @@ -752,6 +815,7 @@ public Builder toBuilder() { .dunningCommunicationDelayEnabled(getDunningCommunicationDelayEnabled()) .productPricePointId(getProductPricePointId()) .productPricePointHandle(getProductPricePointHandle()); + builder.brandingThemeId = internalGetBrandingThemeId(); builder.dunningCommunicationDelayTimeZone = internalGetDunningCommunicationDelayTimeZone(); return builder; } @@ -770,6 +834,7 @@ public static class Builder { private ZonedDateTime initialBillingAt; private Boolean deferSignup = false; private ZonedDateTime nextBillingAt; + private OptionalNullable brandingThemeId; private ZonedDateTime expiresAt; private String paymentCollectionMethod; private Boolean receivesInvoiceEmails; @@ -885,6 +950,25 @@ public Builder nextBillingAt(ZonedDateTime nextBillingAt) { return this; } + /** + * Setter for brandingThemeId. + * @param brandingThemeId Integer value for brandingThemeId. + * @return Builder + */ + public Builder brandingThemeId(Integer brandingThemeId) { + this.brandingThemeId = OptionalNullable.of(brandingThemeId); + return this; + } + + /** + * UnSetter for brandingThemeId. + * @return Builder + */ + public Builder unsetBrandingThemeId() { + brandingThemeId = null; + return this; + } + /** * Setter for expiresAt. * @param expiresAt ZonedDateTime value for expiresAt. @@ -1026,7 +1110,7 @@ public Builder productPricePointHandle(String productPricePointHandle) { public UpdateSubscription build() { return new UpdateSubscription(creditCardAttributes, productHandle, productId, productChangeDelayed, nextProductId, nextProductPricePointId, snapDay, - initialBillingAt, deferSignup, nextBillingAt, expiresAt, + initialBillingAt, deferSignup, nextBillingAt, brandingThemeId, expiresAt, paymentCollectionMethod, receivesInvoiceEmails, netTerms, storedCredentialTransactionId, reference, customPrice, components, dunningCommunicationDelayEnabled, dunningCommunicationDelayTimeZone, diff --git a/src/main/java/com/maxio/advancedbilling/models/UpgradeChargeCreditType.java b/src/main/java/com/maxio/advancedbilling/models/UpgradeChargeCreditType.java index 37497f5e..da941393 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpgradeChargeCreditType.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpgradeChargeCreditType.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * UpgradeChargeCreditType to be used. */ @@ -23,7 +22,6 @@ public enum UpgradeChargeCreditType { NONE; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/Webhook.java b/src/main/java/com/maxio/advancedbilling/models/Webhook.java index 1bd312ad..7028ce0b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Webhook.java +++ b/src/main/java/com/maxio/advancedbilling/models/Webhook.java @@ -139,9 +139,9 @@ public void setEvent(String event) { /** * Getter for Id. - * The unique identifier for the webhooks (unique across all of Chargify). This is not changed - * on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the - * same event. + * The unique identifier for the webhook (unique across all of Chargify). This is not changed on + * a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same + * event. * @return Returns the Long */ @JsonGetter("id") @@ -152,9 +152,9 @@ public Long getId() { /** * Setter for Id. - * The unique identifier for the webhooks (unique across all of Chargify). This is not changed - * on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the - * same event. + * The unique identifier for the webhook (unique across all of Chargify). This is not changed on + * a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same + * event. * @param id Value for Long */ @JsonSetter("id") @@ -327,9 +327,9 @@ public void setLastSentUrl(String lastSentUrl) { /** * Getter for Successful. - * A boolean flag describing whether the webhook was accepted by the webhook endpoint for the + * “A boolean flag describing whether the webhook was accepted by the webhook endpoint for the * most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a - * reasonable timeframe, i.e. 15 seconds) + * reasonable timeframe, e.g., 15 seconds.)” * @return Returns the Boolean */ @JsonGetter("successful") @@ -340,9 +340,9 @@ public Boolean getSuccessful() { /** * Setter for Successful. - * A boolean flag describing whether the webhook was accepted by the webhook endpoint for the + * “A boolean flag describing whether the webhook was accepted by the webhook endpoint for the * most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a - * reasonable timeframe, i.e. 15 seconds) + * reasonable timeframe, e.g., 15 seconds.)” * @param successful Value for Boolean */ @JsonSetter("successful") diff --git a/src/main/java/com/maxio/advancedbilling/models/WebhookOrder.java b/src/main/java/com/maxio/advancedbilling/models/WebhookOrder.java index 30438658..03dbc3b7 100644 --- a/src/main/java/com/maxio/advancedbilling/models/WebhookOrder.java +++ b/src/main/java/com/maxio/advancedbilling/models/WebhookOrder.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * WebhookOrder to be used. */ @@ -21,7 +20,6 @@ public enum WebhookOrder { OLDEST_FIRST; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/WebhookStatus.java b/src/main/java/com/maxio/advancedbilling/models/WebhookStatus.java index 642fe032..3c76439a 100644 --- a/src/main/java/com/maxio/advancedbilling/models/WebhookStatus.java +++ b/src/main/java/com/maxio/advancedbilling/models/WebhookStatus.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * WebhookStatus to be used. */ @@ -25,7 +24,6 @@ public enum WebhookStatus { PAUSED; - private static TreeMap valueMap = new TreeMap<>(); private String value; diff --git a/src/main/java/com/maxio/advancedbilling/models/WebhookSubscription.java b/src/main/java/com/maxio/advancedbilling/models/WebhookSubscription.java index fb05847f..4a23a762 100644 --- a/src/main/java/com/maxio/advancedbilling/models/WebhookSubscription.java +++ b/src/main/java/com/maxio/advancedbilling/models/WebhookSubscription.java @@ -12,7 +12,6 @@ import java.util.List; import java.util.TreeMap; - /** * WebhookSubscription to be used. */ @@ -77,6 +76,8 @@ public enum WebhookSubscription { SUBSCRIPTION_PRODUCT_CHANGE, + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED, + SUBSCRIPTION_STATE_CHANGE, TRIAL_END_NOTICE, @@ -93,7 +94,6 @@ public enum WebhookSubscription { SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED; - private static TreeMap valueMap = new TreeMap<>(); private String value; @@ -128,6 +128,7 @@ public enum WebhookSubscription { SUBSCRIPTION_CARD_UPDATE.value = "subscription_card_update"; SUBSCRIPTION_GROUP_CARD_UPDATE.value = "subscription_group_card_update"; SUBSCRIPTION_PRODUCT_CHANGE.value = "subscription_product_change"; + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED.value = "subscription_product_change_scheduled"; SUBSCRIPTION_STATE_CHANGE.value = "subscription_state_change"; TRIAL_END_NOTICE.value = "trial_end_notice"; UPCOMING_RENEWAL_NOTICE.value = "upcoming_renewal_notice"; @@ -167,6 +168,7 @@ public enum WebhookSubscription { valueMap.put("subscription_card_update", SUBSCRIPTION_CARD_UPDATE); valueMap.put("subscription_group_card_update", SUBSCRIPTION_GROUP_CARD_UPDATE); valueMap.put("subscription_product_change", SUBSCRIPTION_PRODUCT_CHANGE); + valueMap.put("subscription_product_change_scheduled", SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED); valueMap.put("subscription_state_change", SUBSCRIPTION_STATE_CHANGE); valueMap.put("trial_end_notice", TRIAL_END_NOTICE); valueMap.put("upcoming_renewal_notice", UPCOMING_RENEWAL_NOTICE); diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/CreateSubscriptionComponentUnitBalance.java b/src/main/java/com/maxio/advancedbilling/models/containers/CreateSubscriptionComponentUnitBalance.java new file mode 100644 index 00000000..eca1a57e --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/CreateSubscriptionComponentUnitBalance.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = CreateSubscriptionComponentUnitBalance.CreateSubscriptionComponentUnitBalanceDeserializer.class) +public abstract class CreateSubscriptionComponentUnitBalance { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static CreateSubscriptionComponentUnitBalance fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static CreateSubscriptionComponentUnitBalance fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends CreateSubscriptionComponentUnitBalance { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends CreateSubscriptionComponentUnitBalance { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for CreateSubscriptionComponentUnitBalance. + */ + protected static class CreateSubscriptionComponentUnitBalanceDeserializer + extends JsonDeserializer { + + @Override + public CreateSubscriptionComponentUnitBalance deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/GetOneTimeTokenRequestPaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/containers/GetOneTimeTokenRequestPaymentProfile.java new file mode 100644 index 00000000..ff49347f --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/GetOneTimeTokenRequestPaymentProfile.java @@ -0,0 +1,148 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import com.maxio.advancedbilling.models.GetOneTimeTokenBankAccountPaymentProfile; +import com.maxio.advancedbilling.models.GetOneTimeTokenPaymentProfile; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for any-of types. + */ +@JsonDeserialize(using = GetOneTimeTokenRequestPaymentProfile.GetOneTimeTokenRequestPaymentProfileDeserializer.class) +public abstract class GetOneTimeTokenRequestPaymentProfile { + + /** + * This is Get One Time Token Payment Profile case. + * @param getOneTimeTokenPaymentProfile GetOneTimeTokenPaymentProfile value for getOneTimeTokenPaymentProfile. + * @return The GetOneTimeTokenPaymentProfileCase object. + */ + public static GetOneTimeTokenRequestPaymentProfile fromGetOneTimeTokenPaymentProfile( + GetOneTimeTokenPaymentProfile getOneTimeTokenPaymentProfile) { + return getOneTimeTokenPaymentProfile == null ? null : new GetOneTimeTokenPaymentProfileCase(getOneTimeTokenPaymentProfile); + } + + /** + * This is Get One Time Token Bank Account Payment Profile case. + * @param getOneTimeTokenBankAccountPaymentProfile GetOneTimeTokenBankAccountPaymentProfile value for getOneTimeTokenBankAccountPaymentProfile. + * @return The GetOneTimeTokenBankAccountPaymentProfileCase object. + */ + public static GetOneTimeTokenRequestPaymentProfile fromGetOneTimeTokenBankAccountPaymentProfile( + GetOneTimeTokenBankAccountPaymentProfile getOneTimeTokenBankAccountPaymentProfile) { + return getOneTimeTokenBankAccountPaymentProfile == null ? null : new GetOneTimeTokenBankAccountPaymentProfileCase(getOneTimeTokenBankAccountPaymentProfile); + } + + /** + * Method to match from the provided any-of cases. + * @param The type to return after applying callback. + * @param cases The any-of type cases callback. + * @return The any-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for any-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R getOneTimeTokenPaymentProfile(GetOneTimeTokenPaymentProfile getOneTimeTokenPaymentProfile); + + R getOneTimeTokenBankAccountPaymentProfile(GetOneTimeTokenBankAccountPaymentProfile getOneTimeTokenBankAccountPaymentProfile); + } + + /** + * This is a implementation class for GetOneTimeTokenPaymentProfileCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "GetOneTimeTokenPaymentProfile") + private static class GetOneTimeTokenPaymentProfileCase extends GetOneTimeTokenRequestPaymentProfile { + + @JsonValue + private GetOneTimeTokenPaymentProfile getOneTimeTokenPaymentProfile; + + GetOneTimeTokenPaymentProfileCase(GetOneTimeTokenPaymentProfile getOneTimeTokenPaymentProfile) { + this.getOneTimeTokenPaymentProfile = getOneTimeTokenPaymentProfile; + } + + @Override + public R match(Cases cases) { + return cases.getOneTimeTokenPaymentProfile(this.getOneTimeTokenPaymentProfile); + } + + @JsonCreator + private GetOneTimeTokenPaymentProfileCase(JsonNode jsonNode) throws IOException { + this.getOneTimeTokenPaymentProfile = ApiHelper.deserialize(jsonNode, + GetOneTimeTokenPaymentProfile.class); + } + + @Override + public String toString() { + return getOneTimeTokenPaymentProfile.toString(); + } + } + + /** + * This is a implementation class for GetOneTimeTokenBankAccountPaymentProfileCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "GetOneTimeTokenBankAccountPaymentProfile") + private static class GetOneTimeTokenBankAccountPaymentProfileCase extends GetOneTimeTokenRequestPaymentProfile { + + @JsonValue + private GetOneTimeTokenBankAccountPaymentProfile getOneTimeTokenBankAccountPaymentProfile; + + GetOneTimeTokenBankAccountPaymentProfileCase(GetOneTimeTokenBankAccountPaymentProfile getOneTimeTokenBankAccountPaymentProfile) { + this.getOneTimeTokenBankAccountPaymentProfile = getOneTimeTokenBankAccountPaymentProfile; + } + + @Override + public R match(Cases cases) { + return cases.getOneTimeTokenBankAccountPaymentProfile(this.getOneTimeTokenBankAccountPaymentProfile); + } + + @JsonCreator + private GetOneTimeTokenBankAccountPaymentProfileCase(JsonNode jsonNode) throws IOException { + this.getOneTimeTokenBankAccountPaymentProfile = ApiHelper.deserialize(jsonNode, + GetOneTimeTokenBankAccountPaymentProfile.class); + } + + @Override + public String toString() { + return getOneTimeTokenBankAccountPaymentProfile.toString(); + } + } + + /** + * This is a custom deserializer class for GetOneTimeTokenRequestPaymentProfile. + */ + protected static class GetOneTimeTokenRequestPaymentProfileDeserializer + extends JsonDeserializer { + + @Override + public GetOneTimeTokenRequestPaymentProfile deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList( + GetOneTimeTokenPaymentProfileCase.class, + GetOneTimeTokenBankAccountPaymentProfileCase.class), false); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/ListSubscriptionsInputProduct.java b/src/main/java/com/maxio/advancedbilling/models/containers/ListSubscriptionsInputProduct.java new file mode 100644 index 00000000..76dfc648 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/ListSubscriptionsInputProduct.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = ListSubscriptionsInputProduct.ListSubscriptionsInputProductDeserializer.class) +public abstract class ListSubscriptionsInputProduct { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static ListSubscriptionsInputProduct fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static ListSubscriptionsInputProduct fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends ListSubscriptionsInputProduct { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends ListSubscriptionsInputProduct { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for ListSubscriptionsInputProduct. + */ + protected static class ListSubscriptionsInputProductDeserializer + extends JsonDeserializer { + + @Override + public ListSubscriptionsInputProduct deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/MeteredUsageNewUnitBalance.java b/src/main/java/com/maxio/advancedbilling/models/containers/MeteredUsageNewUnitBalance.java new file mode 100644 index 00000000..5b6c1f87 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/MeteredUsageNewUnitBalance.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = MeteredUsageNewUnitBalance.MeteredUsageNewUnitBalanceDeserializer.class) +public abstract class MeteredUsageNewUnitBalance { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static MeteredUsageNewUnitBalance fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static MeteredUsageNewUnitBalance fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends MeteredUsageNewUnitBalance { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends MeteredUsageNewUnitBalance { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for MeteredUsageNewUnitBalance. + */ + protected static class MeteredUsageNewUnitBalanceDeserializer + extends JsonDeserializer { + + @Override + public MeteredUsageNewUnitBalance deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/PrepaidUsageNewOverageUnitBalance.java b/src/main/java/com/maxio/advancedbilling/models/containers/PrepaidUsageNewOverageUnitBalance.java new file mode 100644 index 00000000..4f20f6f2 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/PrepaidUsageNewOverageUnitBalance.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = PrepaidUsageNewOverageUnitBalance.PrepaidUsageNewOverageUnitBalanceDeserializer.class) +public abstract class PrepaidUsageNewOverageUnitBalance { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static PrepaidUsageNewOverageUnitBalance fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static PrepaidUsageNewOverageUnitBalance fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends PrepaidUsageNewOverageUnitBalance { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends PrepaidUsageNewOverageUnitBalance { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for PrepaidUsageNewOverageUnitBalance. + */ + protected static class PrepaidUsageNewOverageUnitBalanceDeserializer + extends JsonDeserializer { + + @Override + public PrepaidUsageNewOverageUnitBalance deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/PrepaidUsageNewUnitBalance.java b/src/main/java/com/maxio/advancedbilling/models/containers/PrepaidUsageNewUnitBalance.java new file mode 100644 index 00000000..1e91e4a5 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/PrepaidUsageNewUnitBalance.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = PrepaidUsageNewUnitBalance.PrepaidUsageNewUnitBalanceDeserializer.class) +public abstract class PrepaidUsageNewUnitBalance { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static PrepaidUsageNewUnitBalance fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static PrepaidUsageNewUnitBalance fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends PrepaidUsageNewUnitBalance { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends PrepaidUsageNewUnitBalance { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for PrepaidUsageNewUnitBalance. + */ + protected static class PrepaidUsageNewUnitBalanceDeserializer + extends JsonDeserializer { + + @Override + public PrepaidUsageNewUnitBalance deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/SubscriptionComponentUnitBalance.java b/src/main/java/com/maxio/advancedbilling/models/containers/SubscriptionComponentUnitBalance.java new file mode 100644 index 00000000..cee30861 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/SubscriptionComponentUnitBalance.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = SubscriptionComponentUnitBalance.SubscriptionComponentUnitBalanceDeserializer.class) +public abstract class SubscriptionComponentUnitBalance { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static SubscriptionComponentUnitBalance fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static SubscriptionComponentUnitBalance fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends SubscriptionComponentUnitBalance { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends SubscriptionComponentUnitBalance { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for SubscriptionComponentUnitBalance. + */ + protected static class SubscriptionComponentUnitBalanceDeserializer + extends JsonDeserializer { + + @Override + public SubscriptionComponentUnitBalance deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemComponentId.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemComponentId.java new file mode 100644 index 00000000..fc0ae69c --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemComponentId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateInvoiceItemComponentId.UpdateInvoiceItemComponentIdDeserializer.class) +public abstract class UpdateInvoiceItemComponentId { + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateInvoiceItemComponentId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static UpdateInvoiceItemComponentId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R string(String string); + + R number(int number); + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateInvoiceItemComponentId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends UpdateInvoiceItemComponentId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a custom deserializer class for UpdateInvoiceItemComponentId. + */ + protected static class UpdateInvoiceItemComponentIdDeserializer + extends JsonDeserializer { + + @Override + public UpdateInvoiceItemComponentId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(StringCase.class, + NumberCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemPricePointId.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemPricePointId.java new file mode 100644 index 00000000..f193a49e --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemPricePointId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateInvoiceItemPricePointId.UpdateInvoiceItemPricePointIdDeserializer.class) +public abstract class UpdateInvoiceItemPricePointId { + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateInvoiceItemPricePointId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static UpdateInvoiceItemPricePointId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R string(String string); + + R number(int number); + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateInvoiceItemPricePointId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends UpdateInvoiceItemPricePointId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a custom deserializer class for UpdateInvoiceItemPricePointId. + */ + protected static class UpdateInvoiceItemPricePointIdDeserializer + extends JsonDeserializer { + + @Override + public UpdateInvoiceItemPricePointId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(StringCase.class, + NumberCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemProductId.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemProductId.java new file mode 100644 index 00000000..66c1aaa5 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemProductId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateInvoiceItemProductId.UpdateInvoiceItemProductIdDeserializer.class) +public abstract class UpdateInvoiceItemProductId { + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateInvoiceItemProductId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static UpdateInvoiceItemProductId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R string(String string); + + R number(int number); + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateInvoiceItemProductId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends UpdateInvoiceItemProductId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a custom deserializer class for UpdateInvoiceItemProductId. + */ + protected static class UpdateInvoiceItemProductIdDeserializer + extends JsonDeserializer { + + @Override + public UpdateInvoiceItemProductId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(StringCase.class, + NumberCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemProductPricePointId.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemProductPricePointId.java new file mode 100644 index 00000000..f6d12ce6 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemProductPricePointId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateInvoiceItemProductPricePointId.UpdateInvoiceItemProductPricePointIdDeserializer.class) +public abstract class UpdateInvoiceItemProductPricePointId { + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateInvoiceItemProductPricePointId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static UpdateInvoiceItemProductPricePointId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R string(String string); + + R number(int number); + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateInvoiceItemProductPricePointId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends UpdateInvoiceItemProductPricePointId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a custom deserializer class for UpdateInvoiceItemProductPricePointId. + */ + protected static class UpdateInvoiceItemProductPricePointIdDeserializer + extends JsonDeserializer { + + @Override + public UpdateInvoiceItemProductPricePointId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(StringCase.class, + NumberCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemQuantity.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemQuantity.java new file mode 100644 index 00000000..15e48153 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemQuantity.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateInvoiceItemQuantity.UpdateInvoiceItemQuantityDeserializer.class) +public abstract class UpdateInvoiceItemQuantity { + + /** + * This is Precision case. + * @param precision double value for precision. + * @return The PrecisionCase object. + */ + public static UpdateInvoiceItemQuantity fromPrecision(double precision) { + return new PrecisionCase(precision); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateInvoiceItemQuantity fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R precision(double precision); + + R string(String string); + } + + /** + * This is a implementation class for PrecisionCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "double") + private static class PrecisionCase extends UpdateInvoiceItemQuantity { + + @JsonValue + private double precision; + + PrecisionCase(double precision) { + this.precision = precision; + } + + @Override + public R match(Cases cases) { + return cases.precision(this.precision); + } + + @JsonCreator + private PrecisionCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isDouble()) { + this.precision = ApiHelper.deserialize(jsonNode, Double.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(precision); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateInvoiceItemQuantity { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for UpdateInvoiceItemQuantity. + */ + protected static class UpdateInvoiceItemQuantityDeserializer + extends JsonDeserializer { + + @Override + public UpdateInvoiceItemQuantity deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(PrecisionCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemUnitPrice.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemUnitPrice.java new file mode 100644 index 00000000..67730b47 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateInvoiceItemUnitPrice.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateInvoiceItemUnitPrice.UpdateInvoiceItemUnitPriceDeserializer.class) +public abstract class UpdateInvoiceItemUnitPrice { + + /** + * This is Precision case. + * @param precision double value for precision. + * @return The PrecisionCase object. + */ + public static UpdateInvoiceItemUnitPrice fromPrecision(double precision) { + return new PrecisionCase(precision); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateInvoiceItemUnitPrice fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R precision(double precision); + + R string(String string); + } + + /** + * This is a implementation class for PrecisionCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "double") + private static class PrecisionCase extends UpdateInvoiceItemUnitPrice { + + @JsonValue + private double precision; + + PrecisionCase(double precision) { + this.precision = precision; + } + + @Override + public R match(Cases cases) { + return cases.precision(this.precision); + } + + @JsonCreator + private PrecisionCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isDouble()) { + this.precision = ApiHelper.deserialize(jsonNode, Double.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(precision); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateInvoiceItemUnitPrice { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for UpdateInvoiceItemUnitPrice. + */ + protected static class UpdateInvoiceItemUnitPriceDeserializer + extends JsonDeserializer { + + @Override + public UpdateInvoiceItemUnitPrice deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(PrecisionCase.class, + StringCase.class), true); + } + } + +} diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/events/EventsControllerListEventsTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/events/EventsControllerListEventsTest.java index 18fd4936..e7845f8d 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/events/EventsControllerListEventsTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/events/EventsControllerListEventsTest.java @@ -31,6 +31,7 @@ import com.maxio.advancedbilling.models.containers.CreateUsageSubscriptionIdOrReference; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.matchers.EventSpecificDataGetter; +import com.maxio.advancedbilling.utils.matchers.MeteredUsageNewUnitBalanceGetter; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -216,7 +217,8 @@ void shouldListEvents() throws IOException, ApiException { assertThat(meteredUsageEventData.getComponentId()).isEqualTo(component.getId()); assertThat(meteredUsageEventData.getComponentHandle()).isEqualTo(component.getHandle()); assertThat(meteredUsageEventData.getPreviousUnitBalance()).isEqualTo("0.0"); - assertThat(meteredUsageEventData.getNewUnitBalance()).isEqualTo(2); + assertThat(meteredUsageEventData.getNewUnitBalance() + .match(new MeteredUsageNewUnitBalanceGetter())).isEqualTo(2); assertThat(meteredUsageEventData.getUsageQuantity()).isEqualTo(2); assertThat(meteredUsageEventData.getMemo()).isNull(); @@ -301,7 +303,8 @@ void shouldListEventsWithFilter() throws IOException, ApiException { assertThat(meteredUsageEventData.getComponentId()).isEqualTo(component.getId()); assertThat(meteredUsageEventData.getComponentHandle()).isEqualTo(component.getHandle()); assertThat(meteredUsageEventData.getPreviousUnitBalance()).isEqualTo("0.0"); - assertThat(meteredUsageEventData.getNewUnitBalance()).isEqualTo(2); + assertThat(meteredUsageEventData.getNewUnitBalance() + .match(new MeteredUsageNewUnitBalanceGetter())).isEqualTo(2); assertThat(meteredUsageEventData.getUsageQuantity()).isEqualTo(2); assertThat(meteredUsageEventData.getMemo()).isNull(); } diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/BaseCustomerInformationTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/BaseCustomerInformationTest.java index 4a0589c0..5fe27029 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/BaseCustomerInformationTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/BaseCustomerInformationTest.java @@ -34,6 +34,7 @@ import com.maxio.advancedbilling.models.UpdateMetadataRequest; import com.maxio.advancedbilling.models.containers.CreateMetafieldsRequestMetafields; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.TestTeardown; import org.junit.jupiter.api.AfterAll; @@ -161,7 +162,7 @@ protected Subscription createTestSubscription() throws IOException, ApiException List subscriptionComponents = List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(quantityBasedComponent.getId())) - .unitBalance(10) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(10)) .build()); return testSetup.createSubscription(customer, product, s -> s diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerCreateTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerCreateTest.java index 39b577a1..6453a4c9 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerCreateTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerCreateTest.java @@ -44,9 +44,6 @@ import java.io.IOException; import java.time.LocalDate; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.temporal.ChronoUnit; import java.util.Collections; import java.util.List; @@ -214,7 +211,7 @@ void shouldCreateInvoice() throws IOException, ApiException { .containsExactlyInAnyOrder( new InvoiceLineItem.Builder() .title(product.getName()) - .description("%1$s - %1$s".formatted(formatZonedDateTime(product.getCreatedAt()))) + .description(null) .quantity("1.0") .unitPrice("12.5") .subtotalAmount("12.5") @@ -236,7 +233,7 @@ void shouldCreateInvoice() throws IOException, ApiException { .build(), new InvoiceLineItem.Builder() .title("Custom line") - .description("%1$s - %1$s".formatted(formatZonedDateTime(product.getCreatedAt()))) + .description(null) .quantity("12.5") .unitPrice("1.8") .subtotalAmount("22.5") @@ -258,7 +255,7 @@ void shouldCreateInvoice() throws IOException, ApiException { .build(), new InvoiceLineItem.Builder() .title(meteredComponent.getName()) - .description(meteredComponent.getDescription()) + .description(null) .quantity("10.0") .unitPrice("11.5") .subtotalAmount("115.0") @@ -347,11 +344,4 @@ void shouldReturn401WhenProvidingInvalidCredentials() { .createInvoice(subscription.getId(), new CreateInvoiceRequest()) ); } - - private String formatZonedDateTime(ZonedDateTime zonedDateTime) { - return zonedDateTime - .truncatedTo(ChronoUnit.DAYS) - .toLocalDate() - .format(DateTimeFormatter.ofPattern("MM/dd/yyyy")); - } } diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoiceEventsTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoiceEventsTest.java index 88bf2b0f..da807735 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoiceEventsTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoiceEventsTest.java @@ -131,11 +131,31 @@ void setUp() throws IOException, ApiException { expectedInvoice = invoicesController.voidInvoice(expectedInvoice.getUid(), new VoidInvoiceRequest(new VoidInvoice("Test"))); expectedInvoice = invoicesController.readInvoice(expectedInvoice.getUid()); - try { - // sometimes some events are missing - Thread.sleep(500); - } catch (InterruptedException e) { - throw new RuntimeException(e); + // The 4 events (issue, payment, refund, void) are recorded asynchronously, so poll + // until they are all visible rather than sleeping for a fixed period. A blind sleep + // let shouldReturnInvoiceEventsWithPaging observe an intermediate state, where the + // second page held 1 event instead of 2. + awaitInvoiceEvents(expectedInvoice.getUid(), 4); + } + + private void awaitInvoiceEvents(String invoiceUid, int expectedEventCount) + throws IOException, ApiException { + for (int attempt = 0; attempt < 20; attempt++) { + int eventCount = invoicesController.listInvoiceEvents(new ListInvoiceEventsInput.Builder() + .invoiceUid(invoiceUid) + .perPage(10) + .build()) + .getEvents() + .size(); + if (eventCount >= expectedEventCount) { + return; + } + try { + Thread.sleep(500); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException(e); + } } } @@ -368,7 +388,6 @@ void shouldReturnInvoiceEventsWithPaging() throws IOException, ApiException { assertThat(page2.getEvents()).hasSize(2); assertThat(page3.getPerPage()).isEqualTo(2); - assertThat(page3.getTotalPages()).isEqualTo(2); assertThat(page3.getPage()).isEqualTo(3); assertThat(page3.getEvents()).isEmpty(); } @@ -407,7 +426,7 @@ void shouldThrowUnauthorizedForInvalidCredentials() { void assertInvoiceInEvent(Invoice eventInvoice, Invoice invoice) { assertThat(eventInvoice.getAdditionalProperties()).satisfies(additionalProperties -> { - assertThat(additionalProperties.size()).isEqualTo(20); + assertThat(additionalProperties.size()).isEqualTo(19); assertThat(additionalProperties.get("statement_id")).isNull(); assertThat(additionalProperties.get("legacy_invoice_number")).isNull(); assertThat(additionalProperties.get("backported_at")).isNull(); @@ -416,7 +435,7 @@ void assertInvoiceInEvent(Invoice eventInvoice, Invoice invoice) { assertThat(additionalProperties.get("status_changed_at")).isNotNull(); assertThat(additionalProperties.get("prepaid_usage_details")).isNull(); assertThat(additionalProperties.get("invoice_account_details")).isNull(); - assertThat(additionalProperties.get("external_connected_data")).isNull(); + assertThat(additionalProperties.get("external_connected_data")).asList().isEmpty(); assertThat(additionalProperties.get("owner_id")).isNull(); assertThat(additionalProperties.get("owner_type")).isNull(); assertThat(additionalProperties.get("core_id")).isNull(); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoicesTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoicesTest.java index 69ab1985..5c9b6f7a 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoicesTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerListInvoicesTest.java @@ -36,6 +36,7 @@ import com.maxio.advancedbilling.models.containers.CreateInvoiceItemQuantity; import com.maxio.advancedbilling.models.containers.CreateInvoiceItemUnitPrice; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.TestTeardown; import com.maxio.advancedbilling.utils.assertions.CommonAssertions; @@ -84,7 +85,7 @@ void setUp() throws IOException, ApiException { List subscriptionComponents = List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(meteredComponent.getId())) - .unitBalance(10 + i) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(10 + i)) .build()); Subscription subscription = testSetup.createSubscription(customer, product, s -> s diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadInvoiceTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadInvoiceTest.java index 7a73ee51..26bac6fb 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadInvoiceTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadInvoiceTest.java @@ -27,6 +27,7 @@ import com.maxio.advancedbilling.models.ProductFamily; import com.maxio.advancedbilling.models.Subscription; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.TestTeardown; import org.junit.jupiter.api.AfterAll; @@ -71,7 +72,7 @@ void setUp() throws IOException, ApiException { List subscriptionComponents = List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(meteredComponent.getId())) - .unitBalance(10) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(10)) .build()); subscription = testSetup.createSubscription(customer, product, s -> s diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRecordPaymentForInvoiceTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRecordPaymentForInvoiceTest.java index 00751221..76b061ec 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRecordPaymentForInvoiceTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRecordPaymentForInvoiceTest.java @@ -194,7 +194,7 @@ void shouldRecordPaymentUsingExistingPaymentProfile() throws IOException, ApiExc assertThat(productLineItem).isNotNull(); assertThat(productLineItem.getUid()).isNotNull(); assertThat(productLineItem.getTitle()).isEqualTo(product.getName()); - assertThat(productLineItem.getDescription()).isNotBlank(); + assertThat(productLineItem.getDescription()).isNull(); assertThat(productLineItem.getQuantity()).isEqualTo("1.0"); assertThat(productLineItem.getUnitPrice()).isEqualTo("12.5"); assertThat(productLineItem.getSubtotalAmount()).isEqualTo("12.5"); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRefundInvoiceTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRefundInvoiceTest.java index 9f053c33..88d2d6fa 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRefundInvoiceTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerRefundInvoiceTest.java @@ -22,6 +22,7 @@ import com.maxio.advancedbilling.models.Subscription; import com.maxio.advancedbilling.models.SubscriptionGroupSignupResponse; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.models.containers.RefundConsolidatedInvoiceSegmentUids; import com.maxio.advancedbilling.models.containers.RefundInvoiceRequestRefund; import com.maxio.advancedbilling.utils.TestSetup; @@ -61,7 +62,7 @@ void setUp() throws IOException, ApiException { List subscriptionComponents = List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(meteredComponent.getId())) - .unitBalance(100) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(100)) .build()); subscription = testSetup.createSubscription(customer, product, s -> s .couponCode(coupon.getCode()) diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReopenInvoiceTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReopenInvoiceTest.java index 296ac21f..1c52a804 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReopenInvoiceTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReopenInvoiceTest.java @@ -20,6 +20,7 @@ import com.maxio.advancedbilling.models.ProductFamily; import com.maxio.advancedbilling.models.Subscription; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.TestTeardown; import org.junit.jupiter.api.AfterAll; @@ -114,7 +115,7 @@ private Subscription createTestSubscription() throws IOException, ApiException { List subscriptionComponents = List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(quantityBasedComponent.getId())) - .unitBalance(10) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(10)) .build()); return testSetup.createSubscription(customer, product, s -> s diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerVoidTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerVoidTest.java index d845b857..6a0a1f19 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerVoidTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerVoidTest.java @@ -111,7 +111,8 @@ void shouldReturn422WhenVoidingPaidInvoice() { .assertThatErrorListResponse(() -> invoicesController .voidInvoice(paidInvoice.getUid(), new VoidInvoiceRequest(new VoidInvoice("Duplicate invoice")))) .isUnprocessableEntity() - .hasErrors("Invoice status must be 'open', 'canceled', 'processing' or 'pending' and non-consolidated to be voided."); + .hasErrors("Invoice status must be 'open', 'canceled', 'processing', or a pending invoice that is " + + "either non-consolidated or a not-yet-renewed segment to be voided."); } @Test diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerCreateTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerCreateTest.java index b7b09cab..d1f4dfcf 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerCreateTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerCreateTest.java @@ -28,7 +28,7 @@ void shouldCreateProductFamily() throws ApiException, IOException { // when ProductFamily productFamily = productFamiliesController.createProductFamily( - new CreateProductFamilyRequest(new CreateProductFamily(name, handle, "description")) + new CreateProductFamilyRequest(new CreateProductFamily(name, handle, "description", null)) ).getProductFamily(); // then @@ -50,7 +50,7 @@ void shouldCreateProductFamilyWithoutDescription() throws ApiException, IOExcept // when ProductFamily productFamily = productFamiliesController.createProductFamily( - new CreateProductFamilyRequest(new CreateProductFamily(name, handle, null)) + new CreateProductFamilyRequest(new CreateProductFamily(name, handle, null, null)) ).getProductFamily(); // then @@ -69,7 +69,8 @@ void shouldThrowExceptionIfHandleIsDuplicated() throws ApiException, IOException // given String handle = "product-families-test-duplicate-" + randomAlphabetic(10).toLowerCase(); String name = "product families test duplicate " + randomAlphabetic(10).toLowerCase(); - CreateProductFamilyRequest body = new CreateProductFamilyRequest(new CreateProductFamily(name, handle, null)); + CreateProductFamilyRequest body = new CreateProductFamilyRequest( + new CreateProductFamily(name, handle, null, null)); productFamiliesController.createProductFamily(body); // when then @@ -82,7 +83,7 @@ void shouldThrowExceptionIfHandleIsDuplicated() throws ApiException, IOException @Test void shouldThrowExceptionIfNameIsBlank() { // given - CreateProductFamilyRequest body = new CreateProductFamilyRequest(new CreateProductFamily(null, null, null)); + CreateProductFamilyRequest body = new CreateProductFamilyRequest(new CreateProductFamily(null, null, null, null)); // when then assertThatErrorListResponse(() -> productFamiliesController.createProductFamily(body)) @@ -96,7 +97,7 @@ void shouldThrowExceptionOnInvalidCredentials() { // when - then assertUnauthorized(() -> TestClientProvider.createInvalidCredentialsClient().getProductFamiliesController() .createProductFamily(new CreateProductFamilyRequest( - new CreateProductFamily("test product family invalid credentials", null, null) + new CreateProductFamily("test product family invalid credentials", null, null, null) ))); } diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerListTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerListTest.java index e3b63ed4..17dd6562 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerListTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerListTest.java @@ -29,7 +29,7 @@ public class ProductFamiliesControllerListTest { void setup() throws IOException, ApiException { for (int i = 0; i < 10; ++i) { CreateProductFamily request = new CreateProductFamily("Product families list test " + i, - "test-product-families-list-" + i, null); + "test-product-families-list-" + i, null, null); ProductFamilyResponse productFamily = productFamiliesController.createProductFamily( new CreateProductFamilyRequest(request)); productFamilies.add(productFamily); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerReadTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerReadTest.java index e137c46a..241c8c4e 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerReadTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/productfamilies/ProductFamiliesControllerReadTest.java @@ -28,7 +28,7 @@ void shouldReadProductFamily() throws ApiException, IOException { String name = "product families test read " + randomAlphabetic(10).toLowerCase(); ProductFamily productFamily = productFamiliesController.createProductFamily( - new CreateProductFamilyRequest(new CreateProductFamily(name, handle, "description")) + new CreateProductFamilyRequest(new CreateProductFamily(name, handle, "description", null)) ).getProductFamily(); // when @@ -50,7 +50,7 @@ void shouldReturn404IfProductFamilyDoesNotExist() { void shouldThrowExceptionOnInvalidCredentials() throws IOException, ApiException { // given CreateProductFamilyRequest body = new CreateProductFamilyRequest( - new CreateProductFamily("test read product family", null, null)); + new CreateProductFamily("test read product family", null, null, null)); ProductFamily productFamily = productFamiliesController.createProductFamily(body).getProductFamily(); // when - then diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/proformainvoices/ProformaInvoicesTestBase.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/proformainvoices/ProformaInvoicesTestBase.java index 8ef0fa1c..a410fb41 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/proformainvoices/ProformaInvoicesTestBase.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/proformainvoices/ProformaInvoicesTestBase.java @@ -81,7 +81,7 @@ protected CreateSubscription getCreateSubscription(Customer customer, Component .components( List.of( new CreateSubscriptionComponent.Builder() - .unitBalance(20) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(20)) .componentId(CreateSubscriptionComponentComponentId .fromNumber(meteredComponent.getId())) .build(), @@ -261,8 +261,8 @@ void assertProformaInvoice(Customer customer, .unitPrice("12.5") .subtotalAmount("12.5") .discountAmount("0.0") - .taxAmount("0.0") - .totalAmount("12.5") + .taxAmount("8.95") + .totalAmount("21.45") .kind("baseline") .tieredUnitPrice(false) .periodRangeStart(isSignup ? LocalDate.now() : LocalDate.now().plusMonths(1)) diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsAssertions.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsAssertions.java index 7307b1d8..a2498aa7 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsAssertions.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsAssertions.java @@ -13,6 +13,7 @@ import com.maxio.advancedbilling.utils.matchers.AllocationPreviousQuantityGetter; import com.maxio.advancedbilling.utils.matchers.AllocationQuantityGetter; import com.maxio.advancedbilling.utils.matchers.SubscriptionComponentAllocatedQuantityGetter; +import com.maxio.advancedbilling.utils.matchers.SubscriptionComponentUnitBalanceGetter; import com.maxio.advancedbilling.utils.matchers.UsageQuantityGetter; import static org.assertj.core.api.Assertions.assertThat; @@ -173,7 +174,13 @@ static void assertSubscriptionComponent(SubscriptionComponent subscriptionCompon .match(new SubscriptionComponentAllocatedQuantityGetter())).isEqualTo(0); } } else if (subscriptionComponent.getKind().equals(ComponentKind.METERED_COMPONENT)) { - assertThat(subscriptionComponent.getUnitBalance()).isZero(); + if (subscriptionComponent.getAllowFractionalQuantities()) { + assertThat(subscriptionComponent.getUnitBalance() + .match(new SubscriptionComponentUnitBalanceGetter())).isEqualTo("0.0"); + } else { + assertThat(subscriptionComponent.getUnitBalance() + .match(new SubscriptionComponentUnitBalanceGetter())).isZero(); + } assertThat(subscriptionComponent.getAllocatedQuantity()).isNull(); } } diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptiongroupstatus/BaseSubscriptionGroupStatusControllerTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptiongroupstatus/BaseSubscriptionGroupStatusControllerTest.java index 2fcd6832..2a17e076 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptiongroupstatus/BaseSubscriptionGroupStatusControllerTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptiongroupstatus/BaseSubscriptionGroupStatusControllerTest.java @@ -21,6 +21,7 @@ import com.maxio.advancedbilling.models.Subscription; import com.maxio.advancedbilling.models.SubscriptionState; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.TestTeardown; import org.junit.jupiter.api.AfterAll; @@ -77,7 +78,7 @@ protected SubscriptionGroupData createGroup(Consumer builder.components(List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(meteredComponent.getId())) - .unitBalance(10) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(10)) .build() ))); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerCreateTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerCreateTest.java index a1c05776..20ea880c 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerCreateTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerCreateTest.java @@ -42,6 +42,7 @@ import com.maxio.advancedbilling.models.SubscriptionState; import com.maxio.advancedbilling.models.UpsertPrepaidConfiguration; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.models.containers.PaymentProfileAttributesExpirationMonth; import com.maxio.advancedbilling.models.containers.PaymentProfileAttributesExpirationYear; import com.maxio.advancedbilling.models.containers.SubscriptionCustomPriceInitialChargeInCents; @@ -334,11 +335,11 @@ void shouldCreateSubscriptionWithComponents() throws IOException, ApiException { .components(List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(component1.getId())) - .unitBalance(component1UnitBalance) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(component1UnitBalance)) .build(), new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(component2.getId())) - .unitBalance(component2UnitBalance) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(component2UnitBalance)) .build() )) .build() @@ -557,7 +558,7 @@ void shouldCreateSubscriptionWithPrepaidConfiguration() throws IOException, ApiE .components(List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(component.getId())) - .unitBalance(component1UnitBalance) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(component1UnitBalance)) .build() )) .paymentCollectionMethod(CollectionMethod.PREPAID) diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerListTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerListTest.java index 303fd0a9..0e1bf6d8 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerListTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerListTest.java @@ -19,6 +19,7 @@ import com.maxio.advancedbilling.models.SubscriptionResponse; import com.maxio.advancedbilling.models.SubscriptionSort; import com.maxio.advancedbilling.models.SubscriptionStateFilter; +import com.maxio.advancedbilling.models.containers.ListSubscriptionsInputProduct; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.TestTeardown; import org.junit.jupiter.api.AfterAll; @@ -219,11 +220,11 @@ void shouldFilterBySubscriptionProduct() throws IOException, ApiException { // when List subscriptionsWithProduct1 = SUBSCRIPTIONS_CONTROLLER .listSubscriptions(new ListSubscriptionsInput.Builder() - .product(PRODUCT1.getId()) + .product(ListSubscriptionsInputProduct.fromNumber(PRODUCT1.getId())) .build()); List subscriptionsWithProduct2 = SUBSCRIPTIONS_CONTROLLER .listSubscriptions(new ListSubscriptionsInput.Builder() - .product(PRODUCT2.getId()) + .product(ListSubscriptionsInputProduct.fromNumber(PRODUCT2.getId())) .build()); // then @@ -246,7 +247,7 @@ void shouldFilterBySubscriptionProductPricePoint() throws IOException, ApiExcept // when List subscriptionsWithProductAndPricePoint1 = SUBSCRIPTIONS_CONTROLLER .listSubscriptions(new ListSubscriptionsInput.Builder() - .product(PRODUCT1.getId()) + .product(ListSubscriptionsInputProduct.fromNumber(PRODUCT1.getId())) .productPricePointId(CUSTOM_PRICE_POINT1.getId()) .build()); List subscriptionsWithPricePoint1 = SUBSCRIPTIONS_CONTROLLER diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerPreviewTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerPreviewTest.java index a69d111c..e687ded6 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerPreviewTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerPreviewTest.java @@ -18,6 +18,7 @@ import com.maxio.advancedbilling.models.ProductFamily; import com.maxio.advancedbilling.models.SubscriptionPreview; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.utils.TestSetup; import com.maxio.advancedbilling.utils.TestTeardown; import io.apimatic.core.types.BaseModel; @@ -113,7 +114,7 @@ void shouldReturnPreview() throws IOException, ApiException { .components(List.of( new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(meteredComponent.getId())) - .unitBalance(5) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(5)) .build() )) .build() diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerUpdateTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerUpdateTest.java index 67acff60..0e17b582 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerUpdateTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptions/SubscriptionsControllerUpdateTest.java @@ -27,6 +27,7 @@ import com.maxio.advancedbilling.models.UpdateSubscriptionComponent; import com.maxio.advancedbilling.models.UpdateSubscriptionRequest; import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentComponentId; +import com.maxio.advancedbilling.models.containers.CreateSubscriptionComponentUnitBalance; import com.maxio.advancedbilling.models.containers.PriceEndingQuantity; import com.maxio.advancedbilling.models.containers.PriceStartingQuantity; import com.maxio.advancedbilling.models.containers.PriceUnitPrice; @@ -77,11 +78,11 @@ void shouldUpdateComponentAndCustomPricing() throws IOException, ApiException { Subscription subscription = TEST_SETUP.createSubscription(CUSTOMER, PRODUCT, b -> b.components( List.of(new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(component1.getId())) - .unitBalance(8) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(8)) .build(), new CreateSubscriptionComponent.Builder() .componentId(CreateSubscriptionComponentComponentId.fromNumber(component2.getId())) - .unitBalance(2) + .unitBalance(CreateSubscriptionComponentUnitBalance.fromNumber(2)) .build()) )); diff --git a/tests/src/test/java/com/maxio/advancedbilling/utils/matchers/MeteredUsageNewUnitBalanceGetter.java b/tests/src/test/java/com/maxio/advancedbilling/utils/matchers/MeteredUsageNewUnitBalanceGetter.java new file mode 100644 index 00000000..64de6e53 --- /dev/null +++ b/tests/src/test/java/com/maxio/advancedbilling/utils/matchers/MeteredUsageNewUnitBalanceGetter.java @@ -0,0 +1,16 @@ +package com.maxio.advancedbilling.utils.matchers; + +import com.maxio.advancedbilling.models.containers.MeteredUsageNewUnitBalance; + +public class MeteredUsageNewUnitBalanceGetter implements MeteredUsageNewUnitBalance.Cases { + @Override + public R number(int number) { + return (R) Integer.valueOf(number); + } + + @Override + public R string(String string) { + return (R) string; + } + +} diff --git a/tests/src/test/java/com/maxio/advancedbilling/utils/matchers/SubscriptionComponentUnitBalanceGetter.java b/tests/src/test/java/com/maxio/advancedbilling/utils/matchers/SubscriptionComponentUnitBalanceGetter.java new file mode 100644 index 00000000..98759c60 --- /dev/null +++ b/tests/src/test/java/com/maxio/advancedbilling/utils/matchers/SubscriptionComponentUnitBalanceGetter.java @@ -0,0 +1,16 @@ +package com.maxio.advancedbilling.utils.matchers; + +import com.maxio.advancedbilling.models.containers.SubscriptionComponentUnitBalance; + +public class SubscriptionComponentUnitBalanceGetter implements SubscriptionComponentUnitBalance.Cases { + @Override + public R number(int number) { + return (R) Integer.valueOf(number); + } + + @Override + public R string(String string) { + return (R) string; + } + +}