diff --git a/README.md b/README.md index 745fb9c1..8453982f 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Install the SDK by adding the following dependency in your project's pom.xml fil ``` You can also view the package at: -https://mvnrepository.com/artifact/com.maxio/advanced-billing-sdk/3.0.0 +https://central.sonatype.com/artifact/com.maxio/advanced-billing-sdk/3.0.0 ## Initialize the API Client @@ -51,7 +51,7 @@ The following parameters are configurable for the API Client: | `subdomain` | `String` | The subdomain for your Chargify site.
*Default*: `"subdomain"` | | `domain` | `String` | The Chargify server domain.
*Default*: `"chargify.com"` | | `environment` | `Environment` | The API environment.
**Default: `Environment.PRODUCTION`** | -| `httpClientConfig` | [`ReadonlyHttpClientConfiguration`](https://www.github.com/maxio-com/ab-java-sdk/tree/3.0.0/doc/http-client-configuration.md) | Http Client Configuration instance. | +| `httpClientConfig` | [`Consumer`](https://www.github.com/maxio-com/ab-java-sdk/tree/3.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/3.0.0/doc/$a/https://www.github.com/maxio-com/ab-java-sdk/tree/3.0.0/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: diff --git a/doc/client.md b/doc/client.md index 264fe972..33310690 100644 --- a/doc/client.md +++ b/doc/client.md @@ -8,7 +8,7 @@ The following parameters are configurable for the API Client: | `subdomain` | `String` | The subdomain for your Chargify site.
*Default*: `"subdomain"` | | `domain` | `String` | The Chargify server domain.
*Default*: `"chargify.com"` | | `environment` | `Environment` | The API environment.
**Default: `Environment.PRODUCTION`** | -| `httpClientConfig` | [`ReadonlyHttpClientConfiguration`](http-client-configuration.md) | Http Client Configuration instance. | +| `httpClientConfig` | [`Consumer`](http-client-configuration-builder.md) | Set up Http Client Configuration instance. | | `basicAuthCredentials` | [`BasicAuthCredentials`]($a/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 3cbd550f..79984659 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -91,8 +91,8 @@ List listEvents( | --- | --- | --- | --- | | `page` | `Integer` | Query, 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`. | | `perPage` | `Integer` | Query, 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`. | -| `sinceId` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `maxId` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `sinceId` | `Long` | Query, Optional | Returns events with an id greater than or equal to the one specified | +| `maxId` | `Long` | Query, Optional | Returns events with an id less than or equal to the one specified | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | | `filter` | [`List`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `dateField` | [`ListEventsDateField`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | @@ -210,8 +210,8 @@ List listSubscriptionEvents( | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | | `page` | `Integer` | Query, 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`. | | `perPage` | `Integer` | Query, 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`. | -| `sinceId` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `maxId` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `sinceId` | `Long` | Query, Optional | Returns events with an id greater than or equal to the one specified | +| `maxId` | `Long` | Query, Optional | Returns events with an id less than or equal to the one specified | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | | `filter` | [`List`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | @@ -303,8 +303,8 @@ CountResponse readEventsCount( | --- | --- | --- | --- | | `page` | `Integer` | Query, 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`. | | `perPage` | `Integer` | Query, 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`. | -| `sinceId` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `maxId` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `sinceId` | `Long` | Query, Optional | Returns events with an id greater than or equal to the one specified | +| `maxId` | `Long` | Query, Optional | Returns events with an id less than or equal to the one specified | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events. | | `filter` | [`List`](../../doc/models/event-type.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 86acf494..ca84a53e 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -640,7 +640,7 @@ ListInvoiceEventsResponse listInvoiceEvents( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `sinceDate` | `String` | Query, Optional | The timestamp in a format `YYYY-MM-DD T HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it returns data from the beginning of the day). of the event from which you want to start the search. All the events before the `since_date` timestamp are not returned in the response. | -| `sinceId` | `Integer` | Query, Optional | The ID of the event from which you want to start the search(ID is not included. e.g. if ID is set to 2, then all events with ID 3 and more will be shown) This parameter is not used if since_date is defined. | +| `sinceId` | `Long` | Query, Optional | The ID of the event from which you want to start the search(ID is not included. e.g. if ID is set to 2, then all events with ID 3 and more will be shown) This parameter is not used if since_date is defined. | | `page` | `Integer` | Query, 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`. | | `perPage` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200. | | `invoiceUid` | `String` | Query, Optional | Providing an invoice_uid allows for scoping of the invoice events to a single invoice or credit note. | diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 28a5a50c..fbffe200 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -225,6 +225,34 @@ The following example creates a customer, bank account and mandate in Stripe: } ``` +## Stripe BACS Direct Debit + +Contact the support team to enable this payment method. +For more information on Stripe BACS Direct Debit, please view the following resources: + ++ [Full documentation on Stripe BACS Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) + +### Stripe BACS Direct Debit Payment Profiles + +The following example creates a customer, bank account and mandate in Stripe: + +```json +{ + "payment_profile": { + "customer_id": "24907598", + "bank_name": "British bank", + "bank_branch_code": "108800", + "bank_account_number": "00012345" + "payment_type": "bank_account", + "billing_address": "Test", + "billing_city": "London", + "billing_state": "LND", + "billing_zip": "12345", + "billing_country": "GB" + } +} +``` + ## 3D Secure - Checkout It may happen that a payment needs 3D Secure Authentication when the payment profile is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index e05e476f..c4b9a17d 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -198,10 +198,11 @@ ProductFamilyResponse createProductFamily( ```java CreateProductFamilyRequest body = new CreateProductFamilyRequest.Builder( - new CreateProductFamily.Builder() - .name("Acme Projects") - .description("Amazing project management tool") - .build() + new CreateProductFamily.Builder( + "Acme Projects" + ) + .description("Amazing project management tool") + .build() ) .build(); diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index a0912d57..367339f1 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -121,6 +121,7 @@ List listSubscriptionComponents( | `startDate` | `String` | Query, 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. | | `startDatetime` | `String` | Query, 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. | | `include` | [`List`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription,historic_usages`. | +| `inUse` | `Boolean` | Query, Optional | If in_use is set to true, it returns only components that are currently in use. However, if it's set to false or not provided, it returns all components connected with the subscription. | ## Response Type @@ -150,6 +151,7 @@ ListSubscriptionComponentsInput listSubscriptionComponentsInput = new ListSubscr ListSubscriptionComponentsInclude.SUBSCRIPTION, ListSubscriptionComponentsInclude.HISTORIC_USAGES )) +.inUse(true) .build(); try { @@ -1219,8 +1221,8 @@ List listUsages( | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | | `componentId` | [`ListUsagesInputComponentId`](../../doc/models/containers/list-usages-input-component-id.md) | Template, Required | This is a container for one-of cases. | -| `sinceId` | `Integer` | Query, Optional | Returns usages with an id greater than or equal to the one specified | -| `maxId` | `Integer` | Query, Optional | Returns usages with an id less than or equal to the one specified | +| `sinceId` | `Long` | Query, Optional | Returns usages with an id greater than or equal to the one specified | +| `maxId` | `Long` | Query, Optional | Returns usages with an id less than or equal to the one specified | | `sinceDate` | `LocalDate` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | | `untilDate` | `LocalDate` | Query, Optional | Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified. | | `page` | `Integer` | Query, 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`. | diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index f335d82f..bb40e7ba 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -364,13 +364,13 @@ For more information on Stripe Direct Debit, please view the following two resou For more information on Stripe Direct Debit, please view the following two resources: -+ [Payment Profiles via API for Stripe BECS Direct Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#stripe-becs-direct-debit) ++ [Payment Profiles via API for Stripe BECS Direct Debit]($e/Payment%20Profiles/createPaymentProfile) + [Full documentation on Stripe Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) -+ [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](page:development-tools/chargify-js/examples#minimal-example-with-sepa-becs-or-bacs-direct-debit-stripe-gateway) -+ [Using Chargify.js with Stripe BECS Direct Debit - full example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-becs-direct-debit-stripe-gateway) ++ [Using Chargify.js with Stripe BECS Direct Debit - full example](page:development-tools/chargify-js/examples#full-example-with-becs-direct-debit-stripe-gateway) ```json { @@ -391,6 +391,42 @@ For more information on Stripe Direct Debit, please view the following two resou } ``` +## Subscription using Stripe BACS Direct Debit + +For more information on Stripe Direct Debit, please view the following two resources: + ++ [Payment Profiles via API for Stripe BACS Direct Debit]($e/Payment%20Profiles/createPaymentProfile) + ++ [Full documentation on Stripe Direct Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) + ++ [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal example](page:development-tools/chargify-js/examples#minimal-example-with-sepa-becs-or-bacs-direct-debit-stripe-gateway) + ++ [Using Chargify.js with Stripe BACS Direct Debit - full example](page:development-tools/chargify-js/examples#full-example-with-bacs-direct-debit-stripe-gateway) + +```json +{ + "subscription": { + "product_handle": "gold-product", + "customer_attributes": { + "first_name": "Jane", + "last_name": "Doe", + "email": "jd@chargify.test" + }, + "bank_account_attributes": { + "bank_name": "Test Bank", + "bank_branch_code": "108800", + "bank_account_number": "00012345", + "payment_type": "bank_account", + "billing_address": "123 Main St.", + "billing_city": "London", + "billing_state": "LND", + "billing_zip": "W1A 1AA", + "billing_country": "GB" + } + } +} +``` + ## 3D Secure - Stripe It may happen that a payment needs 3D Secure Authentication when the subscription is created; this is referred to in our help docs as a [post-authentication flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). The server returns `422 Unprocessable Entity` in this case with the following response: diff --git a/doc/models/apply-debit-note-event-data.md b/doc/models/apply-debit-note-event-data.md index 13364f2b..77424344 100644 --- a/doc/models/apply-debit-note-event-data.md +++ b/doc/models/apply-debit-note-event-data.md @@ -15,6 +15,8 @@ Example schema for an `apply_debit_note` event | `DebitNoteUid` | `String` | Required | Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters. | String getDebitNoteUid() | setDebitNoteUid(String debitNoteUid) | | `OriginalAmount` | `String` | Required | The full, original amount of the debit note. | String getOriginalAmount() | setOriginalAmount(String originalAmount) | | `AppliedAmount` | `String` | Required | The amount of the debit note applied to invoice. | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | +| `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) @@ -23,7 +25,9 @@ Example schema for an `apply_debit_note` event "debit_note_number": "debit_note_number0", "debit_note_uid": "debit_note_uid6", "original_amount": "original_amount4", - "applied_amount": "applied_amount8" + "applied_amount": "applied_amount8", + "memo": "memo4", + "transaction_time": "2016-03-13T12:52:32.123Z" } ``` diff --git a/doc/models/apply-payment-event-data.md b/doc/models/apply-payment-event-data.md index 6de12c2e..19f51f37 100644 --- a/doc/models/apply-payment-event-data.md +++ b/doc/models/apply-payment-event-data.md @@ -11,6 +11,7 @@ Example schema for an `apply_payment` event | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | +| `ConsolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | - | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | | `Memo` | `String` | Required | The payment memo | String getMemo() | setMemo(String memo) | | `OriginalAmount` | `String` | Required | The full, original amount of the payment transaction as a string in full units. Incoming payments can be split amongst several invoices, which will result in a `applied_amount` less than the `original_amount`. Example: A $100.99 payment, of which $40.11 is applied to this invoice, will have an `original_amount` of `"100.99"`. | String getOriginalAmount() | setOriginalAmount(String originalAmount) | | `AppliedAmount` | `String` | Required | The amount of the payment applied to this invoice. Incoming payments can be split amongst several invoices, which will result in a `applied_amount` less than the `original_amount`. Example: A $100.99 payment, of which $40.11 is applied to this invoice, will have an `applied_amount` of `"40.11"`. | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | @@ -26,6 +27,7 @@ Example schema for an `apply_payment` event ```json { + "consolidation_level": "child", "memo": "memo8", "original_amount": "original_amount8", "applied_amount": "applied_amount4", diff --git a/doc/models/change-chargeback-status-event-data.md b/doc/models/change-chargeback-status-event-data.md new file mode 100644 index 00000000..42a10b6b --- /dev/null +++ b/doc/models/change-chargeback-status-event-data.md @@ -0,0 +1,23 @@ + +# Change Chargeback Status Event Data + +Example schema for an `change_chargeback_status` event + +## Structure + +`ChangeChargebackStatusEventData` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `ChargebackStatus` | [`ChargebackStatus`](../../doc/models/chargeback-status.md) | Required | - | ChargebackStatus getChargebackStatus() | setChargebackStatus(ChargebackStatus chargebackStatus) | + +## Example (as JSON) + +```json +{ + "chargeback_status": "open" +} +``` + diff --git a/doc/models/change-invoice-status-event-data.md b/doc/models/change-invoice-status-event-data.md new file mode 100644 index 00000000..03b54660 --- /dev/null +++ b/doc/models/change-invoice-status-event-data.md @@ -0,0 +1,31 @@ + +# Change Invoice Status Event Data + +Example schema for an `change_invoice_status` event + +## Structure + +`ChangeInvoiceStatusEventData` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `GatewayTransId` | `String` | Optional | Identifier for the transaction within the payment gateway. | String getGatewayTransId() | setGatewayTransId(String gatewayTransId) | +| `Amount` | `String` | Optional | The monetary value associated with the linked payment, expressed in dollars. | String getAmount() | setAmount(String amount) | +| `FromStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice before any changes occurred. See [Invoice Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) for more. | InvoiceStatus getFromStatus() | setFromStatus(InvoiceStatus fromStatus) | +| `ToStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The updated status of the invoice after changes have been made. See [Invoice Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#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": "paid", + "consolidation_level": "none" +} +``` + diff --git a/doc/models/chargeback-status.md b/doc/models/chargeback-status.md new file mode 100644 index 00000000..d57bae0f --- /dev/null +++ b/doc/models/chargeback-status.md @@ -0,0 +1,18 @@ + +# Chargeback Status + +The current chargeback status. + +## Enumeration + +`ChargebackStatus` + +## Fields + +| Name | +| --- | +| `Open` | +| `Lost` | +| `Won` | +| `Closed` | + diff --git a/doc/models/containers/invoice-event-event-data.md b/doc/models/containers/invoice-event-event-data.md index dc339c25..fe03dd43 100644 --- a/doc/models/containers/invoice-event-event-data.md +++ b/doc/models/containers/invoice-event-event-data.md @@ -18,4 +18,10 @@ | [`RemovePaymentEventData`](../../../doc/models/remove-payment-event-data.md) | InvoiceEventEventData.fromRemovePaymentEventData(RemovePaymentEventData removePaymentEventData) | | [`VoidInvoiceEventData`](../../../doc/models/void-invoice-event-data.md) | InvoiceEventEventData.fromVoidInvoiceEventData(VoidInvoiceEventData voidInvoiceEventData) | | [`VoidRemainderEventData`](../../../doc/models/void-remainder-event-data.md) | InvoiceEventEventData.fromVoidRemainderEventData(VoidRemainderEventData voidRemainderEventData) | +| [`Invoice`](../../../doc/models/invoice.md) | InvoiceEventEventData.fromInvoice(Invoice invoice) | +| [`ChangeInvoiceStatusEventData`](../../../doc/models/change-invoice-status-event-data.md) | InvoiceEventEventData.fromChangeInvoiceStatusEventData(ChangeInvoiceStatusEventData changeInvoiceStatusEventData) | +| [`FailedPaymentEventData`](../../../doc/models/failed-payment-event-data.md) | InvoiceEventEventData.fromFailedPaymentEventData(FailedPaymentEventData failedPaymentEventData) | +| [`DebitNote`](../../../doc/models/debit-note.md) | InvoiceEventEventData.fromDebitNote(DebitNote debitNote) | +| [`CreditNote`](../../../doc/models/credit-note.md) | InvoiceEventEventData.fromCreditNote(CreditNote creditNote) | +| [`ChangeChargebackStatusEventData`](../../../doc/models/change-chargeback-status-event-data.md) | InvoiceEventEventData.fromChangeChargebackStatusEventData(ChangeChargebackStatusEventData changeChargebackStatusEventData) | diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index 2f82c394..230050f7 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -36,8 +36,8 @@ | `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) | -| `BankAccountNumber` | `String` | Optional | (Required when creating with ACH, GoCardless, Stripe BECS 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 Direct Debit) Branch code. Alternatively, an IBAN can be provided | String getBankBranchCode() | setBankBranchCode(String bankBranchCode) | +| `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) | | `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) | diff --git a/doc/models/create-product-family-request.md b/doc/models/create-product-family-request.md index 2b9cd108..6c2b1894 100644 --- a/doc/models/create-product-family-request.md +++ b/doc/models/create-product-family-request.md @@ -17,6 +17,7 @@ { "product_family": { "name": "name0", + "handle": "handle6", "description": "description0" } } diff --git a/doc/models/create-product-family.md b/doc/models/create-product-family.md index 34614c9c..db87891b 100644 --- a/doc/models/create-product-family.md +++ b/doc/models/create-product-family.md @@ -9,7 +9,8 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Name` | `String` | Optional | - | String getName() | setName(String name) | +| `Name` | `String` | Required | - | String getName() | setName(String name) | +| `Handle` | `String` | Optional | - | String getHandle() | setHandle(String handle) | | `Description` | `String` | Optional | - | String getDescription() | setDescription(String description) | ## Example (as JSON) @@ -17,6 +18,7 @@ ```json { "name": "name6", + "handle": "handle2", "description": "description6" } ``` diff --git a/doc/models/debit-note-role.md b/doc/models/debit-note-role.md new file mode 100644 index 00000000..d4bc83dd --- /dev/null +++ b/doc/models/debit-note-role.md @@ -0,0 +1,16 @@ + +# Debit Note Role + +The role of the debit note. + +## Enumeration + +`DebitNoteRole` + +## Fields + +| Name | +| --- | +| `Chargeback` | +| `Refund` | + diff --git a/doc/models/debit-note-status.md b/doc/models/debit-note-status.md new file mode 100644 index 00000000..42e4a81c --- /dev/null +++ b/doc/models/debit-note-status.md @@ -0,0 +1,18 @@ + +# Debit Note Status + +Current status of the debit note. + +## Enumeration + +`DebitNoteStatus` + +## Fields + +| Name | +| --- | +| `Open` | +| `Applied` | +| `Banished` | +| `Paid` | + diff --git a/doc/models/debit-note.md b/doc/models/debit-note.md new file mode 100644 index 00000000..d1172953 --- /dev/null +++ b/doc/models/debit-note.md @@ -0,0 +1,47 @@ + +# Debit Note + +## Structure + +`DebitNote` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `Uid` | `String` | Optional | Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters. | String getUid() | setUid(String uid) | +| `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) | +| `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) | +| `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) | +| `Status` | [`DebitNoteStatus`](../../doc/models/debit-note-status.md) | Optional | Current status of the debit note. | DebitNoteStatus getStatus() | setStatus(DebitNoteStatus status) | +| `Memo` | `String` | Optional | The memo printed on debit note, which is a description of the reason for the debit. | String getMemo() | setMemo(String memo) | +| `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) | +| `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) | +| `Discounts` | [`List`](../../doc/models/invoice-discount.md) | Optional | - | List getDiscounts() | setDiscounts(List discounts) | +| `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) + +```json +{ + "uid": "uid2", + "site_id": 112, + "customer_id": 224, + "subscription_id": 40, + "number": 172 +} +``` + diff --git a/doc/models/failed-payment-event-data.md b/doc/models/failed-payment-event-data.md new file mode 100644 index 00000000..7e0b996b --- /dev/null +++ b/doc/models/failed-payment-event-data.md @@ -0,0 +1,31 @@ + +# Failed Payment Event Data + +Example schema for an `failed_payment` event + +## Structure + +`FailedPaymentEventData` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `AmountInCents` | `int` | Required | The monetary value of the payment, expressed in cents. | int getAmountInCents() | setAmountInCents(int amountInCents) | +| `AppliedAmount` | `int` | Required | The monetary value of the payment, expressed in dollars. | int getAppliedAmount() | setAppliedAmount(int appliedAmount) | +| `Memo` | `String` | Optional | The memo passed when the payment was created. | String getMemo() | setMemo(String memo) | +| `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 +} +``` + diff --git a/doc/models/historic-usage.md b/doc/models/historic-usage.md index 1b4f7ce7..61d09d64 100644 --- a/doc/models/historic-usage.md +++ b/doc/models/historic-usage.md @@ -1,7 +1,7 @@ # Historic Usage -An optional object for Event Based Components, will be returned if provided `include=historic_usages` query param. +Optional for Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. ## Structure diff --git a/doc/models/invoice-event-data.md b/doc/models/invoice-event-data.md index 86514b33..c8e683e6 100644 --- a/doc/models/invoice-event-data.md +++ b/doc/models/invoice-event-data.md @@ -18,22 +18,22 @@ The event data is the data that, when combined with the command, results in the | `AppliedAmount` | `String` | Optional | The amount of the credit note applied to invoice. | String getAppliedAmount() | setAppliedAmount(String appliedAmount) | | `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) | +| `Role` | [`InvoiceRole1`](../../doc/models/invoice-role-1.md) | Optional | The role of the credit note (e.g. 'general') | InvoiceRole1 getRole() | setRole(InvoiceRole1 role) | | `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) | | `DebitNoteNumber` | `String` | Optional | A unique, identifying string that appears on the debit note and in places it is referenced. | String getDebitNoteNumber() | setDebitNoteNumber(String debitNoteNumber) | | `DebitNoteUid` | `String` | Optional | Unique identifier for the debit note. It is generated automatically by Chargify and has the prefix "db_" followed by alphanumeric characters. | String getDebitNoteUid() | setDebitNoteUid(String debitNoteUid) | +| `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://chargify.zendesk.com/hc/en-us/articles/4407746391835). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | | `PaymentMethod` | [`InvoiceEventDataPaymentMethod`](../../doc/models/containers/invoice-event-data-payment-method.md) | Optional | This is a container for any-of cases. | InvoiceEventDataPaymentMethod getPaymentMethod() | setPaymentMethod(InvoiceEventDataPaymentMethod paymentMethod) | | `TransactionId` | `Integer` | Optional | The Chargify id of the original payment | Integer getTransactionId() | setTransactionId(Integer transactionId) | -| `ParentInvoiceNumber` | `Integer` | Optional | - | Integer getParentInvoiceNumber() | setParentInvoiceNumber(Integer parentInvoiceNumber) | +| `ParentInvoiceNumber` | `Integer` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | Integer getParentInvoiceNumber() | setParentInvoiceNumber(Integer parentInvoiceNumber) | | `RemainingPrepaymentAmount` | `String` | Optional | - | String getRemainingPrepaymentAmount() | setRemainingPrepaymentAmount(String remainingPrepaymentAmount) | | `Prepayment` | `Boolean` | Optional | The flag that shows whether the original payment was a prepayment or not | Boolean getPrepayment() | setPrepayment(Boolean prepayment) | | `External` | `Boolean` | Optional | - | Boolean getExternal() | setExternal(Boolean external) | | `FromCollectionMethod` | `String` | Optional | The previous collection method of the invoice. | String getFromCollectionMethod() | setFromCollectionMethod(String fromCollectionMethod) | | `ToCollectionMethod` | `String` | Optional | The new collection method of the invoice. | String getToCollectionMethod() | setToCollectionMethod(String toCollectionMethod) | -| `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://chargify.zendesk.com/hc/en-us/articles/4407746391835). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | -| `FromStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The status of the invoice before event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | InvoiceStatus getFromStatus() | setFromStatus(InvoiceStatus fromStatus) | -| `ToStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The status of the invoice after event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | InvoiceStatus getToStatus() | setToStatus(InvoiceStatus toStatus) | +| `FromStatus` | `Object` | Optional | - | Object getFromStatus() | setFromStatus(Object fromStatus) | +| `ToStatus` | `Object` | Optional | - | Object getToStatus() | setToStatus(Object toStatus) | | `DueAmount` | `String` | Optional | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | String getDueAmount() | setDueAmount(String dueAmount) | | `TotalAmount` | `String` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | String getTotalAmount() | setTotalAmount(String totalAmount) | | `ApplyCredit` | `Boolean` | Optional | If true, credit was created and applied it to the invoice. | Boolean getApplyCredit() | setApplyCredit(Boolean applyCredit) | @@ -43,11 +43,68 @@ The event data is the data that, when combined with the command, results in the | `RefundId` | `Integer` | Optional | The ID of the refund transaction. | Integer getRefundId() | setRefundId(Integer refundId) | | `IsAdvanceInvoice` | `Boolean` | Optional | If true, the invoice is an advance invoice. | Boolean getIsAdvanceInvoice() | setIsAdvanceInvoice(Boolean isAdvanceInvoice) | | `Reason` | `String` | Optional | The reason for the void. | String getReason() | setReason(String reason) | +| `Id` | `Long` | Optional | - | Long getId() | setId(Long id) | +| `SiteId` | `Integer` | Optional | ID of the site to which the invoice belongs. | Integer getSiteId() | setSiteId(Integer siteId) | +| `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) | +| `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) | +| `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-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) for more. | InvoiceStatus getStatus() | setStatus(InvoiceStatus status) | +| `ParentInvoiceId` | `Integer` | Optional | - | Integer getParentInvoiceId() | setParentInvoiceId(Integer parentInvoiceId) | +| `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`.
**Default**: `CollectionMethod.AUTOMATIC` | 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) | +| `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) | +| `GroupPrimarySubscriptionId` | `Integer` | Optional | For invoices with `consolidation_level` of `parent`, this specifies the ID of the subscription which was the primary subscription of the subscription group that generated the invoice. | Integer getGroupPrimarySubscriptionId() | setGroupPrimarySubscriptionId(Integer groupPrimarySubscriptionId) | +| `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) | +| `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) | +| `BillingAddress` | [`BillingAddress`](../../doc/models/billing-address.md) | Optional | - | BillingAddress getBillingAddress() | setBillingAddress(BillingAddress billingAddress) | +| `ShippingAddress` | [`ShippingAddress`](../../doc/models/shipping-address.md) | Optional | - | ShippingAddress getShippingAddress() | setShippingAddress(ShippingAddress 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) | +| `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) | +| `PaidAmount` | `String` | Optional | The amount paid on the invoice by the customer. | String getPaidAmount() | setPaidAmount(String paidAmount) | +| `LineItems` | [`List`](../../doc/models/invoice-line-item-1.md) | Optional | Line items on the invoice. | List getLineItems() | setLineItems(List lineItems) | +| `Discounts` | [`List`](../../doc/models/invoice-discount.md) | Optional | - | List getDiscounts() | setDiscounts(List discounts) | +| `Taxes` | [`List`](../../doc/models/invoice-tax.md) | Optional | - | List getTaxes() | setTaxes(List taxes) | +| `Credits` | [`List`](../../doc/models/invoice-credit.md) | Optional | - | List getCredits() | setCredits(List credits) | +| `Refunds` | [`List`](../../doc/models/invoice-refund.md) | Optional | - | List getRefunds() | setRefunds(List refunds) | +| `Payments` | [`List`](../../doc/models/invoice-payment.md) | Optional | - | List getPayments() | setPayments(List payments) | +| `CustomFields` | [`List`](../../doc/models/invoice-custom-field.md) | Optional | - | List getCustomFields() | setCustomFields(List customFields) | +| `DisplaySettings` | [`InvoiceDisplaySettings`](../../doc/models/invoice-display-settings.md) | Optional | - | InvoiceDisplaySettings getDisplaySettings() | setDisplaySettings(InvoiceDisplaySettings displaySettings) | +| `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) | +| `GatewayTransId` | `String` | Optional | Identifier for the transaction within the payment gateway. | String getGatewayTransId() | setGatewayTransId(String gatewayTransId) | +| `Amount` | `String` | Optional | The monetary value associated with the linked payment, expressed in dollars. | String getAmount() | setAmount(String amount) | +| `AmountInCents` | `Integer` | Optional | The monetary value of the payment, expressed in cents. | Integer getAmountInCents() | setAmountInCents(Integer amountInCents) | +| `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) | +| `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) | +| `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) | +| `Applications` | [`List`](../../doc/models/credit-note-application.md) | Optional | - | List getApplications() | setApplications(List applications) | +| `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://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) | List getOriginInvoices() | setOriginInvoices(List originInvoices) | +| `ChargebackStatus` | [`ChargebackStatus`](../../doc/models/chargeback-status.md) | Optional | - | ChargebackStatus getChargebackStatus() | setChargebackStatus(ChargebackStatus chargebackStatus) | ## Example (as JSON) ```json { + "issue_date": "2024-01-01", + "due_date": "2024-01-01", + "paid_date": "2024-01-01", + "collection_method": "automatic", "uid": "uid0", "credit_note_number": "credit_note_number6", "credit_note_uid": "credit_note_uid6", diff --git a/doc/models/invoice-event-type.md b/doc/models/invoice-event-type.md index 9fcef242..a6318ab4 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -16,6 +16,7 @@ Invoice Event Type | `CreateCreditNote` | | `ApplyPayment` | | `ApplyDebitNote` | +| `CreateDebitNote` | | `RefundInvoice` | | `VoidInvoice` | | `VoidRemainder` | diff --git a/doc/models/invoice-event.md b/doc/models/invoice-event.md index 20b0fa3b..e7ed6106 100644 --- a/doc/models/invoice-event.md +++ b/doc/models/invoice-event.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `Id` | `Integer` | Optional | - | Integer getId() | setId(Integer id) | +| `Id` | `Long` | Optional | - | Long getId() | setId(Long id) | | `EventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Optional | Invoice Event Type | InvoiceEventType getEventType() | setEventType(InvoiceEventType eventType) | | `EventData` | [`InvoiceEventEventData`](../../doc/models/containers/invoice-event-event-data.md) | Optional | This is a container for any-of cases. | InvoiceEventEventData getEventData() | setEventData(InvoiceEventEventData eventData) | | `Timestamp` | `ZonedDateTime` | Optional | - | ZonedDateTime getTimestamp() | setTimestamp(ZonedDateTime timestamp) | @@ -20,7 +20,7 @@ ```json { "id": 78, - "event_type": "void_invoice", + "event_type": "create_debit_note", "event_data": { "uid": "uid2", "credit_note_number": "credit_note_number4", diff --git a/doc/models/invoice-line-item-1.md b/doc/models/invoice-line-item-1.md new file mode 100644 index 00000000..4b8ddb5b --- /dev/null +++ b/doc/models/invoice-line-item-1.md @@ -0,0 +1,47 @@ + +# Invoice Line Item 1 + +## Structure + +`InvoiceLineItem1` + +## Fields + +| 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) | +| `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) | +| `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) | +| `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) | +| `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) | +| `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) | +| `ComponentId` | `Integer` | Optional | The ID of the component being billed. Will be `nil` for non-component charges. | Integer getComponentId() | setComponentId(Integer componentId) | +| `PricePointId` | `Integer` | Optional | The price point ID of the component being billed. Will be `nil` for non-component charges. | Integer getPricePointId() | setPricePointId(Integer pricePointId) | +| `Hide` | `Boolean` | Optional | - | Boolean getHide() | setHide(Boolean hide) | +| `ComponentCostData` | [`InvoiceLineItemComponentCostData`](../../doc/models/invoice-line-item-component-cost-data.md) | Optional | - | InvoiceLineItemComponentCostData getComponentCostData() | setComponentCostData(InvoiceLineItemComponentCostData componentCostData) | +| `ProductPricePointId` | `Integer` | Optional | The price point ID of the line item's product | Integer getProductPricePointId() | setProductPricePointId(Integer productPricePointId) | +| `CustomItem` | `Boolean` | Optional | - | Boolean getCustomItem() | setCustomItem(Boolean customItem) | +| `Kind` | `String` | Optional | - | String getKind() | setKind(String kind) | +| `BillingScheduleItemId` | `Integer` | Optional | - | Integer getBillingScheduleItemId() | setBillingScheduleItemId(Integer billingScheduleItemId) | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "title": "title4", + "description": "description8", + "quantity": "quantity4", + "unit_price": "unit_price6" +} +``` + diff --git a/doc/models/invoice-role-1.md b/doc/models/invoice-role-1.md new file mode 100644 index 00000000..55f1d30e --- /dev/null +++ b/doc/models/invoice-role-1.md @@ -0,0 +1,24 @@ + +# Invoice Role 1 + +The role of the credit note (e.g. 'general') + +## Enumeration + +`InvoiceRole1` + +## Fields + +| Name | +| --- | +| `Unset` | +| `Signup` | +| `Renewal` | +| `Usage` | +| `Reactivation` | +| `Proration` | +| `Migration` | +| `Adhoc` | +| `Backport` | +| `Backportbalancereconciliation` | + diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index ad34b09e..f3c87958 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -1,7 +1,7 @@ # Invoice Status -The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. +The current status of the invoice. See [Invoice Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) for more. ## Enumeration diff --git a/doc/models/invoice.md b/doc/models/invoice.md index 8b6c92e2..1d2b9732 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -22,7 +22,7 @@ | `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://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | InvoiceStatus getStatus() | setStatus(InvoiceStatus status) | +| `Status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) for more. | InvoiceStatus getStatus() | setStatus(InvoiceStatus status) | | `Role` | [`InvoiceRole`](../../doc/models/invoice-role.md) | Optional | - | InvoiceRole getRole() | setRole(InvoiceRole role) | | `ParentInvoiceId` | `Integer` | Optional | - | Integer getParentInvoiceId() | setParentInvoiceId(Integer parentInvoiceId) | | `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`.
**Default**: `CollectionMethod.AUTOMATIC` | CollectionMethod getCollectionMethod() | setCollectionMethod(CollectionMethod collectionMethod) | diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index bf85ce24..b976a06c 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -12,8 +12,8 @@ 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). | InvoiceConsolidationLevel getConsolidationLevel() | setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) | -| `FromStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice before event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | InvoiceStatus getFromStatus() | setFromStatus(InvoiceStatus fromStatus) | -| `ToStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice after event occurence. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | InvoiceStatus getToStatus() | setToStatus(InvoiceStatus toStatus) | +| `FromStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice before event occurrence. See [Invoice Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statusess) 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-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statusess) 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) | diff --git a/doc/models/list-invoice-events-response.md b/doc/models/list-invoice-events-response.md index 0fad1269..a2304065 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -21,7 +21,7 @@ "events": [ { "id": 68, - "event_type": "void_invoice", + "event_type": "create_debit_note", "event_data": { "uid": "uid2", "credit_note_number": "credit_note_number4", diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index 325aa24b..60371288 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `InvoiceId` | `String` | Optional | The uid of the paid invoice | String getInvoiceId() | setInvoiceId(String invoiceId) | -| `Status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) for more. | InvoiceStatus getStatus() | setStatus(InvoiceStatus status) | +| `Status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) for more. | InvoiceStatus getStatus() | setStatus(InvoiceStatus status) | | `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) | diff --git a/pom.xml b/pom.xml index 4333718b..afe74ca4 100644 --- a/pom.xml +++ b/pom.xml @@ -223,4 +223,4 @@ Maxio integrates directly into your product, so you can seamlessly manage your p repo - \ No newline at end of file + diff --git a/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java b/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java index 3b20c75b..7c246fe2 100644 --- a/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java +++ b/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java @@ -96,7 +96,7 @@ public final class AdvancedBillingClient implements Configuration { private static final CompatibilityFactory compatibilityFactory = new CompatibilityFactoryImpl(); - private static String userAgent = "AB SDK Java:3.0.0 on OS {os-info}"; + private static String userAgent = "AB SDK Java:2.0.1 on OS {os-info}"; /** * Current API environment. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java b/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java index 38f3d5cd..27e0a565 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java @@ -36,8 +36,8 @@ public AdvanceInvoiceController(GlobalConfiguration globalConfig) { /** * Generate an invoice in advance for a subscription's next renewal date. [Please see our - * docs](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404811062541-Issue-Invoice-In-Advance - * ) for more information on advance invoices, including eligibility on generating one; for the + * docs](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404811062541-Issue-Invoice-In-Advance) + * for more information on advance invoices, including eligibility on 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 diff --git a/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java b/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java index 2da896a8..5a41531d 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java @@ -132,8 +132,17 @@ public PaymentProfilesController(GlobalConfiguration globalConfig) { * "bank_name": "Australian bank", "bank_branch_code": "000000", "bank_account_number": * "000123456" "payment_type": "bank_account", "billing_address": "Test", "billing_city": "Stony * Rise", "billing_state": "Tasmania", "billing_zip": "12345", "billing_country": "AU" } } ``` - * ## 3D Secure - Checkout It may happen that a payment needs 3D Secure Authentication when the - * payment profile is created; this is referred to in our help docs as a [post-authentication + * ## Stripe BACS Direct Debit Contact the support team to enable this payment method. For more + * information on Stripe BACS Direct Debit, please view the following resources: + [Full + * documentation on Stripe BACS Direct + * Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) + * ### Stripe BACS Direct Debit Payment Profiles The following example creates a customer, bank + * account and mandate in Stripe: ```json { "payment_profile": { "customer_id": "24907598", + * "bank_name": "British bank", "bank_branch_code": "108800", "bank_account_number": "00012345" + * "payment_type": "bank_account", "billing_address": "Test", "billing_city": "London", + * "billing_state": "LND", "billing_zip": "12345", "billing_country": "GB" } } ``` ## 3D Secure + * - Checkout It may happen that a payment needs 3D Secure Authentication when the payment + * profile is created; this is referred to in our help docs as a [post-authentication * flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). * The server returns `422 Unprocessable Entity` in this case with the following response: * ```json { "jsonapi": { "version": "1.0" }, "errors": [ { "title": "This card requires diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java index fba0bdc0..263b2caa 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java @@ -147,6 +147,8 @@ private ApiCall, ApiException> prepareListSu .value(input.getStartDatetime()).isRequired(false)) .queryParam(param -> param.key("include") .value(ListSubscriptionComponentsInclude.toValue(input.getInclude())).isRequired(false)) + .queryParam(param -> param.key("in_use") + .value(input.getInUse()).isRequired(false)) .templateParam(param -> param.key("subscription_id").value(input.getSubscriptionId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java index 674fdece..efdc30b4 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java @@ -207,20 +207,33 @@ public SubscriptionsController(GlobalConfiguration globalConfig) { * "bank_account_attributes": { "bank_name": "Test Bank", "bank_iban": "DE89370400440532013000", * "payment_type": "bank_account" } } } ``` ## Subscription using Stripe BECS Direct Debit For * more information on Stripe Direct Debit, please view the following two resources: + [Payment - * Profiles via API for Stripe BECS Direct - * Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-payment-profile#stripe-becs-direct-debit) - * + [Full documentation on Stripe Direct + * Profiles via API for Stripe BECS Direct Debit]($e/Payment%20Profiles/createPaymentProfile) + + * [Full documentation on Stripe Direct * Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) - * + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal - * example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway) + * + [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal + * example](page:development-tools/chargify-js/examples#minimal-example-with-sepa-becs-or-bacs-direct-debit-stripe-gateway) * + [Using Chargify.js with Stripe BECS Direct Debit - full - * example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDIy-examples#full-example-with-becs-direct-debit-stripe-gateway) + * example](page:development-tools/chargify-js/examples#full-example-with-becs-direct-debit-stripe-gateway) * ```json { "subscription": { "product_handle": "gold-product", "customer_attributes": { * "first_name": "Jane", "last_name": "Doe", "email": "jd{@literal @}chargify.test" }, * "bank_account_attributes": { "bank_name": "Test Bank", "bank_branch_code": "000000", - * "bank_account_number": "000123456", "payment_type": "bank_account" } } } ``` ## 3D Secure - - * Stripe It may happen that a payment needs 3D Secure Authentication when the subscription is - * created; this is referred to in our help docs as a [post-authentication + * "bank_account_number": "000123456", "payment_type": "bank_account" } } } ``` ## Subscription + * using Stripe BACS Direct Debit For more information on Stripe Direct Debit, please view the + * following two resources: + [Payment Profiles via API for Stripe BACS Direct + * Debit]($e/Payment%20Profiles/createPaymentProfile) + [Full documentation on Stripe Direct + * Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-Stripe-SEPA-and-BECS-Direct-Debit) + * + [Using Chargify.js with Stripe SEPA, BECS or BACS Direct Debit - minimal + * example](page:development-tools/chargify-js/examples#minimal-example-with-sepa-becs-or-bacs-direct-debit-stripe-gateway) + * + [Using Chargify.js with Stripe BACS Direct Debit - full + * example](page:development-tools/chargify-js/examples#full-example-with-bacs-direct-debit-stripe-gateway) + * ```json { "subscription": { "product_handle": "gold-product", "customer_attributes": { + * "first_name": "Jane", "last_name": "Doe", "email": "jd{@literal @}chargify.test" }, + * "bank_account_attributes": { "bank_name": "Test Bank", "bank_branch_code": "108800", + * "bank_account_number": "00012345", "payment_type": "bank_account", "billing_address": "123 + * Main St.", "billing_city": "London", "billing_state": "LND", "billing_zip": "W1A 1AA", + * "billing_country": "GB" } } } ``` ## 3D Secure - Stripe It may happen that a payment needs 3D + * Secure Authentication when the subscription is created; this is referred to in our help docs + * as a [post-authentication * flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#psd2-flows-pre-authentication-and-post-authentication). * The server returns `422 Unprocessable Entity` in this case with the following response: * ```json { "errors": [ "Your card was declined. This transaction requires 3D secure diff --git a/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java b/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java index c50bc6b1..8dc6d8f3 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java +++ b/src/main/java/com/maxio/advancedbilling/models/ApplyCreditNoteEventData.java @@ -15,6 +15,7 @@ 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; import java.util.List; @@ -29,7 +30,7 @@ public class ApplyCreditNoteEventData private String originalAmount; private String appliedAmount; private ZonedDateTime transactionTime; - private String memo; + private OptionalNullable memo; private String role; private Boolean consolidatedInvoice; private List appliedCreditNotes; @@ -70,6 +71,36 @@ public ApplyCreditNoteEventData( this.originalAmount = originalAmount; this.appliedAmount = appliedAmount; this.transactionTime = transactionTime; + this.memo = OptionalNullable.of(memo); + this.role = role; + this.consolidatedInvoice = consolidatedInvoice; + this.appliedCreditNotes = appliedCreditNotes; + } + + /** + * Initialization constructor. + * @param uid String value for uid. + * @param creditNoteNumber String value for creditNoteNumber. + * @param creditNoteUid String value for creditNoteUid. + * @param originalAmount String value for originalAmount. + * @param appliedAmount String value for appliedAmount. + * @param transactionTime ZonedDateTime value for transactionTime. + * @param memo String value for memo. + * @param role String value for role. + * @param consolidatedInvoice Boolean value for consolidatedInvoice. + * @param appliedCreditNotes List of AppliedCreditNoteData value for appliedCreditNotes. + */ + + protected ApplyCreditNoteEventData(String uid, String creditNoteNumber, String creditNoteUid, + String originalAmount, String appliedAmount, ZonedDateTime transactionTime, + OptionalNullable memo, String role, Boolean consolidatedInvoice, + List appliedCreditNotes) { + this.uid = uid; + this.creditNoteNumber = creditNoteNumber; + this.creditNoteUid = creditNoteUid; + this.originalAmount = originalAmount; + this.appliedAmount = appliedAmount; + this.transactionTime = transactionTime; this.memo = memo; this.role = role; this.consolidatedInvoice = consolidatedInvoice; @@ -91,8 +122,9 @@ protected ApplyCreditNoteEventData( @JsonProperty("credit_note_uid") String creditNoteUid, @JsonProperty("original_amount") String originalAmount, @JsonProperty("applied_amount") String appliedAmount) { - this(uid, creditNoteNumber, creditNoteUid, originalAmount, appliedAmount, null, null, null, - null, null); + this(uid, creditNoteNumber, creditNoteUid, originalAmount, appliedAmount, null, + OptionalNullable.of(null), null, null, null); + unsetMemo(); } /** @@ -223,14 +255,24 @@ public void setTransactionTime(ZonedDateTime transactionTime) { } /** - * Getter for Memo. + * Internal Getter for Memo. * The credit note memo. - * @return Returns the String + * @return Returns the Internal String */ @JsonGetter("memo") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetMemo() { + return this.memo; + } + + /** + * Getter for Memo. + * The credit note memo. + * @return Returns the String + */ public String getMemo() { - return memo; + return OptionalNullable.getFrom(memo); } /** @@ -240,7 +282,15 @@ public String getMemo() { */ @JsonSetter("memo") public void setMemo(String memo) { - this.memo = memo; + this.memo = OptionalNullable.of(memo); + } + + /** + * UnSetter for Memo. + * The credit note memo. + */ + public void unsetMemo() { + memo = null; } /** @@ -329,10 +379,10 @@ public Builder toBuilder() { Builder builder = new Builder(uid, creditNoteNumber, creditNoteUid, originalAmount, appliedAmount) .transactionTime(getTransactionTime()) - .memo(getMemo()) .role(getRole()) .consolidatedInvoice(getConsolidatedInvoice()) .appliedCreditNotes(getAppliedCreditNotes()); + builder.memo = internalGetMemo(); return builder; } @@ -346,7 +396,7 @@ public static class Builder { private String originalAmount; private String appliedAmount; private ZonedDateTime transactionTime; - private String memo; + private OptionalNullable memo; private String role; private Boolean consolidatedInvoice; private List appliedCreditNotes; @@ -440,7 +490,16 @@ public Builder transactionTime(ZonedDateTime transactionTime) { * @return Builder */ public Builder memo(String memo) { - this.memo = memo; + this.memo = OptionalNullable.of(memo); + return this; + } + + /** + * UnSetter for memo. + * @return Builder + */ + public Builder unsetMemo() { + memo = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ApplyDebitNoteEventData.java b/src/main/java/com/maxio/advancedbilling/models/ApplyDebitNoteEventData.java index 7988cc95..90f6ef0c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ApplyDebitNoteEventData.java +++ b/src/main/java/com/maxio/advancedbilling/models/ApplyDebitNoteEventData.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 ApplyDebitNoteEventData type. @@ -21,6 +27,8 @@ public class ApplyDebitNoteEventData private String debitNoteUid; private String originalAmount; private String appliedAmount; + private OptionalNullable memo; + private OptionalNullable transactionTime; /** * Default constructor. @@ -34,17 +42,62 @@ public ApplyDebitNoteEventData() { * @param debitNoteUid String value for debitNoteUid. * @param originalAmount String value for originalAmount. * @param appliedAmount String value for appliedAmount. + * @param memo String value for memo. + * @param transactionTime ZonedDateTime value for transactionTime. */ - @JsonCreator public ApplyDebitNoteEventData( - @JsonProperty("debit_note_number") String debitNoteNumber, - @JsonProperty("debit_note_uid") String debitNoteUid, - @JsonProperty("original_amount") String originalAmount, - @JsonProperty("applied_amount") String appliedAmount) { + String debitNoteNumber, + String debitNoteUid, + String originalAmount, + String appliedAmount, + String memo, + ZonedDateTime transactionTime) { this.debitNoteNumber = debitNoteNumber; this.debitNoteUid = debitNoteUid; this.originalAmount = originalAmount; this.appliedAmount = appliedAmount; + this.memo = OptionalNullable.of(memo); + this.transactionTime = OptionalNullable.of(transactionTime); + } + + /** + * Initialization constructor. + * @param debitNoteNumber String value for debitNoteNumber. + * @param debitNoteUid String value for debitNoteUid. + * @param originalAmount String value for originalAmount. + * @param appliedAmount String value for appliedAmount. + * @param memo String value for memo. + * @param transactionTime ZonedDateTime value for transactionTime. + */ + + protected ApplyDebitNoteEventData(String debitNoteNumber, String debitNoteUid, + String originalAmount, String appliedAmount, OptionalNullable memo, + OptionalNullable transactionTime) { + this.debitNoteNumber = debitNoteNumber; + this.debitNoteUid = debitNoteUid; + this.originalAmount = originalAmount; + this.appliedAmount = appliedAmount; + this.memo = memo; + this.transactionTime = transactionTime; + } + + /** + * Initialization constructor. + * @param debitNoteNumber String value for debitNoteNumber. + * @param debitNoteUid String value for debitNoteUid. + * @param originalAmount String value for originalAmount. + * @param appliedAmount String value for appliedAmount. + */ + @JsonCreator + protected ApplyDebitNoteEventData( + @JsonProperty("debit_note_number") String debitNoteNumber, + @JsonProperty("debit_note_uid") String debitNoteUid, + @JsonProperty("original_amount") String originalAmount, + @JsonProperty("applied_amount") String appliedAmount) { + this(debitNoteNumber, debitNoteUid, originalAmount, appliedAmount, + OptionalNullable.of(null), OptionalNullable.of(null)); + unsetMemo(); + unsetTransactionTime(); } /** @@ -129,6 +182,85 @@ public void setAppliedAmount(String appliedAmount) { this.appliedAmount = appliedAmount; } + /** + * Internal Getter for Memo. + * The debit note memo. + * @return Returns the Internal String + */ + @JsonGetter("memo") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetMemo() { + return this.memo; + } + + /** + * Getter for Memo. + * The debit note memo. + * @return Returns the String + */ + public String getMemo() { + return OptionalNullable.getFrom(memo); + } + + /** + * Setter for Memo. + * The debit note memo. + * @param memo Value for String + */ + @JsonSetter("memo") + public void setMemo(String memo) { + this.memo = OptionalNullable.of(memo); + } + + /** + * UnSetter for Memo. + * The debit note memo. + */ + public void unsetMemo() { + memo = null; + } + + /** + * Internal Getter for TransactionTime. + * The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" + * @return Returns the Internal ZonedDateTime + */ + @JsonGetter("transaction_time") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) + protected OptionalNullable internalGetTransactionTime() { + return this.transactionTime; + } + + /** + * Getter for TransactionTime. + * The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" + * @return Returns the ZonedDateTime + */ + public ZonedDateTime getTransactionTime() { + return OptionalNullable.getFrom(transactionTime); + } + + /** + * Setter for TransactionTime. + * The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" + * @param transactionTime Value for ZonedDateTime + */ + @JsonSetter("transaction_time") + @JsonDeserialize(using = DateTimeHelper.Rfc8601DateTimeDeserializer.class) + public void setTransactionTime(ZonedDateTime transactionTime) { + this.transactionTime = OptionalNullable.of(transactionTime); + } + + /** + * UnSetter for TransactionTime. + * The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" + */ + public void unsetTransactionTime() { + transactionTime = null; + } + /** * Converts this ApplyDebitNoteEventData into string format. * @return String representation of this class @@ -137,8 +269,8 @@ public void setAppliedAmount(String appliedAmount) { public String toString() { return "ApplyDebitNoteEventData [" + "debitNoteNumber=" + debitNoteNumber + ", debitNoteUid=" + debitNoteUid + ", originalAmount=" + originalAmount - + ", appliedAmount=" + appliedAmount + ", additionalProperties=" - + getAdditionalProperties() + "]"; + + ", appliedAmount=" + appliedAmount + ", memo=" + memo + ", transactionTime=" + + transactionTime + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -148,6 +280,8 @@ public String toString() { */ public Builder toBuilder() { Builder builder = new Builder(debitNoteNumber, debitNoteUid, originalAmount, appliedAmount); + builder.memo = internalGetMemo(); + builder.transactionTime = internalGetTransactionTime(); return builder; } @@ -159,6 +293,8 @@ public static class Builder { private String debitNoteUid; private String originalAmount; private String appliedAmount; + private OptionalNullable memo; + private OptionalNullable transactionTime; /** * Initialization constructor. @@ -221,13 +357,51 @@ public Builder appliedAmount(String appliedAmount) { return this; } + /** + * Setter for memo. + * @param memo String value for memo. + * @return Builder + */ + public Builder memo(String memo) { + this.memo = OptionalNullable.of(memo); + return this; + } + + /** + * UnSetter for memo. + * @return Builder + */ + public Builder unsetMemo() { + memo = null; + return this; + } + + /** + * Setter for transactionTime. + * @param transactionTime ZonedDateTime value for transactionTime. + * @return Builder + */ + public Builder transactionTime(ZonedDateTime transactionTime) { + this.transactionTime = OptionalNullable.of(transactionTime); + return this; + } + + /** + * UnSetter for transactionTime. + * @return Builder + */ + public Builder unsetTransactionTime() { + transactionTime = null; + return this; + } + /** * Builds a new {@link ApplyDebitNoteEventData} object using the set fields. * @return {@link ApplyDebitNoteEventData} */ public ApplyDebitNoteEventData build() { return new ApplyDebitNoteEventData(debitNoteNumber, debitNoteUid, originalAmount, - appliedAmount); + appliedAmount, memo, transactionTime); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ApplyPaymentEventData.java b/src/main/java/com/maxio/advancedbilling/models/ApplyPaymentEventData.java index 5b093f7d..af431f13 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ApplyPaymentEventData.java +++ b/src/main/java/com/maxio/advancedbilling/models/ApplyPaymentEventData.java @@ -24,6 +24,7 @@ */ public class ApplyPaymentEventData extends BaseModel { + private InvoiceConsolidationLevel consolidationLevel; private String memo; private String originalAmount; private String appliedAmount; @@ -43,6 +44,7 @@ public ApplyPaymentEventData() { /** * Initialization constructor. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. * @param memo String value for memo. * @param originalAmount String value for originalAmount. * @param appliedAmount String value for appliedAmount. @@ -55,6 +57,7 @@ public ApplyPaymentEventData() { * @param external Boolean value for external. */ public ApplyPaymentEventData( + InvoiceConsolidationLevel consolidationLevel, String memo, String originalAmount, String appliedAmount, @@ -65,6 +68,7 @@ public ApplyPaymentEventData( String remainingPrepaymentAmount, Boolean prepayment, Boolean external) { + this.consolidationLevel = consolidationLevel; this.memo = memo; this.originalAmount = originalAmount; this.appliedAmount = appliedAmount; @@ -79,6 +83,7 @@ public ApplyPaymentEventData( /** * Initialization constructor. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. * @param memo String value for memo. * @param originalAmount String value for originalAmount. * @param appliedAmount String value for appliedAmount. @@ -91,11 +96,13 @@ public ApplyPaymentEventData( * @param external Boolean value for external. */ - protected ApplyPaymentEventData(String memo, String originalAmount, String appliedAmount, - ZonedDateTime transactionTime, InvoiceEventPayment paymentMethod, Integer transactionId, + protected ApplyPaymentEventData(InvoiceConsolidationLevel consolidationLevel, String memo, + String originalAmount, String appliedAmount, ZonedDateTime transactionTime, + InvoiceEventPayment paymentMethod, Integer transactionId, OptionalNullable parentInvoiceNumber, OptionalNullable remainingPrepaymentAmount, Boolean prepayment, Boolean external) { + this.consolidationLevel = consolidationLevel; this.memo = memo; this.originalAmount = originalAmount; this.appliedAmount = appliedAmount; @@ -110,6 +117,7 @@ protected ApplyPaymentEventData(String memo, String originalAmount, String appli /** * Initialization constructor. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. * @param memo String value for memo. * @param originalAmount String value for originalAmount. * @param appliedAmount String value for appliedAmount. @@ -118,17 +126,37 @@ protected ApplyPaymentEventData(String memo, String originalAmount, String appli */ @JsonCreator protected ApplyPaymentEventData( + @JsonProperty("consolidation_level") InvoiceConsolidationLevel consolidationLevel, @JsonProperty("memo") String memo, @JsonProperty("original_amount") String originalAmount, @JsonProperty("applied_amount") String appliedAmount, @JsonProperty("transaction_time") ZonedDateTime transactionTime, @JsonProperty("payment_method") InvoiceEventPayment paymentMethod) { - this(memo, originalAmount, appliedAmount, transactionTime, paymentMethod, null, - OptionalNullable.of(null), OptionalNullable.of(null), null, null); + this(consolidationLevel, memo, originalAmount, appliedAmount, transactionTime, + paymentMethod, null, OptionalNullable.of(null), OptionalNullable.of(null), null, + null); unsetParentInvoiceNumber(); unsetRemainingPrepaymentAmount(); } + /** + * Getter for ConsolidationLevel. + * @return Returns the InvoiceConsolidationLevel + */ + @JsonGetter("consolidation_level") + public InvoiceConsolidationLevel getConsolidationLevel() { + return consolidationLevel; + } + + /** + * Setter for ConsolidationLevel. + * @param consolidationLevel Value for InvoiceConsolidationLevel + */ + @JsonSetter("consolidation_level") + public void setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) { + this.consolidationLevel = consolidationLevel; + } + /** * Getter for Memo. * The payment memo @@ -378,12 +406,13 @@ public void setExternal(Boolean external) { */ @Override public String toString() { - return "ApplyPaymentEventData [" + "memo=" + memo + ", originalAmount=" + originalAmount - + ", appliedAmount=" + appliedAmount + ", transactionTime=" + transactionTime - + ", paymentMethod=" + paymentMethod + ", transactionId=" + transactionId - + ", parentInvoiceNumber=" + parentInvoiceNumber + ", remainingPrepaymentAmount=" - + remainingPrepaymentAmount + ", prepayment=" + prepayment + ", external=" - + external + ", additionalProperties=" + getAdditionalProperties() + "]"; + return "ApplyPaymentEventData [" + "consolidationLevel=" + consolidationLevel + ", memo=" + + memo + ", originalAmount=" + originalAmount + ", appliedAmount=" + appliedAmount + + ", transactionTime=" + transactionTime + ", paymentMethod=" + paymentMethod + + ", transactionId=" + transactionId + ", parentInvoiceNumber=" + + parentInvoiceNumber + ", remainingPrepaymentAmount=" + remainingPrepaymentAmount + + ", prepayment=" + prepayment + ", external=" + external + + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -392,8 +421,8 @@ public String toString() { * @return a new {@link ApplyPaymentEventData.Builder} object */ public Builder toBuilder() { - Builder builder = new Builder(memo, originalAmount, appliedAmount, transactionTime, - paymentMethod) + Builder builder = new Builder(consolidationLevel, memo, originalAmount, appliedAmount, + transactionTime, paymentMethod) .transactionId(getTransactionId()) .prepayment(getPrepayment()) .external(getExternal()); @@ -406,6 +435,7 @@ public Builder toBuilder() { * Class to build instances of {@link ApplyPaymentEventData}. */ public static class Builder { + private InvoiceConsolidationLevel consolidationLevel; private String memo; private String originalAmount; private String appliedAmount; @@ -425,14 +455,17 @@ public Builder() { /** * Initialization constructor. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. * @param memo String value for memo. * @param originalAmount String value for originalAmount. * @param appliedAmount String value for appliedAmount. * @param transactionTime ZonedDateTime value for transactionTime. * @param paymentMethod InvoiceEventPayment value for paymentMethod. */ - public Builder(String memo, String originalAmount, String appliedAmount, - ZonedDateTime transactionTime, InvoiceEventPayment paymentMethod) { + public Builder(InvoiceConsolidationLevel consolidationLevel, String memo, + String originalAmount, String appliedAmount, ZonedDateTime transactionTime, + InvoiceEventPayment paymentMethod) { + this.consolidationLevel = consolidationLevel; this.memo = memo; this.originalAmount = originalAmount; this.appliedAmount = appliedAmount; @@ -440,6 +473,16 @@ public Builder(String memo, String originalAmount, String appliedAmount, this.paymentMethod = paymentMethod; } + /** + * Setter for consolidationLevel. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. + * @return Builder + */ + public Builder consolidationLevel(InvoiceConsolidationLevel consolidationLevel) { + this.consolidationLevel = consolidationLevel; + return this; + } + /** * Setter for memo. * @param memo String value for memo. @@ -563,9 +606,9 @@ public Builder external(Boolean external) { * @return {@link ApplyPaymentEventData} */ public ApplyPaymentEventData build() { - return new ApplyPaymentEventData(memo, originalAmount, appliedAmount, transactionTime, - paymentMethod, transactionId, parentInvoiceNumber, remainingPrepaymentAmount, - prepayment, external); + return new ApplyPaymentEventData(consolidationLevel, memo, originalAmount, + appliedAmount, transactionTime, paymentMethod, transactionId, + parentInvoiceNumber, remainingPrepaymentAmount, prepayment, external); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ChangeChargebackStatusEventData.java b/src/main/java/com/maxio/advancedbilling/models/ChangeChargebackStatusEventData.java new file mode 100644 index 00000000..9b9724f6 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/ChangeChargebackStatusEventData.java @@ -0,0 +1,114 @@ +/* + * 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.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import io.apimatic.core.types.BaseModel; + +/** + * This is a model class for ChangeChargebackStatusEventData type. + */ +public class ChangeChargebackStatusEventData + extends BaseModel { + private ChargebackStatus chargebackStatus; + + /** + * Default constructor. + */ + public ChangeChargebackStatusEventData() { + } + + /** + * Initialization constructor. + * @param chargebackStatus ChargebackStatus value for chargebackStatus. + */ + @JsonCreator + public ChangeChargebackStatusEventData( + @JsonProperty("chargeback_status") ChargebackStatus chargebackStatus) { + this.chargebackStatus = chargebackStatus; + } + + /** + * Getter for ChargebackStatus. + * @return Returns the ChargebackStatus + */ + @JsonGetter("chargeback_status") + public ChargebackStatus getChargebackStatus() { + return chargebackStatus; + } + + /** + * Setter for ChargebackStatus. + * @param chargebackStatus Value for ChargebackStatus + */ + @JsonSetter("chargeback_status") + public void setChargebackStatus(ChargebackStatus chargebackStatus) { + this.chargebackStatus = chargebackStatus; + } + + /** + * Converts this ChangeChargebackStatusEventData into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ChangeChargebackStatusEventData [" + "chargebackStatus=" + chargebackStatus + + ", additionalProperties=" + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link ChangeChargebackStatusEventData.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ChangeChargebackStatusEventData.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(chargebackStatus); + return builder; + } + + /** + * Class to build instances of {@link ChangeChargebackStatusEventData}. + */ + public static class Builder { + private ChargebackStatus chargebackStatus; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param chargebackStatus ChargebackStatus value for chargebackStatus. + */ + public Builder(ChargebackStatus chargebackStatus) { + this.chargebackStatus = chargebackStatus; + } + + /** + * Setter for chargebackStatus. + * @param chargebackStatus ChargebackStatus value for chargebackStatus. + * @return Builder + */ + public Builder chargebackStatus(ChargebackStatus chargebackStatus) { + this.chargebackStatus = chargebackStatus; + return this; + } + + /** + * Builds a new {@link ChangeChargebackStatusEventData} object using the set fields. + * @return {@link ChangeChargebackStatusEventData} + */ + public ChangeChargebackStatusEventData build() { + return new ChangeChargebackStatusEventData(chargebackStatus); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/ChangeInvoiceStatusEventData.java b/src/main/java/com/maxio/advancedbilling/models/ChangeInvoiceStatusEventData.java new file mode 100644 index 00000000..04049fbd --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/ChangeInvoiceStatusEventData.java @@ -0,0 +1,285 @@ +/* + * 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 io.apimatic.core.types.BaseModel; + +/** + * This is a model class for ChangeInvoiceStatusEventData type. + */ +public class ChangeInvoiceStatusEventData + extends BaseModel { + private String gatewayTransId; + private String amount; + private InvoiceStatus fromStatus; + private InvoiceStatus toStatus; + private InvoiceConsolidationLevel consolidationLevel; + + /** + * Default constructor. + */ + public ChangeInvoiceStatusEventData() { + } + + /** + * Initialization constructor. + * @param fromStatus InvoiceStatus value for fromStatus. + * @param toStatus InvoiceStatus value for toStatus. + * @param gatewayTransId String value for gatewayTransId. + * @param amount String value for amount. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. + */ + public ChangeInvoiceStatusEventData( + InvoiceStatus fromStatus, + InvoiceStatus toStatus, + String gatewayTransId, + String amount, + InvoiceConsolidationLevel consolidationLevel) { + this.gatewayTransId = gatewayTransId; + this.amount = amount; + this.fromStatus = fromStatus; + this.toStatus = toStatus; + this.consolidationLevel = consolidationLevel; + } + + /** + * Initialization constructor. + * @param fromStatus InvoiceStatus value for fromStatus. + * @param toStatus InvoiceStatus value for toStatus. + */ + @JsonCreator + protected ChangeInvoiceStatusEventData( + @JsonProperty("from_status") InvoiceStatus fromStatus, + @JsonProperty("to_status") InvoiceStatus toStatus) { + this(fromStatus, toStatus, null, null, null); + } + + /** + * Getter for GatewayTransId. + * Identifier for the transaction within the payment gateway. + * @return Returns the String + */ + @JsonGetter("gateway_trans_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getGatewayTransId() { + return gatewayTransId; + } + + /** + * Setter for GatewayTransId. + * Identifier for the transaction within the payment gateway. + * @param gatewayTransId Value for String + */ + @JsonSetter("gateway_trans_id") + public void setGatewayTransId(String gatewayTransId) { + this.gatewayTransId = gatewayTransId; + } + + /** + * Getter for Amount. + * The monetary value associated with the linked payment, expressed in dollars. + * @return Returns the String + */ + @JsonGetter("amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAmount() { + return amount; + } + + /** + * Setter for Amount. + * The monetary value associated with the linked payment, expressed in dollars. + * @param amount Value for String + */ + @JsonSetter("amount") + public void setAmount(String amount) { + this.amount = amount; + } + + /** + * Getter for FromStatus. + * The status of the invoice before any changes occurred. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) + * for more. + * @return Returns the InvoiceStatus + */ + @JsonGetter("from_status") + public InvoiceStatus getFromStatus() { + return fromStatus; + } + + /** + * Setter for FromStatus. + * The status of the invoice before any changes occurred. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) + * for more. + * @param fromStatus Value for InvoiceStatus + */ + @JsonSetter("from_status") + public void setFromStatus(InvoiceStatus fromStatus) { + this.fromStatus = fromStatus; + } + + /** + * Getter for ToStatus. + * The updated status of the invoice after changes have been made. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) + * for more. + * @return Returns the InvoiceStatus + */ + @JsonGetter("to_status") + public InvoiceStatus getToStatus() { + return toStatus; + } + + /** + * Setter for ToStatus. + * The updated status of the invoice after changes have been made. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) + * for more. + * @param toStatus Value for InvoiceStatus + */ + @JsonSetter("to_status") + public void setToStatus(InvoiceStatus toStatus) { + this.toStatus = toStatus; + } + + /** + * Getter for ConsolidationLevel. + * @return Returns the InvoiceConsolidationLevel + */ + @JsonGetter("consolidation_level") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceConsolidationLevel getConsolidationLevel() { + return consolidationLevel; + } + + /** + * Setter for ConsolidationLevel. + * @param consolidationLevel Value for InvoiceConsolidationLevel + */ + @JsonSetter("consolidation_level") + public void setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) { + this.consolidationLevel = consolidationLevel; + } + + /** + * Converts this ChangeInvoiceStatusEventData into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ChangeInvoiceStatusEventData [" + "fromStatus=" + fromStatus + ", toStatus=" + + toStatus + ", gatewayTransId=" + gatewayTransId + ", amount=" + amount + + ", consolidationLevel=" + consolidationLevel + ", additionalProperties=" + + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link ChangeInvoiceStatusEventData.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ChangeInvoiceStatusEventData.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(fromStatus, toStatus) + .gatewayTransId(getGatewayTransId()) + .amount(getAmount()) + .consolidationLevel(getConsolidationLevel()); + return builder; + } + + /** + * Class to build instances of {@link ChangeInvoiceStatusEventData}. + */ + public static class Builder { + private InvoiceStatus fromStatus; + private InvoiceStatus toStatus; + private String gatewayTransId; + private String amount; + private InvoiceConsolidationLevel consolidationLevel; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param fromStatus InvoiceStatus value for fromStatus. + * @param toStatus InvoiceStatus value for toStatus. + */ + public Builder(InvoiceStatus fromStatus, InvoiceStatus toStatus) { + this.fromStatus = fromStatus; + this.toStatus = toStatus; + } + + /** + * Setter for fromStatus. + * @param fromStatus InvoiceStatus value for fromStatus. + * @return Builder + */ + public Builder fromStatus(InvoiceStatus fromStatus) { + this.fromStatus = fromStatus; + return this; + } + + /** + * Setter for toStatus. + * @param toStatus InvoiceStatus value for toStatus. + * @return Builder + */ + public Builder toStatus(InvoiceStatus toStatus) { + this.toStatus = toStatus; + return this; + } + + /** + * Setter for gatewayTransId. + * @param gatewayTransId String value for gatewayTransId. + * @return Builder + */ + public Builder gatewayTransId(String gatewayTransId) { + this.gatewayTransId = gatewayTransId; + return this; + } + + /** + * Setter for amount. + * @param amount String value for amount. + * @return Builder + */ + public Builder amount(String amount) { + this.amount = amount; + return this; + } + + /** + * Setter for consolidationLevel. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. + * @return Builder + */ + public Builder consolidationLevel(InvoiceConsolidationLevel consolidationLevel) { + this.consolidationLevel = consolidationLevel; + return this; + } + + /** + * Builds a new {@link ChangeInvoiceStatusEventData} object using the set fields. + * @return {@link ChangeInvoiceStatusEventData} + */ + public ChangeInvoiceStatusEventData build() { + return new ChangeInvoiceStatusEventData(fromStatus, toStatus, gatewayTransId, amount, + consolidationLevel); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/ChargebackStatus.java b/src/main/java/com/maxio/advancedbilling/models/ChargebackStatus.java new file mode 100644 index 00000000..112f97fb --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/ChargebackStatus.java @@ -0,0 +1,100 @@ +/* + * 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; + + +/** + * ChargebackStatus to be used. + */ +public enum ChargebackStatus { + OPEN, + + LOST, + + WON, + + CLOSED; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + OPEN.value = "open"; + LOST.value = "lost"; + WON.value = "won"; + CLOSED.value = "closed"; + + valueMap.put("open", OPEN); + valueMap.put("lost", LOST); + valueMap.put("won", WON); + valueMap.put("closed", CLOSED); + } + + /** + * 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 ChargebackStatus constructFromString(String toConvert) throws IOException { + ChargebackStatus 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 ChargebackStatus 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 ChargebackStatus values to list of string values. + * @param toConvert The list of ChargebackStatus 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 (ChargebackStatus enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java b/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java index 108f05c5..b67a9f3f 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePaymentProfile.java @@ -879,8 +879,8 @@ public void setBankRoutingNumber(String bankRoutingNumber) { /** * Getter for BankAccountNumber. - * (Required when creating with ACH, GoCardless, Stripe BECS Direct Debit and bank_iban is - * blank) The customerʼs bank account number + * (Required when creating with ACH, GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban + * is blank) The customerʼs bank account number * @return Returns the String */ @JsonGetter("bank_account_number") @@ -891,8 +891,8 @@ public String getBankAccountNumber() { /** * Setter for BankAccountNumber. - * (Required when creating with ACH, GoCardless, Stripe BECS Direct Debit and bank_iban is - * blank) The customerʼs bank account number + * (Required when creating with ACH, GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban + * is blank) The customerʼs bank account number * @param bankAccountNumber Value for String */ @JsonSetter("bank_account_number") @@ -902,8 +902,8 @@ public void setBankAccountNumber(String bankAccountNumber) { /** * Getter for BankBranchCode. - * (Optional when creating with GoCardless, required with Stripe BECS Direct Debit) Branch code. - * Alternatively, an IBAN can be provided + * (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) + * Branch/Sort code. Alternatively, an IBAN can be provided * @return Returns the String */ @JsonGetter("bank_branch_code") @@ -914,8 +914,8 @@ public String getBankBranchCode() { /** * Setter for BankBranchCode. - * (Optional when creating with GoCardless, required with Stripe BECS Direct Debit) Branch code. - * Alternatively, an IBAN can be provided + * (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) + * 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/CreateProductFamily.java b/src/main/java/com/maxio/advancedbilling/models/CreateProductFamily.java index 7a64b80a..6f44b3b5 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateProductFamily.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateProductFamily.java @@ -19,6 +19,7 @@ public class CreateProductFamily extends BaseModel { private String name; + private OptionalNullable handle; private OptionalNullable description; /** @@ -30,23 +31,29 @@ public CreateProductFamily() { /** * Initialization constructor. * @param name String value for name. + * @param handle String value for handle. * @param description String value for description. */ public CreateProductFamily( String name, + String handle, String description) { this.name = name; + this.handle = OptionalNullable.of(handle); this.description = OptionalNullable.of(description); } /** * Initialization constructor. * @param name String value for name. + * @param handle String value for handle. * @param description String value for description. */ - protected CreateProductFamily(String name, OptionalNullable description) { + protected CreateProductFamily(String name, OptionalNullable handle, + OptionalNullable description) { this.name = name; + this.handle = handle; this.description = description; } @@ -55,7 +62,6 @@ protected CreateProductFamily(String name, OptionalNullable description) * @return Returns the String */ @JsonGetter("name") - @JsonInclude(JsonInclude.Include.NON_NULL) public String getName() { return name; } @@ -69,6 +75,41 @@ public void setName(String name) { this.name = name; } + /** + * Internal Getter for Handle. + * @return Returns the Internal String + */ + @JsonGetter("handle") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetHandle() { + return this.handle; + } + + /** + * Getter for Handle. + * @return Returns the String + */ + public String getHandle() { + return OptionalNullable.getFrom(handle); + } + + /** + * Setter for Handle. + * @param handle Value for String + */ + @JsonSetter("handle") + public void setHandle(String handle) { + this.handle = OptionalNullable.of(handle); + } + + /** + * UnSetter for Handle. + */ + public void unsetHandle() { + handle = null; + } + /** * Internal Getter for Description. * @return Returns the Internal String @@ -110,8 +151,8 @@ public void unsetDescription() { */ @Override public String toString() { - return "CreateProductFamily [" + "name=" + name + ", description=" + description - + ", additionalProperties=" + getAdditionalProperties() + "]"; + return "CreateProductFamily [" + "name=" + name + ", handle=" + handle + ", description=" + + description + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -120,8 +161,8 @@ public String toString() { * @return a new {@link CreateProductFamily.Builder} object */ public Builder toBuilder() { - Builder builder = new Builder() - .name(getName()); + Builder builder = new Builder(name); + builder.handle = internalGetHandle(); builder.description = internalGetDescription(); return builder; } @@ -131,9 +172,22 @@ public Builder toBuilder() { */ public static class Builder { private String name; + private OptionalNullable handle; private OptionalNullable description; + /** + * Initialization constructor. + */ + public Builder() { + } + /** + * Initialization constructor. + * @param name String value for name. + */ + public Builder(String name) { + this.name = name; + } /** * Setter for name. @@ -145,6 +199,25 @@ public Builder name(String name) { return this; } + /** + * Setter for handle. + * @param handle String value for handle. + * @return Builder + */ + public Builder handle(String handle) { + this.handle = OptionalNullable.of(handle); + return this; + } + + /** + * UnSetter for handle. + * @return Builder + */ + public Builder unsetHandle() { + handle = null; + return this; + } + /** * Setter for description. * @param description String value for description. @@ -169,7 +242,7 @@ public Builder unsetDescription() { * @return {@link CreateProductFamily} */ public CreateProductFamily build() { - return new CreateProductFamily(name, description); + return new CreateProductFamily(name, handle, description); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/DebitNote.java b/src/main/java/com/maxio/advancedbilling/models/DebitNote.java new file mode 100644 index 00000000..183cf858 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/DebitNote.java @@ -0,0 +1,950 @@ +/* + * 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 DebitNote type. + */ +public class DebitNote + extends BaseModel { + private String uid; + private Integer siteId; + private Integer customerId; + private Integer subscriptionId; + private Integer number; + private Integer sequenceNumber; + private String originCreditNoteUid; + private String originCreditNoteNumber; + private LocalDate issueDate; + private LocalDate appliedDate; + private LocalDate dueDate; + private DebitNoteStatus status; + private String memo; + private DebitNoteRole role; + private String currency; + private InvoiceSeller seller; + private InvoiceCustomer customer; + private InvoiceAddress billingAddress; + private InvoiceAddress shippingAddress; + private List lineItems; + private List discounts; + private List taxes; + private List refunds; + + /** + * Default constructor. + */ + public DebitNote() { + } + + /** + * Initialization constructor. + * @param uid String value for uid. + * @param siteId Integer value for siteId. + * @param customerId Integer value for customerId. + * @param subscriptionId Integer value for subscriptionId. + * @param number Integer value for number. + * @param sequenceNumber Integer value for sequenceNumber. + * @param originCreditNoteUid String value for originCreditNoteUid. + * @param originCreditNoteNumber String value for originCreditNoteNumber. + * @param issueDate LocalDate value for issueDate. + * @param appliedDate LocalDate value for appliedDate. + * @param dueDate LocalDate value for dueDate. + * @param status DebitNoteStatus value for status. + * @param memo String value for memo. + * @param role DebitNoteRole value for role. + * @param currency String value for currency. + * @param seller InvoiceSeller value for seller. + * @param customer InvoiceCustomer value for customer. + * @param billingAddress InvoiceAddress value for billingAddress. + * @param shippingAddress InvoiceAddress value for shippingAddress. + * @param lineItems List of CreditNoteLineItem value for lineItems. + * @param discounts List of InvoiceDiscount value for discounts. + * @param taxes List of InvoiceTax value for taxes. + * @param refunds List of InvoiceRefund value for refunds. + */ + public DebitNote( + String uid, + Integer siteId, + Integer customerId, + Integer subscriptionId, + Integer number, + Integer sequenceNumber, + String originCreditNoteUid, + String originCreditNoteNumber, + LocalDate issueDate, + LocalDate appliedDate, + LocalDate dueDate, + DebitNoteStatus status, + String memo, + DebitNoteRole role, + String currency, + InvoiceSeller seller, + InvoiceCustomer customer, + InvoiceAddress billingAddress, + InvoiceAddress shippingAddress, + List lineItems, + List discounts, + List taxes, + List refunds) { + this.uid = uid; + this.siteId = siteId; + this.customerId = customerId; + this.subscriptionId = subscriptionId; + this.number = number; + this.sequenceNumber = sequenceNumber; + this.originCreditNoteUid = originCreditNoteUid; + this.originCreditNoteNumber = originCreditNoteNumber; + this.issueDate = issueDate; + this.appliedDate = appliedDate; + this.dueDate = dueDate; + this.status = status; + this.memo = memo; + this.role = role; + this.currency = currency; + this.seller = seller; + this.customer = customer; + this.billingAddress = billingAddress; + this.shippingAddress = shippingAddress; + this.lineItems = lineItems; + this.discounts = discounts; + this.taxes = taxes; + this.refunds = refunds; + } + + /** + * Getter for Uid. + * Unique identifier for the debit note. It is generated automatically by Chargify and has the + * prefix "db_" followed by alphanumeric characters. + * @return Returns the String + */ + @JsonGetter("uid") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUid() { + return uid; + } + + /** + * Setter for Uid. + * Unique identifier for the debit note. It is generated automatically by Chargify and has the + * prefix "db_" followed by alphanumeric characters. + * @param uid Value for String + */ + @JsonSetter("uid") + public void setUid(String uid) { + this.uid = uid; + } + + /** + * Getter for SiteId. + * ID of the site to which the debit note belongs. + * @return Returns the Integer + */ + @JsonGetter("site_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getSiteId() { + return siteId; + } + + /** + * Setter for SiteId. + * ID of the site to which the debit note belongs. + * @param siteId Value for Integer + */ + @JsonSetter("site_id") + public void setSiteId(Integer siteId) { + this.siteId = siteId; + } + + /** + * Getter for CustomerId. + * ID of the customer to which the debit note belongs. + * @return Returns the Integer + */ + @JsonGetter("customer_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getCustomerId() { + return customerId; + } + + /** + * Setter for CustomerId. + * ID of the customer to which the debit note belongs. + * @param customerId Value for Integer + */ + @JsonSetter("customer_id") + public void setCustomerId(Integer customerId) { + this.customerId = customerId; + } + + /** + * Getter for SubscriptionId. + * ID of the subscription that generated the debit note. + * @return Returns the Integer + */ + @JsonGetter("subscription_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getSubscriptionId() { + return subscriptionId; + } + + /** + * Setter for SubscriptionId. + * ID of the subscription that generated the debit note. + * @param subscriptionId Value for Integer + */ + @JsonSetter("subscription_id") + public void setSubscriptionId(Integer subscriptionId) { + this.subscriptionId = subscriptionId; + } + + /** + * Getter for Number. + * A unique, identifier that appears on the debit note and in places it is referenced. + * @return Returns the Integer + */ + @JsonGetter("number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getNumber() { + return number; + } + + /** + * Setter for Number. + * A unique, identifier that appears on the debit note and in places it is referenced. + * @param number Value for Integer + */ + @JsonSetter("number") + public void setNumber(Integer number) { + this.number = number; + } + + /** + * Getter for SequenceNumber. + * A monotonically increasing number assigned to debit notes as they are created. + * @return Returns the Integer + */ + @JsonGetter("sequence_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Setter for SequenceNumber. + * A monotonically increasing number assigned to debit notes as they are created. + * @param sequenceNumber Value for Integer + */ + @JsonSetter("sequence_number") + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Getter for OriginCreditNoteUid. + * 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. + * @return Returns the String + */ + @JsonGetter("origin_credit_note_uid") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getOriginCreditNoteUid() { + return originCreditNoteUid; + } + + /** + * Setter for OriginCreditNoteUid. + * 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. + * @param originCreditNoteUid Value for String + */ + @JsonSetter("origin_credit_note_uid") + public void setOriginCreditNoteUid(String originCreditNoteUid) { + this.originCreditNoteUid = originCreditNoteUid; + } + + /** + * Getter for OriginCreditNoteNumber. + * A unique, identifying string of the connected credit note. + * @return Returns the String + */ + @JsonGetter("origin_credit_note_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getOriginCreditNoteNumber() { + return originCreditNoteNumber; + } + + /** + * Setter for OriginCreditNoteNumber. + * A unique, identifying string of the connected credit note. + * @param originCreditNoteNumber Value for String + */ + @JsonSetter("origin_credit_note_number") + public void setOriginCreditNoteNumber(String originCreditNoteNumber) { + this.originCreditNoteNumber = originCreditNoteNumber; + } + + /** + * Getter for IssueDate. + * 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". + * @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. + * 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". + * @param issueDate Value for LocalDate + */ + @JsonSetter("issue_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setIssueDate(LocalDate issueDate) { + this.issueDate = issueDate; + } + + /** + * Getter for AppliedDate. + * 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". + * @return Returns the LocalDate + */ + @JsonGetter("applied_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.SimpleDateSerializer.class) + public LocalDate getAppliedDate() { + return appliedDate; + } + + /** + * Setter for AppliedDate. + * 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". + * @param appliedDate Value for LocalDate + */ + @JsonSetter("applied_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setAppliedDate(LocalDate appliedDate) { + this.appliedDate = appliedDate; + } + + /** + * Getter for DueDate. + * Date the document is due for payment. The format is "YYYY-MM-DD". + * @return Returns the LocalDate + */ + @JsonGetter("due_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.SimpleDateSerializer.class) + public LocalDate getDueDate() { + return dueDate; + } + + /** + * Setter for DueDate. + * Date the document is due for payment. The format is "YYYY-MM-DD". + * @param dueDate Value for LocalDate + */ + @JsonSetter("due_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setDueDate(LocalDate dueDate) { + this.dueDate = dueDate; + } + + /** + * Getter for Status. + * Current status of the debit note. + * @return Returns the DebitNoteStatus + */ + @JsonGetter("status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public DebitNoteStatus getStatus() { + return status; + } + + /** + * Setter for Status. + * Current status of the debit note. + * @param status Value for DebitNoteStatus + */ + @JsonSetter("status") + public void setStatus(DebitNoteStatus status) { + this.status = status; + } + + /** + * Getter for Memo. + * The memo printed on debit note, which is a description of the reason for the debit. + * @return Returns the String + */ + @JsonGetter("memo") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getMemo() { + return memo; + } + + /** + * Setter for Memo. + * The memo printed on debit note, which is a description of the reason for the debit. + * @param memo Value for String + */ + @JsonSetter("memo") + public void setMemo(String memo) { + this.memo = memo; + } + + /** + * Getter for Role. + * The role of the debit note. + * @return Returns the DebitNoteRole + */ + @JsonGetter("role") + @JsonInclude(JsonInclude.Include.NON_NULL) + public DebitNoteRole getRole() { + return role; + } + + /** + * Setter for Role. + * The role of the debit note. + * @param role Value for DebitNoteRole + */ + @JsonSetter("role") + public void setRole(DebitNoteRole role) { + this.role = role; + } + + /** + * Getter for Currency. + * The ISO 4217 currency code (3 character string) representing the currency of the credit note + * amount fields. + * @return Returns the String + */ + @JsonGetter("currency") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCurrency() { + return currency; + } + + /** + * Setter for Currency. + * The ISO 4217 currency code (3 character string) representing the currency of the credit note + * amount fields. + * @param currency Value for String + */ + @JsonSetter("currency") + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Getter for Seller. + * Information about the seller (merchant) listed on the masthead of the debit note. + * @return Returns the InvoiceSeller + */ + @JsonGetter("seller") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceSeller getSeller() { + return seller; + } + + /** + * Setter for Seller. + * Information about the seller (merchant) listed on the masthead of the debit note. + * @param seller Value for InvoiceSeller + */ + @JsonSetter("seller") + public void setSeller(InvoiceSeller seller) { + this.seller = seller; + } + + /** + * Getter for Customer. + * Information about the customer who is owner or recipient the debited subscription. + * @return Returns the InvoiceCustomer + */ + @JsonGetter("customer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceCustomer getCustomer() { + return customer; + } + + /** + * Setter for Customer. + * Information about the customer who is owner or recipient the debited subscription. + * @param customer Value for InvoiceCustomer + */ + @JsonSetter("customer") + public void setCustomer(InvoiceCustomer customer) { + this.customer = customer; + } + + /** + * Getter for BillingAddress. + * The billing address of the debited subscription. + * @return Returns the InvoiceAddress + */ + @JsonGetter("billing_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceAddress getBillingAddress() { + return billingAddress; + } + + /** + * Setter for BillingAddress. + * The billing address of the debited subscription. + * @param billingAddress Value for InvoiceAddress + */ + @JsonSetter("billing_address") + public void setBillingAddress(InvoiceAddress billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * Getter for ShippingAddress. + * The shipping address of the debited subscription. + * @return Returns the InvoiceAddress + */ + @JsonGetter("shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceAddress getShippingAddress() { + return shippingAddress; + } + + /** + * Setter for ShippingAddress. + * The shipping address of the debited subscription. + * @param shippingAddress Value for InvoiceAddress + */ + @JsonSetter("shipping_address") + public void setShippingAddress(InvoiceAddress shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * Getter for LineItems. + * Line items on the debit note. + * @return Returns the List of CreditNoteLineItem + */ + @JsonGetter("line_items") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLineItems() { + return lineItems; + } + + /** + * Setter for LineItems. + * Line items on the debit note. + * @param lineItems Value for List of CreditNoteLineItem + */ + @JsonSetter("line_items") + public void setLineItems(List lineItems) { + this.lineItems = lineItems; + } + + /** + * Getter for Discounts. + * @return Returns the List of InvoiceDiscount + */ + @JsonGetter("discounts") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getDiscounts() { + return discounts; + } + + /** + * Setter for Discounts. + * @param discounts Value for List of InvoiceDiscount + */ + @JsonSetter("discounts") + public void setDiscounts(List discounts) { + this.discounts = discounts; + } + + /** + * Getter for Taxes. + * @return Returns the List of InvoiceTax + */ + @JsonGetter("taxes") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getTaxes() { + return taxes; + } + + /** + * Setter for Taxes. + * @param taxes Value for List of InvoiceTax + */ + @JsonSetter("taxes") + public void setTaxes(List taxes) { + this.taxes = taxes; + } + + /** + * Getter for Refunds. + * @return Returns the List of InvoiceRefund + */ + @JsonGetter("refunds") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getRefunds() { + return refunds; + } + + /** + * Setter for Refunds. + * @param refunds Value for List of InvoiceRefund + */ + @JsonSetter("refunds") + public void setRefunds(List refunds) { + this.refunds = refunds; + } + + /** + * Converts this DebitNote into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "DebitNote [" + "uid=" + uid + ", siteId=" + siteId + ", customerId=" + customerId + + ", subscriptionId=" + subscriptionId + ", number=" + number + ", sequenceNumber=" + + sequenceNumber + ", originCreditNoteUid=" + originCreditNoteUid + + ", originCreditNoteNumber=" + originCreditNoteNumber + ", issueDate=" + issueDate + + ", appliedDate=" + appliedDate + ", dueDate=" + dueDate + ", status=" + status + + ", memo=" + memo + ", role=" + role + ", currency=" + currency + ", seller=" + + seller + ", customer=" + customer + ", billingAddress=" + billingAddress + + ", shippingAddress=" + shippingAddress + ", lineItems=" + lineItems + + ", discounts=" + discounts + ", taxes=" + taxes + ", refunds=" + refunds + + ", additionalProperties=" + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link DebitNote.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link DebitNote.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .uid(getUid()) + .siteId(getSiteId()) + .customerId(getCustomerId()) + .subscriptionId(getSubscriptionId()) + .number(getNumber()) + .sequenceNumber(getSequenceNumber()) + .originCreditNoteUid(getOriginCreditNoteUid()) + .originCreditNoteNumber(getOriginCreditNoteNumber()) + .issueDate(getIssueDate()) + .appliedDate(getAppliedDate()) + .dueDate(getDueDate()) + .status(getStatus()) + .memo(getMemo()) + .role(getRole()) + .currency(getCurrency()) + .seller(getSeller()) + .customer(getCustomer()) + .billingAddress(getBillingAddress()) + .shippingAddress(getShippingAddress()) + .lineItems(getLineItems()) + .discounts(getDiscounts()) + .taxes(getTaxes()) + .refunds(getRefunds()); + return builder; + } + + /** + * Class to build instances of {@link DebitNote}. + */ + public static class Builder { + private String uid; + private Integer siteId; + private Integer customerId; + private Integer subscriptionId; + private Integer number; + private Integer sequenceNumber; + private String originCreditNoteUid; + private String originCreditNoteNumber; + private LocalDate issueDate; + private LocalDate appliedDate; + private LocalDate dueDate; + private DebitNoteStatus status; + private String memo; + private DebitNoteRole role; + private String currency; + private InvoiceSeller seller; + private InvoiceCustomer customer; + private InvoiceAddress billingAddress; + private InvoiceAddress shippingAddress; + private List lineItems; + private List discounts; + private List taxes; + private List refunds; + + + + /** + * Setter for uid. + * @param uid String value for uid. + * @return Builder + */ + public Builder uid(String uid) { + this.uid = uid; + return this; + } + + /** + * Setter for siteId. + * @param siteId Integer value for siteId. + * @return Builder + */ + public Builder siteId(Integer siteId) { + this.siteId = siteId; + 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 subscriptionId. + * @param subscriptionId Integer value for subscriptionId. + * @return Builder + */ + public Builder subscriptionId(Integer subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Setter for number. + * @param number Integer value for number. + * @return Builder + */ + public Builder number(Integer number) { + this.number = number; + return this; + } + + /** + * Setter for sequenceNumber. + * @param sequenceNumber Integer value for sequenceNumber. + * @return Builder + */ + public Builder sequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * Setter for originCreditNoteUid. + * @param originCreditNoteUid String value for originCreditNoteUid. + * @return Builder + */ + public Builder originCreditNoteUid(String originCreditNoteUid) { + this.originCreditNoteUid = originCreditNoteUid; + return this; + } + + /** + * Setter for originCreditNoteNumber. + * @param originCreditNoteNumber String value for originCreditNoteNumber. + * @return Builder + */ + public Builder originCreditNoteNumber(String originCreditNoteNumber) { + this.originCreditNoteNumber = originCreditNoteNumber; + 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 appliedDate. + * @param appliedDate LocalDate value for appliedDate. + * @return Builder + */ + public Builder appliedDate(LocalDate appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + /** + * Setter for dueDate. + * @param dueDate LocalDate value for dueDate. + * @return Builder + */ + public Builder dueDate(LocalDate dueDate) { + this.dueDate = dueDate; + return this; + } + + /** + * Setter for status. + * @param status DebitNoteStatus value for status. + * @return Builder + */ + public Builder status(DebitNoteStatus status) { + this.status = status; + 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 role. + * @param role DebitNoteRole value for role. + * @return Builder + */ + public Builder role(DebitNoteRole role) { + this.role = role; + return this; + } + + /** + * Setter for currency. + * @param currency String value for currency. + * @return Builder + */ + public Builder currency(String currency) { + this.currency = currency; + return this; + } + + /** + * Setter for seller. + * @param seller InvoiceSeller value for seller. + * @return Builder + */ + public Builder seller(InvoiceSeller seller) { + this.seller = seller; + return this; + } + + /** + * Setter for customer. + * @param customer InvoiceCustomer value for customer. + * @return Builder + */ + public Builder customer(InvoiceCustomer customer) { + this.customer = customer; + return this; + } + + /** + * Setter for billingAddress. + * @param billingAddress InvoiceAddress value for billingAddress. + * @return Builder + */ + public Builder billingAddress(InvoiceAddress billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + /** + * Setter for shippingAddress. + * @param shippingAddress InvoiceAddress value for shippingAddress. + * @return Builder + */ + public Builder shippingAddress(InvoiceAddress shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + * Setter for lineItems. + * @param lineItems List of CreditNoteLineItem value for lineItems. + * @return Builder + */ + public Builder lineItems(List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * Setter for discounts. + * @param discounts List of InvoiceDiscount value for discounts. + * @return Builder + */ + public Builder discounts(List discounts) { + this.discounts = discounts; + return this; + } + + /** + * Setter for taxes. + * @param taxes List of InvoiceTax value for taxes. + * @return Builder + */ + public Builder taxes(List taxes) { + this.taxes = taxes; + return this; + } + + /** + * Setter for refunds. + * @param refunds List of InvoiceRefund value for refunds. + * @return Builder + */ + public Builder refunds(List refunds) { + this.refunds = refunds; + return this; + } + + /** + * Builds a new {@link DebitNote} object using the set fields. + * @return {@link DebitNote} + */ + public DebitNote build() { + return new DebitNote(uid, siteId, customerId, subscriptionId, number, sequenceNumber, + originCreditNoteUid, originCreditNoteNumber, issueDate, appliedDate, dueDate, + status, memo, role, currency, seller, customer, billingAddress, shippingAddress, + lineItems, discounts, taxes, refunds); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/DebitNoteRole.java b/src/main/java/com/maxio/advancedbilling/models/DebitNoteRole.java new file mode 100644 index 00000000..0a788baa --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/DebitNoteRole.java @@ -0,0 +1,92 @@ +/* + * 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; + + +/** + * DebitNoteRole to be used. + */ +public enum DebitNoteRole { + CHARGEBACK, + + REFUND; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + CHARGEBACK.value = "chargeback"; + REFUND.value = "refund"; + + valueMap.put("chargeback", CHARGEBACK); + valueMap.put("refund", REFUND); + } + + /** + * 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 DebitNoteRole constructFromString(String toConvert) throws IOException { + DebitNoteRole 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 DebitNoteRole 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 DebitNoteRole values to list of string values. + * @param toConvert The list of DebitNoteRole 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 (DebitNoteRole enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/DebitNoteStatus.java b/src/main/java/com/maxio/advancedbilling/models/DebitNoteStatus.java new file mode 100644 index 00000000..f0a2d7e3 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/DebitNoteStatus.java @@ -0,0 +1,100 @@ +/* + * 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; + + +/** + * DebitNoteStatus to be used. + */ +public enum DebitNoteStatus { + OPEN, + + APPLIED, + + BANISHED, + + PAID; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + OPEN.value = "open"; + APPLIED.value = "applied"; + BANISHED.value = "banished"; + PAID.value = "paid"; + + valueMap.put("open", OPEN); + valueMap.put("applied", APPLIED); + valueMap.put("banished", BANISHED); + valueMap.put("paid", PAID); + } + + /** + * 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 DebitNoteStatus constructFromString(String toConvert) throws IOException { + DebitNoteStatus 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 DebitNoteStatus 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 DebitNoteStatus values to list of string values. + * @param toConvert The list of DebitNoteStatus 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 (DebitNoteStatus enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/FailedPaymentEventData.java b/src/main/java/com/maxio/advancedbilling/models/FailedPaymentEventData.java new file mode 100644 index 00000000..8126c8d8 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/FailedPaymentEventData.java @@ -0,0 +1,332 @@ +/* + * 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 FailedPaymentEventData type. + */ +public class FailedPaymentEventData + extends BaseModel { + private int amountInCents; + private int appliedAmount; + private OptionalNullable memo; + private InvoicePaymentMethodType paymentMethod; + private int transactionId; + + /** + * Default constructor. + */ + public FailedPaymentEventData() { + } + + /** + * Initialization constructor. + * @param amountInCents int value for amountInCents. + * @param appliedAmount int value for appliedAmount. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. + * @param transactionId int value for transactionId. + * @param memo String value for memo. + */ + public FailedPaymentEventData( + int amountInCents, + int appliedAmount, + InvoicePaymentMethodType paymentMethod, + int transactionId, + String memo) { + this.amountInCents = amountInCents; + this.appliedAmount = appliedAmount; + this.memo = OptionalNullable.of(memo); + this.paymentMethod = paymentMethod; + this.transactionId = transactionId; + } + + /** + * Initialization constructor. + * @param amountInCents int value for amountInCents. + * @param appliedAmount int value for appliedAmount. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. + * @param transactionId int value for transactionId. + * @param memo String value for memo. + */ + + protected FailedPaymentEventData(int amountInCents, int appliedAmount, + InvoicePaymentMethodType paymentMethod, int transactionId, + OptionalNullable memo) { + this.amountInCents = amountInCents; + this.appliedAmount = appliedAmount; + this.memo = memo; + this.paymentMethod = paymentMethod; + this.transactionId = transactionId; + } + + /** + * Initialization constructor. + * @param amountInCents int value for amountInCents. + * @param appliedAmount int value for appliedAmount. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. + * @param transactionId int value for transactionId. + */ + @JsonCreator + protected FailedPaymentEventData( + @JsonProperty("amount_in_cents") int amountInCents, + @JsonProperty("applied_amount") int appliedAmount, + @JsonProperty("payment_method") InvoicePaymentMethodType paymentMethod, + @JsonProperty("transaction_id") int transactionId) { + this(amountInCents, appliedAmount, paymentMethod, transactionId, + OptionalNullable.of(null)); + unsetMemo(); + } + + /** + * Getter for AmountInCents. + * The monetary value of the payment, expressed in cents. + * @return Returns the int + */ + @JsonGetter("amount_in_cents") + public int getAmountInCents() { + return amountInCents; + } + + /** + * Setter for AmountInCents. + * The monetary value of the payment, expressed in cents. + * @param amountInCents Value for int + */ + @JsonSetter("amount_in_cents") + public void setAmountInCents(int amountInCents) { + this.amountInCents = amountInCents; + } + + /** + * Getter for AppliedAmount. + * The monetary value of the payment, expressed in dollars. + * @return Returns the int + */ + @JsonGetter("applied_amount") + public int getAppliedAmount() { + return appliedAmount; + } + + /** + * Setter for AppliedAmount. + * The monetary value of the payment, expressed in dollars. + * @param appliedAmount Value for int + */ + @JsonSetter("applied_amount") + public void setAppliedAmount(int appliedAmount) { + this.appliedAmount = appliedAmount; + } + + /** + * Internal Getter for Memo. + * The memo passed when the payment was created. + * @return Returns the Internal String + */ + @JsonGetter("memo") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetMemo() { + return this.memo; + } + + /** + * Getter for Memo. + * The memo passed when the payment was created. + * @return Returns the String + */ + public String getMemo() { + return OptionalNullable.getFrom(memo); + } + + /** + * Setter for Memo. + * The memo passed when the payment was created. + * @param memo Value for String + */ + @JsonSetter("memo") + public void setMemo(String memo) { + this.memo = OptionalNullable.of(memo); + } + + /** + * UnSetter for Memo. + * The memo passed when the payment was created. + */ + public void unsetMemo() { + memo = null; + } + + /** + * Getter for PaymentMethod. + * @return Returns the InvoicePaymentMethodType + */ + @JsonGetter("payment_method") + public InvoicePaymentMethodType getPaymentMethod() { + return paymentMethod; + } + + /** + * Setter for PaymentMethod. + * @param paymentMethod Value for InvoicePaymentMethodType + */ + @JsonSetter("payment_method") + public void setPaymentMethod(InvoicePaymentMethodType paymentMethod) { + this.paymentMethod = paymentMethod; + } + + /** + * Getter for TransactionId. + * The transaction ID of the failed payment. + * @return Returns the int + */ + @JsonGetter("transaction_id") + public int getTransactionId() { + return transactionId; + } + + /** + * Setter for TransactionId. + * The transaction ID of the failed payment. + * @param transactionId Value for int + */ + @JsonSetter("transaction_id") + public void setTransactionId(int transactionId) { + this.transactionId = transactionId; + } + + /** + * Converts this FailedPaymentEventData into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "FailedPaymentEventData [" + "amountInCents=" + amountInCents + ", appliedAmount=" + + appliedAmount + ", paymentMethod=" + paymentMethod + ", transactionId=" + + transactionId + ", memo=" + memo + ", additionalProperties=" + + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link FailedPaymentEventData.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link FailedPaymentEventData.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder(amountInCents, appliedAmount, paymentMethod, transactionId); + builder.memo = internalGetMemo(); + return builder; + } + + /** + * Class to build instances of {@link FailedPaymentEventData}. + */ + public static class Builder { + private int amountInCents; + private int appliedAmount; + private InvoicePaymentMethodType paymentMethod; + private int transactionId; + private OptionalNullable memo; + + /** + * Initialization constructor. + */ + public Builder() { + } + + /** + * Initialization constructor. + * @param amountInCents int value for amountInCents. + * @param appliedAmount int value for appliedAmount. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. + * @param transactionId int value for transactionId. + */ + public Builder(int amountInCents, int appliedAmount, InvoicePaymentMethodType paymentMethod, + int transactionId) { + this.amountInCents = amountInCents; + this.appliedAmount = appliedAmount; + this.paymentMethod = paymentMethod; + this.transactionId = transactionId; + } + + /** + * Setter for amountInCents. + * @param amountInCents int value for amountInCents. + * @return Builder + */ + public Builder amountInCents(int amountInCents) { + this.amountInCents = amountInCents; + return this; + } + + /** + * Setter for appliedAmount. + * @param appliedAmount int value for appliedAmount. + * @return Builder + */ + public Builder appliedAmount(int appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + /** + * Setter for paymentMethod. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. + * @return Builder + */ + public Builder paymentMethod(InvoicePaymentMethodType paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Setter for transactionId. + * @param transactionId int value for transactionId. + * @return Builder + */ + public Builder transactionId(int transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Setter for memo. + * @param memo String value for memo. + * @return Builder + */ + public Builder memo(String memo) { + this.memo = OptionalNullable.of(memo); + return this; + } + + /** + * UnSetter for memo. + * @return Builder + */ + public Builder unsetMemo() { + memo = null; + return this; + } + + /** + * Builds a new {@link FailedPaymentEventData} object using the set fields. + * @return {@link FailedPaymentEventData} + */ + public FailedPaymentEventData build() { + return new FailedPaymentEventData(amountInCents, appliedAmount, paymentMethod, + transactionId, memo); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/Invoice.java b/src/main/java/com/maxio/advancedbilling/models/Invoice.java index fc9b2076..e701a8dd 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Invoice.java +++ b/src/main/java/com/maxio/advancedbilling/models/Invoice.java @@ -686,7 +686,7 @@ public void unsetPaidDate() { /** * Getter for Status. * The current status of the invoice. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) * for more. * @return Returns the InvoiceStatus */ @@ -699,7 +699,7 @@ public InvoiceStatus getStatus() { /** * Setter for Status. * The current status of the invoice. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) * for more. * @param status Value for InvoiceStatus */ diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceEvent.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceEvent.java index 6b1c9ea1..b658a3d4 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceEvent.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceEvent.java @@ -21,7 +21,7 @@ */ public class InvoiceEvent extends BaseModel { - private Integer id; + private Long id; private InvoiceEventType eventType; private InvoiceEventEventData eventData; private ZonedDateTime timestamp; @@ -35,14 +35,14 @@ public InvoiceEvent() { /** * Initialization constructor. - * @param id Integer value for id. + * @param id Long value for id. * @param eventType InvoiceEventType value for eventType. * @param eventData InvoiceEventEventData value for eventData. * @param timestamp ZonedDateTime value for timestamp. * @param invoice Invoice value for invoice. */ public InvoiceEvent( - Integer id, + Long id, InvoiceEventType eventType, InvoiceEventEventData eventData, ZonedDateTime timestamp, @@ -56,20 +56,20 @@ public InvoiceEvent( /** * Getter for Id. - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getId() { + public Long getId() { return id; } /** * Setter for Id. - * @param id Value for Integer + * @param id Value for Long */ @JsonSetter("id") - public void setId(Integer id) { + public void setId(Long id) { this.id = id; } @@ -187,7 +187,7 @@ public Builder toBuilder() { * Class to build instances of {@link InvoiceEvent}. */ public static class Builder { - private Integer id; + private Long id; private InvoiceEventType eventType; private InvoiceEventEventData eventData; private ZonedDateTime timestamp; @@ -197,10 +197,10 @@ public static class Builder { /** * Setter for id. - * @param id Integer value for id. + * @param id Long value for id. * @return Builder */ - public Builder id(Integer id) { + public Builder id(Long id) { this.id = id; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventData.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventData.java index 07ecd6f3..4a35a640 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventData.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventData.java @@ -15,6 +15,7 @@ import com.maxio.advancedbilling.models.containers.InvoiceEventDataPaymentMethod; import io.apimatic.core.types.BaseModel; import io.apimatic.core.types.OptionalNullable; +import java.time.LocalDate; import java.time.ZonedDateTime; import java.util.List; @@ -29,12 +30,13 @@ public class InvoiceEventData private String originalAmount; private String appliedAmount; private ZonedDateTime transactionTime; - private String memo; - private String role; + private OptionalNullable memo; + private InvoiceRole1 role; private Boolean consolidatedInvoice; private List appliedCreditNotes; private String debitNoteNumber; private String debitNoteUid; + private InvoiceConsolidationLevel consolidationLevel; private InvoiceEventDataPaymentMethod paymentMethod; private Integer transactionId; private OptionalNullable parentInvoiceNumber; @@ -43,9 +45,8 @@ public class InvoiceEventData private Boolean external; private String fromCollectionMethod; private String toCollectionMethod; - private InvoiceConsolidationLevel consolidationLevel; - private InvoiceStatus fromStatus; - private InvoiceStatus toStatus; + private Object fromStatus; + private Object toStatus; private String dueAmount; private String totalAmount; private Boolean applyCredit; @@ -55,11 +56,65 @@ public class InvoiceEventData private Integer refundId; private Boolean isAdvanceInvoice; private String reason; + private Long id; + private Integer siteId; + private Integer customerId; + private Integer subscriptionId; + private String number; + private Integer sequenceNumber; + private ZonedDateTime createdAt; + private ZonedDateTime updatedAt; + private LocalDate issueDate; + private LocalDate dueDate; + private OptionalNullable paidDate; + private InvoiceStatus status; + private OptionalNullable parentInvoiceId; + private CollectionMethod collectionMethod; + private String paymentInstructions; + private String currency; + private OptionalNullable parentInvoiceUid; + private OptionalNullable subscriptionGroupId; + private OptionalNullable groupPrimarySubscriptionId; + private String productName; + private String productFamilyName; + private InvoiceSeller seller; + private InvoiceCustomer customer; + private InvoicePayer payer; + private List recipientEmails; + private Integer netTerms; + private BillingAddress billingAddress; + private ShippingAddress shippingAddress; + private String subtotalAmount; + private String discountAmount; + private String taxAmount; + private String creditAmount; + private String paidAmount; + private List lineItems; + private List discounts; + private List taxes; + private List credits; + private List refunds; + private List payments; + private List customFields; + private InvoiceDisplaySettings displaySettings; + private String publicUrl; + private InvoicePreviousBalance previousBalanceData; + private String gatewayTransId; + private String amount; + private Integer amountInCents; + private String originCreditNoteUid; + private String originCreditNoteNumber; + private LocalDate appliedDate; + private String remainingAmount; + private List applications; + private List originInvoices; + private ChargebackStatus chargebackStatus; /** * Default constructor. */ public InvoiceEventData() { + collectionMethod = CollectionMethod.AUTOMATIC; } /** @@ -71,11 +126,12 @@ public InvoiceEventData() { * @param appliedAmount String value for appliedAmount. * @param transactionTime ZonedDateTime value for transactionTime. * @param memo String value for memo. - * @param role String value for role. + * @param role InvoiceRole1 value for role. * @param consolidatedInvoice Boolean value for consolidatedInvoice. * @param appliedCreditNotes List of AppliedCreditNoteData value for appliedCreditNotes. * @param debitNoteNumber String value for debitNoteNumber. * @param debitNoteUid String value for debitNoteUid. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. * @param paymentMethod InvoiceEventDataPaymentMethod value for paymentMethod. * @param transactionId Integer value for transactionId. * @param parentInvoiceNumber Integer value for parentInvoiceNumber. @@ -84,9 +140,8 @@ public InvoiceEventData() { * @param external Boolean value for external. * @param fromCollectionMethod String value for fromCollectionMethod. * @param toCollectionMethod String value for toCollectionMethod. - * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. - * @param fromStatus InvoiceStatus value for fromStatus. - * @param toStatus InvoiceStatus value for toStatus. + * @param fromStatus Object value for fromStatus. + * @param toStatus Object value for toStatus. * @param dueAmount String value for dueAmount. * @param totalAmount String value for totalAmount. * @param applyCredit Boolean value for applyCredit. @@ -96,6 +151,59 @@ public InvoiceEventData() { * @param refundId Integer value for refundId. * @param isAdvanceInvoice Boolean value for isAdvanceInvoice. * @param reason String value for reason. + * @param id Long value for id. + * @param siteId Integer value for siteId. + * @param customerId Integer value for customerId. + * @param subscriptionId Integer value for subscriptionId. + * @param number String value for number. + * @param sequenceNumber Integer value for sequenceNumber. + * @param createdAt ZonedDateTime value for createdAt. + * @param updatedAt ZonedDateTime value for updatedAt. + * @param issueDate LocalDate value for issueDate. + * @param dueDate LocalDate value for dueDate. + * @param paidDate LocalDate value for paidDate. + * @param status InvoiceStatus value for status. + * @param parentInvoiceId Integer value for parentInvoiceId. + * @param collectionMethod CollectionMethod value for collectionMethod. + * @param paymentInstructions String value for paymentInstructions. + * @param currency String value for currency. + * @param parentInvoiceUid String value for parentInvoiceUid. + * @param subscriptionGroupId Integer value for subscriptionGroupId. + * @param groupPrimarySubscriptionId Integer value for groupPrimarySubscriptionId. + * @param productName String value for productName. + * @param productFamilyName String value for productFamilyName. + * @param seller InvoiceSeller value for seller. + * @param customer InvoiceCustomer value for customer. + * @param payer InvoicePayer value for payer. + * @param recipientEmails List of String value for recipientEmails. + * @param netTerms Integer value for netTerms. + * @param billingAddress BillingAddress value for billingAddress. + * @param shippingAddress ShippingAddress value for shippingAddress. + * @param subtotalAmount String value for subtotalAmount. + * @param discountAmount String value for discountAmount. + * @param taxAmount String value for taxAmount. + * @param creditAmount String value for creditAmount. + * @param paidAmount String value for paidAmount. + * @param lineItems List of InvoiceLineItem1 value for lineItems. + * @param discounts List of InvoiceDiscount value for discounts. + * @param taxes List of InvoiceTax value for taxes. + * @param credits List of InvoiceCredit value for credits. + * @param refunds List of InvoiceRefund value for refunds. + * @param payments List of InvoicePayment value for payments. + * @param customFields List of InvoiceCustomField value for customFields. + * @param displaySettings InvoiceDisplaySettings value for displaySettings. + * @param publicUrl String value for publicUrl. + * @param previousBalanceData InvoicePreviousBalance value for previousBalanceData. + * @param gatewayTransId String value for gatewayTransId. + * @param amount String value for amount. + * @param amountInCents Integer value for amountInCents. + * @param originCreditNoteUid String value for originCreditNoteUid. + * @param originCreditNoteNumber String value for originCreditNoteNumber. + * @param appliedDate LocalDate value for appliedDate. + * @param remainingAmount String value for remainingAmount. + * @param applications List of CreditNoteApplication value for applications. + * @param originInvoices List of OriginInvoice value for originInvoices. + * @param chargebackStatus ChargebackStatus value for chargebackStatus. */ public InvoiceEventData( String uid, @@ -105,11 +213,12 @@ public InvoiceEventData( String appliedAmount, ZonedDateTime transactionTime, String memo, - String role, + InvoiceRole1 role, Boolean consolidatedInvoice, List appliedCreditNotes, String debitNoteNumber, String debitNoteUid, + InvoiceConsolidationLevel consolidationLevel, InvoiceEventDataPaymentMethod paymentMethod, Integer transactionId, Integer parentInvoiceNumber, @@ -118,9 +227,8 @@ public InvoiceEventData( Boolean external, String fromCollectionMethod, String toCollectionMethod, - InvoiceConsolidationLevel consolidationLevel, - InvoiceStatus fromStatus, - InvoiceStatus toStatus, + Object fromStatus, + Object toStatus, String dueAmount, String totalAmount, Boolean applyCredit, @@ -129,19 +237,73 @@ public InvoiceEventData( String refundAmount, Integer refundId, Boolean isAdvanceInvoice, - String reason) { + String reason, + Long id, + Integer siteId, + Integer customerId, + Integer subscriptionId, + String number, + Integer sequenceNumber, + ZonedDateTime createdAt, + ZonedDateTime updatedAt, + LocalDate issueDate, + LocalDate dueDate, + LocalDate paidDate, + InvoiceStatus status, + Integer parentInvoiceId, + CollectionMethod collectionMethod, + String paymentInstructions, + String currency, + String parentInvoiceUid, + Integer subscriptionGroupId, + Integer groupPrimarySubscriptionId, + String productName, + String productFamilyName, + InvoiceSeller seller, + InvoiceCustomer customer, + InvoicePayer payer, + List recipientEmails, + Integer netTerms, + BillingAddress billingAddress, + ShippingAddress shippingAddress, + String subtotalAmount, + String discountAmount, + String taxAmount, + String creditAmount, + String paidAmount, + List lineItems, + List discounts, + List taxes, + List credits, + List refunds, + List payments, + List customFields, + InvoiceDisplaySettings displaySettings, + String publicUrl, + InvoicePreviousBalance previousBalanceData, + String gatewayTransId, + String amount, + Integer amountInCents, + String originCreditNoteUid, + String originCreditNoteNumber, + LocalDate appliedDate, + String remainingAmount, + List applications, + List originInvoices, + ChargebackStatus chargebackStatus) { this.uid = uid; this.creditNoteNumber = creditNoteNumber; this.creditNoteUid = creditNoteUid; this.originalAmount = originalAmount; this.appliedAmount = appliedAmount; this.transactionTime = transactionTime; - this.memo = memo; + this.memo = OptionalNullable.of(memo); this.role = role; this.consolidatedInvoice = consolidatedInvoice; this.appliedCreditNotes = appliedCreditNotes; this.debitNoteNumber = debitNoteNumber; this.debitNoteUid = debitNoteUid; + this.consolidationLevel = consolidationLevel; this.paymentMethod = paymentMethod; this.transactionId = transactionId; this.parentInvoiceNumber = OptionalNullable.of(parentInvoiceNumber); @@ -150,7 +312,6 @@ public InvoiceEventData( this.external = external; this.fromCollectionMethod = fromCollectionMethod; this.toCollectionMethod = toCollectionMethod; - this.consolidationLevel = consolidationLevel; this.fromStatus = fromStatus; this.toStatus = toStatus; this.dueAmount = dueAmount; @@ -162,6 +323,59 @@ public InvoiceEventData( this.refundId = refundId; this.isAdvanceInvoice = isAdvanceInvoice; this.reason = reason; + this.id = id; + this.siteId = siteId; + this.customerId = customerId; + this.subscriptionId = subscriptionId; + this.number = number; + this.sequenceNumber = sequenceNumber; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.issueDate = issueDate; + this.dueDate = dueDate; + this.paidDate = OptionalNullable.of(paidDate); + this.status = status; + this.parentInvoiceId = OptionalNullable.of(parentInvoiceId); + this.collectionMethod = collectionMethod; + this.paymentInstructions = paymentInstructions; + this.currency = currency; + this.parentInvoiceUid = OptionalNullable.of(parentInvoiceUid); + this.subscriptionGroupId = OptionalNullable.of(subscriptionGroupId); + this.groupPrimarySubscriptionId = OptionalNullable.of(groupPrimarySubscriptionId); + this.productName = productName; + this.productFamilyName = productFamilyName; + this.seller = seller; + this.customer = customer; + this.payer = payer; + this.recipientEmails = recipientEmails; + this.netTerms = netTerms; + this.billingAddress = billingAddress; + this.shippingAddress = shippingAddress; + this.subtotalAmount = subtotalAmount; + this.discountAmount = discountAmount; + this.taxAmount = taxAmount; + this.creditAmount = creditAmount; + this.paidAmount = paidAmount; + this.lineItems = lineItems; + this.discounts = discounts; + this.taxes = taxes; + this.credits = credits; + this.refunds = refunds; + this.payments = payments; + this.customFields = customFields; + this.displaySettings = displaySettings; + this.publicUrl = publicUrl; + this.previousBalanceData = previousBalanceData; + this.gatewayTransId = gatewayTransId; + this.amount = amount; + this.amountInCents = amountInCents; + this.originCreditNoteUid = originCreditNoteUid; + this.originCreditNoteNumber = originCreditNoteNumber; + this.appliedDate = appliedDate; + this.remainingAmount = remainingAmount; + this.applications = applications; + this.originInvoices = originInvoices; + this.chargebackStatus = chargebackStatus; } /** @@ -173,11 +387,12 @@ public InvoiceEventData( * @param appliedAmount String value for appliedAmount. * @param transactionTime ZonedDateTime value for transactionTime. * @param memo String value for memo. - * @param role String value for role. + * @param role InvoiceRole1 value for role. * @param consolidatedInvoice Boolean value for consolidatedInvoice. * @param appliedCreditNotes List of AppliedCreditNoteData value for appliedCreditNotes. * @param debitNoteNumber String value for debitNoteNumber. * @param debitNoteUid String value for debitNoteUid. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. * @param paymentMethod InvoiceEventDataPaymentMethod value for paymentMethod. * @param transactionId Integer value for transactionId. * @param parentInvoiceNumber Integer value for parentInvoiceNumber. @@ -186,9 +401,8 @@ public InvoiceEventData( * @param external Boolean value for external. * @param fromCollectionMethod String value for fromCollectionMethod. * @param toCollectionMethod String value for toCollectionMethod. - * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. - * @param fromStatus InvoiceStatus value for fromStatus. - * @param toStatus InvoiceStatus value for toStatus. + * @param fromStatus Object value for fromStatus. + * @param toStatus Object value for toStatus. * @param dueAmount String value for dueAmount. * @param totalAmount String value for totalAmount. * @param applyCredit Boolean value for applyCredit. @@ -198,20 +412,93 @@ public InvoiceEventData( * @param refundId Integer value for refundId. * @param isAdvanceInvoice Boolean value for isAdvanceInvoice. * @param reason String value for reason. + * @param id Long value for id. + * @param siteId Integer value for siteId. + * @param customerId Integer value for customerId. + * @param subscriptionId Integer value for subscriptionId. + * @param number String value for number. + * @param sequenceNumber Integer value for sequenceNumber. + * @param createdAt ZonedDateTime value for createdAt. + * @param updatedAt ZonedDateTime value for updatedAt. + * @param issueDate LocalDate value for issueDate. + * @param dueDate LocalDate value for dueDate. + * @param paidDate LocalDate value for paidDate. + * @param status InvoiceStatus value for status. + * @param parentInvoiceId Integer value for parentInvoiceId. + * @param collectionMethod CollectionMethod value for collectionMethod. + * @param paymentInstructions String value for paymentInstructions. + * @param currency String value for currency. + * @param parentInvoiceUid String value for parentInvoiceUid. + * @param subscriptionGroupId Integer value for subscriptionGroupId. + * @param groupPrimarySubscriptionId Integer value for groupPrimarySubscriptionId. + * @param productName String value for productName. + * @param productFamilyName String value for productFamilyName. + * @param seller InvoiceSeller value for seller. + * @param customer InvoiceCustomer value for customer. + * @param payer InvoicePayer value for payer. + * @param recipientEmails List of String value for recipientEmails. + * @param netTerms Integer value for netTerms. + * @param billingAddress BillingAddress value for billingAddress. + * @param shippingAddress ShippingAddress value for shippingAddress. + * @param subtotalAmount String value for subtotalAmount. + * @param discountAmount String value for discountAmount. + * @param taxAmount String value for taxAmount. + * @param creditAmount String value for creditAmount. + * @param paidAmount String value for paidAmount. + * @param lineItems List of InvoiceLineItem1 value for lineItems. + * @param discounts List of InvoiceDiscount value for discounts. + * @param taxes List of InvoiceTax value for taxes. + * @param credits List of InvoiceCredit value for credits. + * @param refunds List of InvoiceRefund value for refunds. + * @param payments List of InvoicePayment value for payments. + * @param customFields List of InvoiceCustomField value for customFields. + * @param displaySettings InvoiceDisplaySettings value for displaySettings. + * @param publicUrl String value for publicUrl. + * @param previousBalanceData InvoicePreviousBalance value for previousBalanceData. + * @param gatewayTransId String value for gatewayTransId. + * @param amount String value for amount. + * @param amountInCents Integer value for amountInCents. + * @param originCreditNoteUid String value for originCreditNoteUid. + * @param originCreditNoteNumber String value for originCreditNoteNumber. + * @param appliedDate LocalDate value for appliedDate. + * @param remainingAmount String value for remainingAmount. + * @param applications List of CreditNoteApplication value for applications. + * @param originInvoices List of OriginInvoice value for originInvoices. + * @param chargebackStatus ChargebackStatus value for chargebackStatus. */ protected InvoiceEventData(String uid, String creditNoteNumber, String creditNoteUid, - String originalAmount, String appliedAmount, ZonedDateTime transactionTime, String memo, - String role, Boolean consolidatedInvoice, + String originalAmount, String appliedAmount, ZonedDateTime transactionTime, + OptionalNullable memo, InvoiceRole1 role, Boolean consolidatedInvoice, List appliedCreditNotes, String debitNoteNumber, - String debitNoteUid, InvoiceEventDataPaymentMethod paymentMethod, Integer transactionId, + String debitNoteUid, InvoiceConsolidationLevel consolidationLevel, + InvoiceEventDataPaymentMethod paymentMethod, Integer transactionId, OptionalNullable parentInvoiceNumber, OptionalNullable remainingPrepaymentAmount, Boolean prepayment, Boolean external, String fromCollectionMethod, String toCollectionMethod, - InvoiceConsolidationLevel consolidationLevel, InvoiceStatus fromStatus, - InvoiceStatus toStatus, String dueAmount, String totalAmount, Boolean applyCredit, - CreditNote1 creditNoteAttributes, Integer paymentId, String refundAmount, - Integer refundId, Boolean isAdvanceInvoice, String reason) { + Object fromStatus, Object toStatus, String dueAmount, String totalAmount, + Boolean applyCredit, CreditNote1 creditNoteAttributes, Integer paymentId, + String refundAmount, Integer refundId, Boolean isAdvanceInvoice, String reason, Long id, + Integer siteId, Integer customerId, Integer subscriptionId, String number, + Integer sequenceNumber, ZonedDateTime createdAt, ZonedDateTime updatedAt, + LocalDate issueDate, LocalDate dueDate, OptionalNullable paidDate, + InvoiceStatus status, OptionalNullable parentInvoiceId, + CollectionMethod collectionMethod, String paymentInstructions, String currency, + OptionalNullable parentInvoiceUid, + OptionalNullable subscriptionGroupId, + OptionalNullable groupPrimarySubscriptionId, String productName, + String productFamilyName, InvoiceSeller seller, InvoiceCustomer customer, + InvoicePayer payer, List recipientEmails, Integer netTerms, + BillingAddress billingAddress, ShippingAddress shippingAddress, String subtotalAmount, + String discountAmount, String taxAmount, String creditAmount, String paidAmount, + List lineItems, List discounts, + List taxes, List credits, List refunds, + List payments, List customFields, + InvoiceDisplaySettings displaySettings, String publicUrl, + InvoicePreviousBalance previousBalanceData, String gatewayTransId, String amount, + Integer amountInCents, String originCreditNoteUid, String originCreditNoteNumber, + LocalDate appliedDate, String remainingAmount, List applications, + List originInvoices, ChargebackStatus chargebackStatus) { this.uid = uid; this.creditNoteNumber = creditNoteNumber; this.creditNoteUid = creditNoteUid; @@ -224,6 +511,7 @@ protected InvoiceEventData(String uid, String creditNoteNumber, String creditNot this.appliedCreditNotes = appliedCreditNotes; this.debitNoteNumber = debitNoteNumber; this.debitNoteUid = debitNoteUid; + this.consolidationLevel = consolidationLevel; this.paymentMethod = paymentMethod; this.transactionId = transactionId; this.parentInvoiceNumber = parentInvoiceNumber; @@ -232,7 +520,6 @@ protected InvoiceEventData(String uid, String creditNoteNumber, String creditNot this.external = external; this.fromCollectionMethod = fromCollectionMethod; this.toCollectionMethod = toCollectionMethod; - this.consolidationLevel = consolidationLevel; this.fromStatus = fromStatus; this.toStatus = toStatus; this.dueAmount = dueAmount; @@ -244,6 +531,59 @@ protected InvoiceEventData(String uid, String creditNoteNumber, String creditNot this.refundId = refundId; this.isAdvanceInvoice = isAdvanceInvoice; this.reason = reason; + this.id = id; + this.siteId = siteId; + this.customerId = customerId; + this.subscriptionId = subscriptionId; + this.number = number; + this.sequenceNumber = sequenceNumber; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.issueDate = issueDate; + this.dueDate = dueDate; + this.paidDate = paidDate; + this.status = status; + this.parentInvoiceId = parentInvoiceId; + this.collectionMethod = collectionMethod; + this.paymentInstructions = paymentInstructions; + this.currency = currency; + this.parentInvoiceUid = parentInvoiceUid; + this.subscriptionGroupId = subscriptionGroupId; + this.groupPrimarySubscriptionId = groupPrimarySubscriptionId; + this.productName = productName; + this.productFamilyName = productFamilyName; + this.seller = seller; + this.customer = customer; + this.payer = payer; + this.recipientEmails = recipientEmails; + this.netTerms = netTerms; + this.billingAddress = billingAddress; + this.shippingAddress = shippingAddress; + this.subtotalAmount = subtotalAmount; + this.discountAmount = discountAmount; + this.taxAmount = taxAmount; + this.creditAmount = creditAmount; + this.paidAmount = paidAmount; + this.lineItems = lineItems; + this.discounts = discounts; + this.taxes = taxes; + this.credits = credits; + this.refunds = refunds; + this.payments = payments; + this.customFields = customFields; + this.displaySettings = displaySettings; + this.publicUrl = publicUrl; + this.previousBalanceData = previousBalanceData; + this.gatewayTransId = gatewayTransId; + this.amount = amount; + this.amountInCents = amountInCents; + this.originCreditNoteUid = originCreditNoteUid; + this.originCreditNoteNumber = originCreditNoteNumber; + this.appliedDate = appliedDate; + this.remainingAmount = remainingAmount; + this.applications = applications; + this.originInvoices = originInvoices; + this.chargebackStatus = chargebackStatus; } /** @@ -379,14 +719,24 @@ public void setTransactionTime(ZonedDateTime transactionTime) { } /** - * Getter for Memo. + * Internal Getter for Memo. * The credit note memo. - * @return Returns the String + * @return Returns the Internal String */ @JsonGetter("memo") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetMemo() { + return this.memo; + } + + /** + * Getter for Memo. + * The credit note memo. + * @return Returns the String + */ public String getMemo() { - return memo; + return OptionalNullable.getFrom(memo); } /** @@ -396,27 +746,35 @@ public String getMemo() { */ @JsonSetter("memo") public void setMemo(String memo) { - this.memo = memo; + this.memo = OptionalNullable.of(memo); + } + + /** + * UnSetter for Memo. + * The credit note memo. + */ + public void unsetMemo() { + memo = null; } /** * Getter for Role. * The role of the credit note (e.g. 'general') - * @return Returns the String + * @return Returns the InvoiceRole1 */ @JsonGetter("role") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getRole() { + public InvoiceRole1 getRole() { return role; } /** * Setter for Role. * The role of the credit note (e.g. 'general') - * @param role Value for String + * @param role Value for InvoiceRole1 */ @JsonSetter("role") - public void setRole(String role) { + public void setRole(InvoiceRole1 role) { this.role = role; } @@ -506,6 +864,39 @@ public void setDebitNoteUid(String debitNoteUid) { this.debitNoteUid = debitNoteUid; } + /** + * Getter for ConsolidationLevel. + * 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). + * @return Returns the InvoiceConsolidationLevel + */ + @JsonGetter("consolidation_level") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceConsolidationLevel getConsolidationLevel() { + return consolidationLevel; + } + + /** + * Setter for ConsolidationLevel. + * 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). + * @param consolidationLevel Value for InvoiceConsolidationLevel + */ + @JsonSetter("consolidation_level") + public void setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) { + this.consolidationLevel = consolidationLevel; + } + /** * Getter for PaymentMethod. * A nested data structure detailing the method of payment @@ -550,6 +941,8 @@ public void setTransactionId(Integer transactionId) { /** * Internal Getter for ParentInvoiceNumber. + * For invoices with `consolidation_level` of `child`, this specifies the number of the parent + * (consolidated) invoice. * @return Returns the Internal Integer */ @JsonGetter("parent_invoice_number") @@ -561,6 +954,8 @@ protected OptionalNullable internalGetParentInvoiceNumber() { /** * Getter for ParentInvoiceNumber. + * For invoices with `consolidation_level` of `child`, this specifies the number of the parent + * (consolidated) invoice. * @return Returns the Integer */ public Integer getParentInvoiceNumber() { @@ -569,6 +964,8 @@ public Integer getParentInvoiceNumber() { /** * Setter for ParentInvoiceNumber. + * For invoices with `consolidation_level` of `child`, this specifies the number of the parent + * (consolidated) invoice. * @param parentInvoiceNumber Value for Integer */ @JsonSetter("parent_invoice_number") @@ -578,6 +975,8 @@ public void setParentInvoiceNumber(Integer parentInvoiceNumber) { /** * UnSetter for ParentInvoiceNumber. + * For invoices with `consolidation_level` of `child`, this specifies the number of the parent + * (consolidated) invoice. */ public void unsetParentInvoiceNumber() { parentInvoiceNumber = null; @@ -700,86 +1099,41 @@ public void setToCollectionMethod(String toCollectionMethod) { this.toCollectionMethod = toCollectionMethod; } - /** - * Getter for ConsolidationLevel. - * 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). - * @return Returns the InvoiceConsolidationLevel - */ - @JsonGetter("consolidation_level") - @JsonInclude(JsonInclude.Include.NON_NULL) - public InvoiceConsolidationLevel getConsolidationLevel() { - return consolidationLevel; - } - - /** - * Setter for ConsolidationLevel. - * 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://chargify.zendesk.com/hc/en-us/articles/4407746391835). - * @param consolidationLevel Value for InvoiceConsolidationLevel - */ - @JsonSetter("consolidation_level") - public void setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) { - this.consolidationLevel = consolidationLevel; - } - /** * Getter for FromStatus. - * The status of the invoice before event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) - * for more. - * @return Returns the InvoiceStatus + * @return Returns the Object */ @JsonGetter("from_status") @JsonInclude(JsonInclude.Include.NON_NULL) - public InvoiceStatus getFromStatus() { + public Object getFromStatus() { return fromStatus; } /** * Setter for FromStatus. - * The status of the invoice before event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) - * for more. - * @param fromStatus Value for InvoiceStatus + * @param fromStatus Value for Object */ @JsonSetter("from_status") - public void setFromStatus(InvoiceStatus fromStatus) { + public void setFromStatus(Object fromStatus) { this.fromStatus = fromStatus; } /** * Getter for ToStatus. - * The status of the invoice after event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) - * for more. - * @return Returns the InvoiceStatus + * @return Returns the Object */ @JsonGetter("to_status") @JsonInclude(JsonInclude.Include.NON_NULL) - public InvoiceStatus getToStatus() { + public Object getToStatus() { return toStatus; } /** * Setter for ToStatus. - * The status of the invoice after event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) - * for more. - * @param toStatus Value for InvoiceStatus + * @param toStatus Value for Object */ @JsonSetter("to_status") - public void setToStatus(InvoiceStatus toStatus) { + public void setToStatus(Object toStatus) { this.toStatus = toStatus; } @@ -971,446 +1325,2383 @@ public void setReason(String reason) { } /** - * Converts this InvoiceEventData into string format. - * @return String representation of this class + * Getter for Id. + * @return Returns the Long */ - @Override - public String toString() { - return "InvoiceEventData [" + "uid=" + uid + ", creditNoteNumber=" + creditNoteNumber - + ", creditNoteUid=" + creditNoteUid + ", originalAmount=" + originalAmount - + ", appliedAmount=" + appliedAmount + ", transactionTime=" + transactionTime - + ", memo=" + memo + ", role=" + role + ", consolidatedInvoice=" - + consolidatedInvoice + ", appliedCreditNotes=" + appliedCreditNotes - + ", debitNoteNumber=" + debitNoteNumber + ", debitNoteUid=" + debitNoteUid - + ", paymentMethod=" + paymentMethod + ", transactionId=" + transactionId - + ", parentInvoiceNumber=" + parentInvoiceNumber + ", remainingPrepaymentAmount=" - + remainingPrepaymentAmount + ", prepayment=" + prepayment + ", external=" - + external + ", fromCollectionMethod=" + fromCollectionMethod - + ", toCollectionMethod=" + toCollectionMethod + ", consolidationLevel=" - + consolidationLevel + ", fromStatus=" + fromStatus + ", toStatus=" + toStatus - + ", dueAmount=" + dueAmount + ", totalAmount=" + totalAmount + ", applyCredit=" - + applyCredit + ", creditNoteAttributes=" + creditNoteAttributes + ", paymentId=" - + paymentId + ", refundAmount=" + refundAmount + ", refundId=" + refundId - + ", isAdvanceInvoice=" + isAdvanceInvoice + ", reason=" + reason - + ", additionalProperties=" + getAdditionalProperties() + "]"; + @JsonGetter("id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Long getId() { + return id; } /** - * Builds a new {@link InvoiceEventData.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link InvoiceEventData.Builder} object + * Setter for Id. + * @param id Value for Long */ - public Builder toBuilder() { - Builder builder = new Builder() - .uid(getUid()) - .creditNoteNumber(getCreditNoteNumber()) - .creditNoteUid(getCreditNoteUid()) - .originalAmount(getOriginalAmount()) - .appliedAmount(getAppliedAmount()) - .transactionTime(getTransactionTime()) - .memo(getMemo()) - .role(getRole()) - .consolidatedInvoice(getConsolidatedInvoice()) - .appliedCreditNotes(getAppliedCreditNotes()) - .debitNoteNumber(getDebitNoteNumber()) - .debitNoteUid(getDebitNoteUid()) - .paymentMethod(getPaymentMethod()) - .transactionId(getTransactionId()) - .prepayment(getPrepayment()) - .external(getExternal()) - .fromCollectionMethod(getFromCollectionMethod()) - .toCollectionMethod(getToCollectionMethod()) - .consolidationLevel(getConsolidationLevel()) - .fromStatus(getFromStatus()) - .toStatus(getToStatus()) - .dueAmount(getDueAmount()) - .totalAmount(getTotalAmount()) - .applyCredit(getApplyCredit()) - .creditNoteAttributes(getCreditNoteAttributes()) - .paymentId(getPaymentId()) - .refundAmount(getRefundAmount()) - .refundId(getRefundId()) - .isAdvanceInvoice(getIsAdvanceInvoice()) - .reason(getReason()); - builder.parentInvoiceNumber = internalGetParentInvoiceNumber(); - builder.remainingPrepaymentAmount = internalGetRemainingPrepaymentAmount(); - return builder; + @JsonSetter("id") + public void setId(Long id) { + this.id = id; } /** - * Class to build instances of {@link InvoiceEventData}. + * Getter for SiteId. + * ID of the site to which the invoice belongs. + * @return Returns the Integer */ - public static class Builder { - private String uid; - private String creditNoteNumber; - private String creditNoteUid; - private String originalAmount; - private String appliedAmount; - private ZonedDateTime transactionTime; - private String memo; - private String role; - private Boolean consolidatedInvoice; - private List appliedCreditNotes; - private String debitNoteNumber; - private String debitNoteUid; - private InvoiceEventDataPaymentMethod paymentMethod; - private Integer transactionId; - private OptionalNullable parentInvoiceNumber; - private OptionalNullable remainingPrepaymentAmount; - private Boolean prepayment; - private Boolean external; - private String fromCollectionMethod; - private String toCollectionMethod; - private InvoiceConsolidationLevel consolidationLevel; - private InvoiceStatus fromStatus; - private InvoiceStatus toStatus; - private String dueAmount; - private String totalAmount; - private Boolean applyCredit; - private CreditNote1 creditNoteAttributes; - private Integer paymentId; - private String refundAmount; - private Integer refundId; - private Boolean isAdvanceInvoice; - private String reason; - + @JsonGetter("site_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getSiteId() { + return siteId; + } + /** + * Setter for SiteId. + * ID of the site to which the invoice belongs. + * @param siteId Value for Integer + */ + @JsonSetter("site_id") + public void setSiteId(Integer siteId) { + this.siteId = siteId; + } - /** - * Setter for uid. - * @param uid String value for uid. - * @return Builder - */ - public Builder uid(String uid) { - this.uid = uid; - return this; - } + /** + * Getter for CustomerId. + * ID of the customer to which the invoice belongs. + * @return Returns the Integer + */ + @JsonGetter("customer_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getCustomerId() { + return customerId; + } - /** - * Setter for creditNoteNumber. - * @param creditNoteNumber String value for creditNoteNumber. - * @return Builder - */ - public Builder creditNoteNumber(String creditNoteNumber) { - this.creditNoteNumber = creditNoteNumber; - return this; - } + /** + * Setter for CustomerId. + * ID of the customer to which the invoice belongs. + * @param customerId Value for Integer + */ + @JsonSetter("customer_id") + public void setCustomerId(Integer customerId) { + this.customerId = customerId; + } - /** - * Setter for creditNoteUid. - * @param creditNoteUid String value for creditNoteUid. - * @return Builder - */ - public Builder creditNoteUid(String creditNoteUid) { - this.creditNoteUid = creditNoteUid; - return this; - } + /** + * Getter for SubscriptionId. + * ID of the subscription that generated the invoice. + * @return Returns the Integer + */ + @JsonGetter("subscription_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getSubscriptionId() { + return subscriptionId; + } - /** - * Setter for originalAmount. - * @param originalAmount String value for originalAmount. - * @return Builder - */ - public Builder originalAmount(String originalAmount) { - this.originalAmount = originalAmount; - return this; - } + /** + * Setter for SubscriptionId. + * ID of the subscription that generated the invoice. + * @param subscriptionId Value for Integer + */ + @JsonSetter("subscription_id") + public void setSubscriptionId(Integer subscriptionId) { + this.subscriptionId = subscriptionId; + } - /** - * Setter for appliedAmount. - * @param appliedAmount String value for appliedAmount. - * @return Builder - */ - public Builder appliedAmount(String appliedAmount) { - this.appliedAmount = appliedAmount; - return this; - } + /** + * Getter for Number. + * 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. + * @return Returns the String + */ + @JsonGetter("number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getNumber() { + return number; + } + + /** + * Setter for Number. + * 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. + * @param number Value for String + */ + @JsonSetter("number") + public void setNumber(String number) { + this.number = number; + } + + /** + * Getter for SequenceNumber. + * 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. + * @return Returns the Integer + */ + @JsonGetter("sequence_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Setter for SequenceNumber. + * 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. + * @param sequenceNumber Value for Integer + */ + @JsonSetter("sequence_number") + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Getter for CreatedAt. + * @return Returns the ZonedDateTime + */ + @JsonGetter("created_at") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) + public ZonedDateTime getCreatedAt() { + return createdAt; + } + + /** + * Setter for CreatedAt. + * @param createdAt Value for ZonedDateTime + */ + @JsonSetter("created_at") + @JsonDeserialize(using = DateTimeHelper.Rfc8601DateTimeDeserializer.class) + public void setCreatedAt(ZonedDateTime createdAt) { + this.createdAt = createdAt; + } + + /** + * Getter for UpdatedAt. + * @return Returns the ZonedDateTime + */ + @JsonGetter("updated_at") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.Rfc8601DateTimeSerializer.class) + public ZonedDateTime getUpdatedAt() { + return updatedAt; + } + + /** + * Setter for UpdatedAt. + * @param updatedAt Value for ZonedDateTime + */ + @JsonSetter("updated_at") + @JsonDeserialize(using = DateTimeHelper.Rfc8601DateTimeDeserializer.class) + public void setUpdatedAt(ZonedDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * Getter for IssueDate. + * 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"`. + * @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. + * 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"`. + * @param issueDate Value for LocalDate + */ + @JsonSetter("issue_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setIssueDate(LocalDate issueDate) { + this.issueDate = issueDate; + } + + /** + * Getter for DueDate. + * Date the invoice is due. The format is `"YYYY-MM-DD"`. + * @return Returns the LocalDate + */ + @JsonGetter("due_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.SimpleDateSerializer.class) + public LocalDate getDueDate() { + return dueDate; + } + + /** + * Setter for DueDate. + * Date the invoice is due. The format is `"YYYY-MM-DD"`. + * @param dueDate Value for LocalDate + */ + @JsonSetter("due_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setDueDate(LocalDate dueDate) { + this.dueDate = dueDate; + } + + /** + * Internal Getter for PaidDate. + * 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"`. + * @return Returns the Internal LocalDate + */ + @JsonGetter("paid_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.SimpleDateSerializer.class) + protected OptionalNullable internalGetPaidDate() { + return this.paidDate; + } + + /** + * Getter for PaidDate. + * 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"`. + * @return Returns the LocalDate + */ + public LocalDate getPaidDate() { + return OptionalNullable.getFrom(paidDate); + } + + /** + * Setter for PaidDate. + * 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"`. + * @param paidDate Value for LocalDate + */ + @JsonSetter("paid_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setPaidDate(LocalDate paidDate) { + this.paidDate = OptionalNullable.of(paidDate); + } + + /** + * UnSetter for PaidDate. + * 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"`. + */ + public void unsetPaidDate() { + paidDate = null; + } + + /** + * Getter for Status. + * The current status of the invoice. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) + * for more. + * @return Returns the InvoiceStatus + */ + @JsonGetter("status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceStatus getStatus() { + return status; + } + + /** + * Setter for Status. + * The current status of the invoice. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) + * for more. + * @param status Value for InvoiceStatus + */ + @JsonSetter("status") + public void setStatus(InvoiceStatus status) { + this.status = status; + } + + /** + * Internal Getter for ParentInvoiceId. + * @return Returns the Internal Integer + */ + @JsonGetter("parent_invoice_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetParentInvoiceId() { + return this.parentInvoiceId; + } + + /** + * Getter for ParentInvoiceId. + * @return Returns the Integer + */ + public Integer getParentInvoiceId() { + return OptionalNullable.getFrom(parentInvoiceId); + } + + /** + * Setter for ParentInvoiceId. + * @param parentInvoiceId Value for Integer + */ + @JsonSetter("parent_invoice_id") + public void setParentInvoiceId(Integer parentInvoiceId) { + this.parentInvoiceId = OptionalNullable.of(parentInvoiceId); + } + + /** + * UnSetter for ParentInvoiceId. + */ + public void unsetParentInvoiceId() { + parentInvoiceId = null; + } + + /** + * Getter for CollectionMethod. + * 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`. + * @return Returns the CollectionMethod + */ + @JsonGetter("collection_method") + @JsonInclude(JsonInclude.Include.NON_NULL) + public CollectionMethod getCollectionMethod() { + return collectionMethod; + } + + /** + * Setter for CollectionMethod. + * 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`. + * @param collectionMethod Value for CollectionMethod + */ + @JsonSetter("collection_method") + public void setCollectionMethod(CollectionMethod collectionMethod) { + this.collectionMethod = collectionMethod; + } + + /** + * Getter for PaymentInstructions. + * 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. + * @return Returns the String + */ + @JsonGetter("payment_instructions") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaymentInstructions() { + return paymentInstructions; + } + + /** + * Setter for PaymentInstructions. + * 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. + * @param paymentInstructions Value for String + */ + @JsonSetter("payment_instructions") + public void setPaymentInstructions(String paymentInstructions) { + this.paymentInstructions = paymentInstructions; + } + + /** + * Getter for Currency. + * The ISO 4217 currency code (3 character string) representing the currency of invoice + * transaction. + * @return Returns the String + */ + @JsonGetter("currency") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCurrency() { + return currency; + } + + /** + * Setter for Currency. + * The ISO 4217 currency code (3 character string) representing the currency of invoice + * transaction. + * @param currency Value for String + */ + @JsonSetter("currency") + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Internal Getter for ParentInvoiceUid. + * For invoices with `consolidation_level` of `child`, this specifies the UID of the parent + * (consolidated) invoice. + * @return Returns the Internal String + */ + @JsonGetter("parent_invoice_uid") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetParentInvoiceUid() { + return this.parentInvoiceUid; + } + + /** + * Getter for ParentInvoiceUid. + * For invoices with `consolidation_level` of `child`, this specifies the UID of the parent + * (consolidated) invoice. + * @return Returns the String + */ + public String getParentInvoiceUid() { + return OptionalNullable.getFrom(parentInvoiceUid); + } + + /** + * Setter for ParentInvoiceUid. + * For invoices with `consolidation_level` of `child`, this specifies the UID of the parent + * (consolidated) invoice. + * @param parentInvoiceUid Value for String + */ + @JsonSetter("parent_invoice_uid") + public void setParentInvoiceUid(String parentInvoiceUid) { + this.parentInvoiceUid = OptionalNullable.of(parentInvoiceUid); + } + + /** + * UnSetter for ParentInvoiceUid. + * For invoices with `consolidation_level` of `child`, this specifies the UID of the parent + * (consolidated) invoice. + */ + public void unsetParentInvoiceUid() { + parentInvoiceUid = null; + } + + /** + * Internal Getter for SubscriptionGroupId. + * @return Returns the Internal Integer + */ + @JsonGetter("subscription_group_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetSubscriptionGroupId() { + return this.subscriptionGroupId; + } + + /** + * Getter for SubscriptionGroupId. + * @return Returns the Integer + */ + public Integer getSubscriptionGroupId() { + return OptionalNullable.getFrom(subscriptionGroupId); + } + + /** + * Setter for SubscriptionGroupId. + * @param subscriptionGroupId Value for Integer + */ + @JsonSetter("subscription_group_id") + public void setSubscriptionGroupId(Integer subscriptionGroupId) { + this.subscriptionGroupId = OptionalNullable.of(subscriptionGroupId); + } + + /** + * UnSetter for SubscriptionGroupId. + */ + public void unsetSubscriptionGroupId() { + subscriptionGroupId = null; + } + + /** + * Internal Getter for GroupPrimarySubscriptionId. + * For invoices with `consolidation_level` of `parent`, this specifies the ID of the + * subscription which was the primary subscription of the subscription group that generated the + * invoice. + * @return Returns the Internal Integer + */ + @JsonGetter("group_primary_subscription_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetGroupPrimarySubscriptionId() { + return this.groupPrimarySubscriptionId; + } + + /** + * Getter for GroupPrimarySubscriptionId. + * For invoices with `consolidation_level` of `parent`, this specifies the ID of the + * subscription which was the primary subscription of the subscription group that generated the + * invoice. + * @return Returns the Integer + */ + public Integer getGroupPrimarySubscriptionId() { + return OptionalNullable.getFrom(groupPrimarySubscriptionId); + } + + /** + * Setter for GroupPrimarySubscriptionId. + * For invoices with `consolidation_level` of `parent`, this specifies the ID of the + * subscription which was the primary subscription of the subscription group that generated the + * invoice. + * @param groupPrimarySubscriptionId Value for Integer + */ + @JsonSetter("group_primary_subscription_id") + public void setGroupPrimarySubscriptionId(Integer groupPrimarySubscriptionId) { + this.groupPrimarySubscriptionId = OptionalNullable.of(groupPrimarySubscriptionId); + } + + /** + * UnSetter for GroupPrimarySubscriptionId. + * For invoices with `consolidation_level` of `parent`, this specifies the ID of the + * subscription which was the primary subscription of the subscription group that generated the + * invoice. + */ + public void unsetGroupPrimarySubscriptionId() { + groupPrimarySubscriptionId = null; + } + + /** + * Getter for ProductName. + * The name of the product subscribed when the invoice was generated. + * @return Returns the String + */ + @JsonGetter("product_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getProductName() { + return productName; + } + + /** + * Setter for ProductName. + * The name of the product subscribed when the invoice was generated. + * @param productName Value for String + */ + @JsonSetter("product_name") + public void setProductName(String productName) { + this.productName = productName; + } + + /** + * Getter for ProductFamilyName. + * The name of the product family subscribed when the invoice was generated. + * @return Returns the String + */ + @JsonGetter("product_family_name") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getProductFamilyName() { + return productFamilyName; + } + + /** + * Setter for ProductFamilyName. + * The name of the product family subscribed when the invoice was generated. + * @param productFamilyName Value for String + */ + @JsonSetter("product_family_name") + public void setProductFamilyName(String productFamilyName) { + this.productFamilyName = productFamilyName; + } + + /** + * Getter for Seller. + * Information about the seller (merchant) listed on the masthead of the invoice. + * @return Returns the InvoiceSeller + */ + @JsonGetter("seller") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceSeller getSeller() { + return seller; + } + + /** + * Setter for Seller. + * Information about the seller (merchant) listed on the masthead of the invoice. + * @param seller Value for InvoiceSeller + */ + @JsonSetter("seller") + public void setSeller(InvoiceSeller seller) { + this.seller = seller; + } + + /** + * Getter for Customer. + * Information about the customer who is owner or recipient the invoiced subscription. + * @return Returns the InvoiceCustomer + */ + @JsonGetter("customer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceCustomer getCustomer() { + return customer; + } + + /** + * Setter for Customer. + * Information about the customer who is owner or recipient the invoiced subscription. + * @param customer Value for InvoiceCustomer + */ + @JsonSetter("customer") + public void setCustomer(InvoiceCustomer customer) { + this.customer = customer; + } + + /** + * Getter for Payer. + * @return Returns the InvoicePayer + */ + @JsonGetter("payer") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoicePayer getPayer() { + return payer; + } + + /** + * Setter for Payer. + * @param payer Value for InvoicePayer + */ + @JsonSetter("payer") + public void setPayer(InvoicePayer payer) { + this.payer = payer; + } + + /** + * Getter for RecipientEmails. + * @return Returns the List of String + */ + @JsonGetter("recipient_emails") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getRecipientEmails() { + return recipientEmails; + } + + /** + * Setter for RecipientEmails. + * @param recipientEmails Value for List of String + */ + @JsonSetter("recipient_emails") + public void setRecipientEmails(List recipientEmails) { + this.recipientEmails = recipientEmails; + } + + /** + * Getter for NetTerms. + * @return Returns the Integer + */ + @JsonGetter("net_terms") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getNetTerms() { + return netTerms; + } + + /** + * Setter for NetTerms. + * @param netTerms Value for Integer + */ + @JsonSetter("net_terms") + public void setNetTerms(Integer netTerms) { + this.netTerms = netTerms; + } + + /** + * Getter for BillingAddress. + * @return Returns the BillingAddress + */ + @JsonGetter("billing_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public BillingAddress getBillingAddress() { + return billingAddress; + } + + /** + * Setter for BillingAddress. + * @param billingAddress Value for BillingAddress + */ + @JsonSetter("billing_address") + public void setBillingAddress(BillingAddress billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * Getter for ShippingAddress. + * @return Returns the ShippingAddress + */ + @JsonGetter("shipping_address") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ShippingAddress getShippingAddress() { + return shippingAddress; + } + + /** + * Setter for ShippingAddress. + * @param shippingAddress Value for ShippingAddress + */ + @JsonSetter("shipping_address") + public void setShippingAddress(ShippingAddress shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * Getter for SubtotalAmount. + * Subtotal of the invoice, which is the sum of all line items before discounts or taxes. + * @return Returns the String + */ + @JsonGetter("subtotal_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSubtotalAmount() { + return subtotalAmount; + } + + /** + * Setter for SubtotalAmount. + * Subtotal of the invoice, which is the sum of all line items before discounts or taxes. + * @param subtotalAmount Value for String + */ + @JsonSetter("subtotal_amount") + public void setSubtotalAmount(String subtotalAmount) { + this.subtotalAmount = subtotalAmount; + } + + /** + * Getter for DiscountAmount. + * Total discount applied to the invoice. + * @return Returns the String + */ + @JsonGetter("discount_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDiscountAmount() { + return discountAmount; + } + + /** + * Setter for DiscountAmount. + * Total discount applied to the invoice. + * @param discountAmount Value for String + */ + @JsonSetter("discount_amount") + public void setDiscountAmount(String discountAmount) { + this.discountAmount = discountAmount; + } + + /** + * Getter for TaxAmount. + * Total tax on the invoice. + * @return Returns the String + */ + @JsonGetter("tax_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTaxAmount() { + return taxAmount; + } + + /** + * Setter for TaxAmount. + * Total tax on the invoice. + * @param taxAmount Value for String + */ + @JsonSetter("tax_amount") + public void setTaxAmount(String taxAmount) { + this.taxAmount = taxAmount; + } + + /** + * Getter for CreditAmount. + * The amount of credit (from credit notes) applied to this invoice. Credits offset the amount + * due from the customer. + * @return Returns the String + */ + @JsonGetter("credit_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getCreditAmount() { + return creditAmount; + } + + /** + * Setter for CreditAmount. + * The amount of credit (from credit notes) applied to this invoice. Credits offset the amount + * due from the customer. + * @param creditAmount Value for String + */ + @JsonSetter("credit_amount") + public void setCreditAmount(String creditAmount) { + this.creditAmount = creditAmount; + } + + /** + * Getter for PaidAmount. + * The amount paid on the invoice by the customer. + * @return Returns the String + */ + @JsonGetter("paid_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPaidAmount() { + return paidAmount; + } + + /** + * Setter for PaidAmount. + * The amount paid on the invoice by the customer. + * @param paidAmount Value for String + */ + @JsonSetter("paid_amount") + public void setPaidAmount(String paidAmount) { + this.paidAmount = paidAmount; + } + + /** + * Getter for LineItems. + * Line items on the invoice. + * @return Returns the List of InvoiceLineItem1 + */ + @JsonGetter("line_items") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getLineItems() { + return lineItems; + } + + /** + * Setter for LineItems. + * Line items on the invoice. + * @param lineItems Value for List of InvoiceLineItem1 + */ + @JsonSetter("line_items") + public void setLineItems(List lineItems) { + this.lineItems = lineItems; + } + + /** + * Getter for Discounts. + * @return Returns the List of InvoiceDiscount + */ + @JsonGetter("discounts") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getDiscounts() { + return discounts; + } + + /** + * Setter for Discounts. + * @param discounts Value for List of InvoiceDiscount + */ + @JsonSetter("discounts") + public void setDiscounts(List discounts) { + this.discounts = discounts; + } + + /** + * Getter for Taxes. + * @return Returns the List of InvoiceTax + */ + @JsonGetter("taxes") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getTaxes() { + return taxes; + } + + /** + * Setter for Taxes. + * @param taxes Value for List of InvoiceTax + */ + @JsonSetter("taxes") + public void setTaxes(List taxes) { + this.taxes = taxes; + } + + /** + * Getter for Credits. + * @return Returns the List of InvoiceCredit + */ + @JsonGetter("credits") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getCredits() { + return credits; + } + + /** + * Setter for Credits. + * @param credits Value for List of InvoiceCredit + */ + @JsonSetter("credits") + public void setCredits(List credits) { + this.credits = credits; + } + + /** + * Getter for Refunds. + * @return Returns the List of InvoiceRefund + */ + @JsonGetter("refunds") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getRefunds() { + return refunds; + } + + /** + * Setter for Refunds. + * @param refunds Value for List of InvoiceRefund + */ + @JsonSetter("refunds") + public void setRefunds(List refunds) { + this.refunds = refunds; + } + + /** + * Getter for Payments. + * @return Returns the List of InvoicePayment + */ + @JsonGetter("payments") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getPayments() { + return payments; + } + + /** + * Setter for Payments. + * @param payments Value for List of InvoicePayment + */ + @JsonSetter("payments") + public void setPayments(List payments) { + this.payments = payments; + } + + /** + * Getter for CustomFields. + * @return Returns the List of InvoiceCustomField + */ + @JsonGetter("custom_fields") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getCustomFields() { + return customFields; + } + + /** + * Setter for CustomFields. + * @param customFields Value for List of InvoiceCustomField + */ + @JsonSetter("custom_fields") + public void setCustomFields(List customFields) { + this.customFields = customFields; + } + + /** + * Getter for DisplaySettings. + * @return Returns the InvoiceDisplaySettings + */ + @JsonGetter("display_settings") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoiceDisplaySettings getDisplaySettings() { + return displaySettings; + } + + /** + * Setter for DisplaySettings. + * @param displaySettings Value for InvoiceDisplaySettings + */ + @JsonSetter("display_settings") + public void setDisplaySettings(InvoiceDisplaySettings displaySettings) { + this.displaySettings = displaySettings; + } + + /** + * Getter for PublicUrl. + * The public URL of the invoice + * @return Returns the String + */ + @JsonGetter("public_url") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getPublicUrl() { + return publicUrl; + } + + /** + * Setter for PublicUrl. + * The public URL of the invoice + * @param publicUrl Value for String + */ + @JsonSetter("public_url") + public void setPublicUrl(String publicUrl) { + this.publicUrl = publicUrl; + } + + /** + * Getter for PreviousBalanceData. + * @return Returns the InvoicePreviousBalance + */ + @JsonGetter("previous_balance_data") + @JsonInclude(JsonInclude.Include.NON_NULL) + public InvoicePreviousBalance getPreviousBalanceData() { + return previousBalanceData; + } + + /** + * Setter for PreviousBalanceData. + * @param previousBalanceData Value for InvoicePreviousBalance + */ + @JsonSetter("previous_balance_data") + public void setPreviousBalanceData(InvoicePreviousBalance previousBalanceData) { + this.previousBalanceData = previousBalanceData; + } + + /** + * Getter for GatewayTransId. + * Identifier for the transaction within the payment gateway. + * @return Returns the String + */ + @JsonGetter("gateway_trans_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getGatewayTransId() { + return gatewayTransId; + } + + /** + * Setter for GatewayTransId. + * Identifier for the transaction within the payment gateway. + * @param gatewayTransId Value for String + */ + @JsonSetter("gateway_trans_id") + public void setGatewayTransId(String gatewayTransId) { + this.gatewayTransId = gatewayTransId; + } + + /** + * Getter for Amount. + * The monetary value associated with the linked payment, expressed in dollars. + * @return Returns the String + */ + @JsonGetter("amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getAmount() { + return amount; + } + + /** + * Setter for Amount. + * The monetary value associated with the linked payment, expressed in dollars. + * @param amount Value for String + */ + @JsonSetter("amount") + public void setAmount(String amount) { + this.amount = amount; + } + + /** + * Getter for AmountInCents. + * The monetary value of the payment, expressed in cents. + * @return Returns the Integer + */ + @JsonGetter("amount_in_cents") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getAmountInCents() { + return amountInCents; + } + + /** + * Setter for AmountInCents. + * The monetary value of the payment, expressed in cents. + * @param amountInCents Value for Integer + */ + @JsonSetter("amount_in_cents") + public void setAmountInCents(Integer amountInCents) { + this.amountInCents = amountInCents; + } + + /** + * Getter for OriginCreditNoteUid. + * 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. + * @return Returns the String + */ + @JsonGetter("origin_credit_note_uid") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getOriginCreditNoteUid() { + return originCreditNoteUid; + } + + /** + * Setter for OriginCreditNoteUid. + * 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. + * @param originCreditNoteUid Value for String + */ + @JsonSetter("origin_credit_note_uid") + public void setOriginCreditNoteUid(String originCreditNoteUid) { + this.originCreditNoteUid = originCreditNoteUid; + } + + /** + * Getter for OriginCreditNoteNumber. + * A unique, identifying string of the connected credit note. + * @return Returns the String + */ + @JsonGetter("origin_credit_note_number") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getOriginCreditNoteNumber() { + return originCreditNoteNumber; + } + + /** + * Setter for OriginCreditNoteNumber. + * A unique, identifying string of the connected credit note. + * @param originCreditNoteNumber Value for String + */ + @JsonSetter("origin_credit_note_number") + public void setOriginCreditNoteNumber(String originCreditNoteNumber) { + this.originCreditNoteNumber = originCreditNoteNumber; + } + + /** + * Getter for AppliedDate. + * 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". + * @return Returns the LocalDate + */ + @JsonGetter("applied_date") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.SimpleDateSerializer.class) + public LocalDate getAppliedDate() { + return appliedDate; + } + + /** + * Setter for AppliedDate. + * 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". + * @param appliedDate Value for LocalDate + */ + @JsonSetter("applied_date") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setAppliedDate(LocalDate appliedDate) { + this.appliedDate = appliedDate; + } + + /** + * Getter for RemainingAmount. + * The amount of the credit note remaining to be applied to invoices, which is `total_amount - + * applied_amount`. + * @return Returns the String + */ + @JsonGetter("remaining_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getRemainingAmount() { + return remainingAmount; + } + + /** + * Setter for RemainingAmount. + * The amount of the credit note remaining to be applied to invoices, which is `total_amount - + * applied_amount`. + * @param remainingAmount Value for String + */ + @JsonSetter("remaining_amount") + public void setRemainingAmount(String remainingAmount) { + this.remainingAmount = remainingAmount; + } + + /** + * Getter for Applications. + * @return Returns the List of CreditNoteApplication + */ + @JsonGetter("applications") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getApplications() { + return applications; + } + + /** + * Setter for Applications. + * @param applications Value for List of CreditNoteApplication + */ + @JsonSetter("applications") + public void setApplications(List applications) { + this.applications = applications; + } + + /** + * Getter for OriginInvoices. + * An array of origin invoices for the credit note. Learn more about [Origin Invoice from our + * docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) + * @return Returns the List of OriginInvoice + */ + @JsonGetter("origin_invoices") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getOriginInvoices() { + return originInvoices; + } + + /** + * Setter for OriginInvoices. + * An array of origin invoices for the credit note. Learn more about [Origin Invoice from our + * docs](https://chargify.zendesk.com/hc/en-us/articles/4407753036699#origin-invoices) + * @param originInvoices Value for List of OriginInvoice + */ + @JsonSetter("origin_invoices") + public void setOriginInvoices(List originInvoices) { + this.originInvoices = originInvoices; + } + + /** + * Getter for ChargebackStatus. + * @return Returns the ChargebackStatus + */ + @JsonGetter("chargeback_status") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ChargebackStatus getChargebackStatus() { + return chargebackStatus; + } + + /** + * Setter for ChargebackStatus. + * @param chargebackStatus Value for ChargebackStatus + */ + @JsonSetter("chargeback_status") + public void setChargebackStatus(ChargebackStatus chargebackStatus) { + this.chargebackStatus = chargebackStatus; + } + + /** + * Converts this InvoiceEventData into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "InvoiceEventData [" + "uid=" + uid + ", creditNoteNumber=" + creditNoteNumber + + ", creditNoteUid=" + creditNoteUid + ", originalAmount=" + originalAmount + + ", appliedAmount=" + appliedAmount + ", transactionTime=" + transactionTime + + ", memo=" + memo + ", role=" + role + ", consolidatedInvoice=" + + consolidatedInvoice + ", appliedCreditNotes=" + appliedCreditNotes + + ", debitNoteNumber=" + debitNoteNumber + ", debitNoteUid=" + debitNoteUid + + ", consolidationLevel=" + consolidationLevel + ", paymentMethod=" + paymentMethod + + ", transactionId=" + transactionId + ", parentInvoiceNumber=" + + parentInvoiceNumber + ", remainingPrepaymentAmount=" + remainingPrepaymentAmount + + ", prepayment=" + prepayment + ", external=" + external + + ", fromCollectionMethod=" + fromCollectionMethod + ", toCollectionMethod=" + + toCollectionMethod + ", fromStatus=" + fromStatus + ", toStatus=" + toStatus + + ", dueAmount=" + dueAmount + ", totalAmount=" + totalAmount + ", applyCredit=" + + applyCredit + ", creditNoteAttributes=" + creditNoteAttributes + ", paymentId=" + + paymentId + ", refundAmount=" + refundAmount + ", refundId=" + refundId + + ", isAdvanceInvoice=" + isAdvanceInvoice + ", reason=" + reason + ", id=" + id + + ", siteId=" + siteId + ", customerId=" + customerId + ", subscriptionId=" + + subscriptionId + ", number=" + number + ", sequenceNumber=" + sequenceNumber + + ", createdAt=" + createdAt + ", updatedAt=" + updatedAt + ", issueDate=" + + issueDate + ", dueDate=" + dueDate + ", paidDate=" + paidDate + ", status=" + + status + ", parentInvoiceId=" + parentInvoiceId + ", collectionMethod=" + + collectionMethod + ", paymentInstructions=" + paymentInstructions + ", currency=" + + currency + ", parentInvoiceUid=" + parentInvoiceUid + ", subscriptionGroupId=" + + subscriptionGroupId + ", groupPrimarySubscriptionId=" + groupPrimarySubscriptionId + + ", productName=" + productName + ", productFamilyName=" + productFamilyName + + ", seller=" + seller + ", customer=" + customer + ", payer=" + payer + + ", recipientEmails=" + recipientEmails + ", netTerms=" + netTerms + + ", billingAddress=" + billingAddress + ", shippingAddress=" + shippingAddress + + ", subtotalAmount=" + subtotalAmount + ", discountAmount=" + discountAmount + + ", taxAmount=" + taxAmount + ", creditAmount=" + creditAmount + ", paidAmount=" + + paidAmount + ", lineItems=" + lineItems + ", discounts=" + discounts + ", taxes=" + + taxes + ", credits=" + credits + ", refunds=" + refunds + ", payments=" + payments + + ", customFields=" + customFields + ", displaySettings=" + displaySettings + + ", publicUrl=" + publicUrl + ", previousBalanceData=" + previousBalanceData + + ", gatewayTransId=" + gatewayTransId + ", amount=" + amount + ", amountInCents=" + + amountInCents + ", originCreditNoteUid=" + originCreditNoteUid + + ", originCreditNoteNumber=" + originCreditNoteNumber + ", appliedDate=" + + appliedDate + ", remainingAmount=" + remainingAmount + ", applications=" + + applications + ", originInvoices=" + originInvoices + ", chargebackStatus=" + + chargebackStatus + ", additionalProperties=" + getAdditionalProperties() + "]"; + } + + /** + * Builds a new {@link InvoiceEventData.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link InvoiceEventData.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .uid(getUid()) + .creditNoteNumber(getCreditNoteNumber()) + .creditNoteUid(getCreditNoteUid()) + .originalAmount(getOriginalAmount()) + .appliedAmount(getAppliedAmount()) + .transactionTime(getTransactionTime()) + .role(getRole()) + .consolidatedInvoice(getConsolidatedInvoice()) + .appliedCreditNotes(getAppliedCreditNotes()) + .debitNoteNumber(getDebitNoteNumber()) + .debitNoteUid(getDebitNoteUid()) + .consolidationLevel(getConsolidationLevel()) + .paymentMethod(getPaymentMethod()) + .transactionId(getTransactionId()) + .prepayment(getPrepayment()) + .external(getExternal()) + .fromCollectionMethod(getFromCollectionMethod()) + .toCollectionMethod(getToCollectionMethod()) + .fromStatus(getFromStatus()) + .toStatus(getToStatus()) + .dueAmount(getDueAmount()) + .totalAmount(getTotalAmount()) + .applyCredit(getApplyCredit()) + .creditNoteAttributes(getCreditNoteAttributes()) + .paymentId(getPaymentId()) + .refundAmount(getRefundAmount()) + .refundId(getRefundId()) + .isAdvanceInvoice(getIsAdvanceInvoice()) + .reason(getReason()) + .id(getId()) + .siteId(getSiteId()) + .customerId(getCustomerId()) + .subscriptionId(getSubscriptionId()) + .number(getNumber()) + .sequenceNumber(getSequenceNumber()) + .createdAt(getCreatedAt()) + .updatedAt(getUpdatedAt()) + .issueDate(getIssueDate()) + .dueDate(getDueDate()) + .status(getStatus()) + .collectionMethod(getCollectionMethod()) + .paymentInstructions(getPaymentInstructions()) + .currency(getCurrency()) + .productName(getProductName()) + .productFamilyName(getProductFamilyName()) + .seller(getSeller()) + .customer(getCustomer()) + .payer(getPayer()) + .recipientEmails(getRecipientEmails()) + .netTerms(getNetTerms()) + .billingAddress(getBillingAddress()) + .shippingAddress(getShippingAddress()) + .subtotalAmount(getSubtotalAmount()) + .discountAmount(getDiscountAmount()) + .taxAmount(getTaxAmount()) + .creditAmount(getCreditAmount()) + .paidAmount(getPaidAmount()) + .lineItems(getLineItems()) + .discounts(getDiscounts()) + .taxes(getTaxes()) + .credits(getCredits()) + .refunds(getRefunds()) + .payments(getPayments()) + .customFields(getCustomFields()) + .displaySettings(getDisplaySettings()) + .publicUrl(getPublicUrl()) + .previousBalanceData(getPreviousBalanceData()) + .gatewayTransId(getGatewayTransId()) + .amount(getAmount()) + .amountInCents(getAmountInCents()) + .originCreditNoteUid(getOriginCreditNoteUid()) + .originCreditNoteNumber(getOriginCreditNoteNumber()) + .appliedDate(getAppliedDate()) + .remainingAmount(getRemainingAmount()) + .applications(getApplications()) + .originInvoices(getOriginInvoices()) + .chargebackStatus(getChargebackStatus()); + builder.memo = internalGetMemo(); + builder.parentInvoiceNumber = internalGetParentInvoiceNumber(); + builder.remainingPrepaymentAmount = internalGetRemainingPrepaymentAmount(); + builder.paidDate = internalGetPaidDate(); + builder.parentInvoiceId = internalGetParentInvoiceId(); + builder.parentInvoiceUid = internalGetParentInvoiceUid(); + builder.subscriptionGroupId = internalGetSubscriptionGroupId(); + builder.groupPrimarySubscriptionId = internalGetGroupPrimarySubscriptionId(); + return builder; + } + + /** + * Class to build instances of {@link InvoiceEventData}. + */ + public static class Builder { + private String uid; + private String creditNoteNumber; + private String creditNoteUid; + private String originalAmount; + private String appliedAmount; + private ZonedDateTime transactionTime; + private OptionalNullable memo; + private InvoiceRole1 role; + private Boolean consolidatedInvoice; + private List appliedCreditNotes; + private String debitNoteNumber; + private String debitNoteUid; + private InvoiceConsolidationLevel consolidationLevel; + private InvoiceEventDataPaymentMethod paymentMethod; + private Integer transactionId; + private OptionalNullable parentInvoiceNumber; + private OptionalNullable remainingPrepaymentAmount; + private Boolean prepayment; + private Boolean external; + private String fromCollectionMethod; + private String toCollectionMethod; + private Object fromStatus; + private Object toStatus; + private String dueAmount; + private String totalAmount; + private Boolean applyCredit; + private CreditNote1 creditNoteAttributes; + private Integer paymentId; + private String refundAmount; + private Integer refundId; + private Boolean isAdvanceInvoice; + private String reason; + private Long id; + private Integer siteId; + private Integer customerId; + private Integer subscriptionId; + private String number; + private Integer sequenceNumber; + private ZonedDateTime createdAt; + private ZonedDateTime updatedAt; + private LocalDate issueDate; + private LocalDate dueDate; + private OptionalNullable paidDate; + private InvoiceStatus status; + private OptionalNullable parentInvoiceId; + private CollectionMethod collectionMethod = CollectionMethod.AUTOMATIC; + private String paymentInstructions; + private String currency; + private OptionalNullable parentInvoiceUid; + private OptionalNullable subscriptionGroupId; + private OptionalNullable groupPrimarySubscriptionId; + private String productName; + private String productFamilyName; + private InvoiceSeller seller; + private InvoiceCustomer customer; + private InvoicePayer payer; + private List recipientEmails; + private Integer netTerms; + private BillingAddress billingAddress; + private ShippingAddress shippingAddress; + private String subtotalAmount; + private String discountAmount; + private String taxAmount; + private String creditAmount; + private String paidAmount; + private List lineItems; + private List discounts; + private List taxes; + private List credits; + private List refunds; + private List payments; + private List customFields; + private InvoiceDisplaySettings displaySettings; + private String publicUrl; + private InvoicePreviousBalance previousBalanceData; + private String gatewayTransId; + private String amount; + private Integer amountInCents; + private String originCreditNoteUid; + private String originCreditNoteNumber; + private LocalDate appliedDate; + private String remainingAmount; + private List applications; + private List originInvoices; + private ChargebackStatus chargebackStatus; + + + + /** + * Setter for uid. + * @param uid String value for uid. + * @return Builder + */ + public Builder uid(String uid) { + this.uid = uid; + return this; + } + + /** + * Setter for creditNoteNumber. + * @param creditNoteNumber String value for creditNoteNumber. + * @return Builder + */ + public Builder creditNoteNumber(String creditNoteNumber) { + this.creditNoteNumber = creditNoteNumber; + return this; + } + + /** + * Setter for creditNoteUid. + * @param creditNoteUid String value for creditNoteUid. + * @return Builder + */ + public Builder creditNoteUid(String creditNoteUid) { + this.creditNoteUid = creditNoteUid; + return this; + } + + /** + * Setter for originalAmount. + * @param originalAmount String value for originalAmount. + * @return Builder + */ + public Builder originalAmount(String originalAmount) { + this.originalAmount = originalAmount; + return this; + } + + /** + * Setter for appliedAmount. + * @param appliedAmount String value for appliedAmount. + * @return Builder + */ + public Builder appliedAmount(String appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + /** + * Setter for transactionTime. + * @param transactionTime ZonedDateTime value for transactionTime. + * @return Builder + */ + public Builder transactionTime(ZonedDateTime transactionTime) { + this.transactionTime = transactionTime; + return this; + } + + /** + * Setter for memo. + * @param memo String value for memo. + * @return Builder + */ + public Builder memo(String memo) { + this.memo = OptionalNullable.of(memo); + return this; + } + + /** + * UnSetter for memo. + * @return Builder + */ + public Builder unsetMemo() { + memo = null; + return this; + } + + /** + * Setter for role. + * @param role InvoiceRole1 value for role. + * @return Builder + */ + public Builder role(InvoiceRole1 role) { + this.role = role; + return this; + } + + /** + * Setter for consolidatedInvoice. + * @param consolidatedInvoice Boolean value for consolidatedInvoice. + * @return Builder + */ + public Builder consolidatedInvoice(Boolean consolidatedInvoice) { + this.consolidatedInvoice = consolidatedInvoice; + return this; + } + + /** + * Setter for appliedCreditNotes. + * @param appliedCreditNotes List of AppliedCreditNoteData value for appliedCreditNotes. + * @return Builder + */ + public Builder appliedCreditNotes(List appliedCreditNotes) { + this.appliedCreditNotes = appliedCreditNotes; + return this; + } + + /** + * Setter for debitNoteNumber. + * @param debitNoteNumber String value for debitNoteNumber. + * @return Builder + */ + public Builder debitNoteNumber(String debitNoteNumber) { + this.debitNoteNumber = debitNoteNumber; + return this; + } + + /** + * Setter for debitNoteUid. + * @param debitNoteUid String value for debitNoteUid. + * @return Builder + */ + public Builder debitNoteUid(String debitNoteUid) { + this.debitNoteUid = debitNoteUid; + return this; + } + + /** + * Setter for consolidationLevel. + * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. + * @return Builder + */ + public Builder consolidationLevel(InvoiceConsolidationLevel consolidationLevel) { + this.consolidationLevel = consolidationLevel; + return this; + } + + /** + * Setter for paymentMethod. + * @param paymentMethod InvoiceEventDataPaymentMethod value for paymentMethod. + * @return Builder + */ + public Builder paymentMethod(InvoiceEventDataPaymentMethod paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Setter for transactionId. + * @param transactionId Integer value for transactionId. + * @return Builder + */ + public Builder transactionId(Integer transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Setter for parentInvoiceNumber. + * @param parentInvoiceNumber Integer value for parentInvoiceNumber. + * @return Builder + */ + public Builder parentInvoiceNumber(Integer parentInvoiceNumber) { + this.parentInvoiceNumber = OptionalNullable.of(parentInvoiceNumber); + return this; + } + + /** + * UnSetter for parentInvoiceNumber. + * @return Builder + */ + public Builder unsetParentInvoiceNumber() { + parentInvoiceNumber = null; + return this; + } + + /** + * Setter for remainingPrepaymentAmount. + * @param remainingPrepaymentAmount String value for remainingPrepaymentAmount. + * @return Builder + */ + public Builder remainingPrepaymentAmount(String remainingPrepaymentAmount) { + this.remainingPrepaymentAmount = OptionalNullable.of(remainingPrepaymentAmount); + return this; + } + + /** + * UnSetter for remainingPrepaymentAmount. + * @return Builder + */ + public Builder unsetRemainingPrepaymentAmount() { + remainingPrepaymentAmount = null; + return this; + } + + /** + * Setter for prepayment. + * @param prepayment Boolean value for prepayment. + * @return Builder + */ + public Builder prepayment(Boolean prepayment) { + this.prepayment = prepayment; + return this; + } + + /** + * Setter for external. + * @param external Boolean value for external. + * @return Builder + */ + public Builder external(Boolean external) { + this.external = external; + return this; + } + + /** + * Setter for fromCollectionMethod. + * @param fromCollectionMethod String value for fromCollectionMethod. + * @return Builder + */ + public Builder fromCollectionMethod(String fromCollectionMethod) { + this.fromCollectionMethod = fromCollectionMethod; + return this; + } + + /** + * Setter for toCollectionMethod. + * @param toCollectionMethod String value for toCollectionMethod. + * @return Builder + */ + public Builder toCollectionMethod(String toCollectionMethod) { + this.toCollectionMethod = toCollectionMethod; + return this; + } + + /** + * Setter for fromStatus. + * @param fromStatus Object value for fromStatus. + * @return Builder + */ + public Builder fromStatus(Object fromStatus) { + this.fromStatus = fromStatus; + return this; + } + + /** + * Setter for toStatus. + * @param toStatus Object value for toStatus. + * @return Builder + */ + public Builder toStatus(Object toStatus) { + this.toStatus = toStatus; + return this; + } + + /** + * Setter for dueAmount. + * @param dueAmount String value for dueAmount. + * @return Builder + */ + public Builder dueAmount(String dueAmount) { + this.dueAmount = dueAmount; + return this; + } + + /** + * Setter for totalAmount. + * @param totalAmount String value for totalAmount. + * @return Builder + */ + public Builder totalAmount(String totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + /** + * Setter for applyCredit. + * @param applyCredit Boolean value for applyCredit. + * @return Builder + */ + public Builder applyCredit(Boolean applyCredit) { + this.applyCredit = applyCredit; + return this; + } + + /** + * Setter for creditNoteAttributes. + * @param creditNoteAttributes CreditNote1 value for creditNoteAttributes. + * @return Builder + */ + public Builder creditNoteAttributes(CreditNote1 creditNoteAttributes) { + this.creditNoteAttributes = creditNoteAttributes; + return this; + } + + /** + * Setter for paymentId. + * @param paymentId Integer value for paymentId. + * @return Builder + */ + public Builder paymentId(Integer paymentId) { + this.paymentId = paymentId; + return this; + } + + /** + * Setter for refundAmount. + * @param refundAmount String value for refundAmount. + * @return Builder + */ + public Builder refundAmount(String refundAmount) { + this.refundAmount = refundAmount; + return this; + } + + /** + * Setter for refundId. + * @param refundId Integer value for refundId. + * @return Builder + */ + public Builder refundId(Integer refundId) { + this.refundId = refundId; + return this; + } + + /** + * Setter for isAdvanceInvoice. + * @param isAdvanceInvoice Boolean value for isAdvanceInvoice. + * @return Builder + */ + public Builder isAdvanceInvoice(Boolean isAdvanceInvoice) { + this.isAdvanceInvoice = isAdvanceInvoice; + return this; + } + + /** + * Setter for reason. + * @param reason String value for reason. + * @return Builder + */ + public Builder reason(String reason) { + this.reason = reason; + return this; + } + + /** + * Setter for id. + * @param id Long value for id. + * @return Builder + */ + public Builder id(Long id) { + this.id = id; + return this; + } + + /** + * Setter for siteId. + * @param siteId Integer value for siteId. + * @return Builder + */ + public Builder siteId(Integer siteId) { + this.siteId = siteId; + 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 subscriptionId. + * @param subscriptionId Integer value for subscriptionId. + * @return Builder + */ + public Builder subscriptionId(Integer subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Setter for number. + * @param number String value for number. + * @return Builder + */ + public Builder number(String number) { + this.number = number; + return this; + } /** - * Setter for transactionTime. - * @param transactionTime ZonedDateTime value for transactionTime. + * Setter for sequenceNumber. + * @param sequenceNumber Integer value for sequenceNumber. * @return Builder */ - public Builder transactionTime(ZonedDateTime transactionTime) { - this.transactionTime = transactionTime; + public Builder sequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; return this; } /** - * Setter for memo. - * @param memo String value for memo. + * Setter for createdAt. + * @param createdAt ZonedDateTime value for createdAt. * @return Builder */ - public Builder memo(String memo) { - this.memo = memo; + public Builder createdAt(ZonedDateTime createdAt) { + this.createdAt = createdAt; return this; } /** - * Setter for role. - * @param role String value for role. + * Setter for updatedAt. + * @param updatedAt ZonedDateTime value for updatedAt. * @return Builder */ - public Builder role(String role) { - this.role = role; + public Builder updatedAt(ZonedDateTime updatedAt) { + this.updatedAt = updatedAt; return this; } /** - * Setter for consolidatedInvoice. - * @param consolidatedInvoice Boolean value for consolidatedInvoice. + * Setter for issueDate. + * @param issueDate LocalDate value for issueDate. * @return Builder */ - public Builder consolidatedInvoice(Boolean consolidatedInvoice) { - this.consolidatedInvoice = consolidatedInvoice; + public Builder issueDate(LocalDate issueDate) { + this.issueDate = issueDate; return this; } /** - * Setter for appliedCreditNotes. - * @param appliedCreditNotes List of AppliedCreditNoteData value for appliedCreditNotes. + * Setter for dueDate. + * @param dueDate LocalDate value for dueDate. * @return Builder */ - public Builder appliedCreditNotes(List appliedCreditNotes) { - this.appliedCreditNotes = appliedCreditNotes; + public Builder dueDate(LocalDate dueDate) { + this.dueDate = dueDate; return this; } /** - * Setter for debitNoteNumber. - * @param debitNoteNumber String value for debitNoteNumber. + * Setter for paidDate. + * @param paidDate LocalDate value for paidDate. * @return Builder */ - public Builder debitNoteNumber(String debitNoteNumber) { - this.debitNoteNumber = debitNoteNumber; + public Builder paidDate(LocalDate paidDate) { + this.paidDate = OptionalNullable.of(paidDate); return this; } /** - * Setter for debitNoteUid. - * @param debitNoteUid String value for debitNoteUid. + * UnSetter for paidDate. * @return Builder */ - public Builder debitNoteUid(String debitNoteUid) { - this.debitNoteUid = debitNoteUid; + public Builder unsetPaidDate() { + paidDate = null; return this; } /** - * Setter for paymentMethod. - * @param paymentMethod InvoiceEventDataPaymentMethod value for paymentMethod. + * Setter for status. + * @param status InvoiceStatus value for status. * @return Builder */ - public Builder paymentMethod(InvoiceEventDataPaymentMethod paymentMethod) { - this.paymentMethod = paymentMethod; + public Builder status(InvoiceStatus status) { + this.status = status; return this; } /** - * Setter for transactionId. - * @param transactionId Integer value for transactionId. + * Setter for parentInvoiceId. + * @param parentInvoiceId Integer value for parentInvoiceId. * @return Builder */ - public Builder transactionId(Integer transactionId) { - this.transactionId = transactionId; + public Builder parentInvoiceId(Integer parentInvoiceId) { + this.parentInvoiceId = OptionalNullable.of(parentInvoiceId); return this; } /** - * Setter for parentInvoiceNumber. - * @param parentInvoiceNumber Integer value for parentInvoiceNumber. + * UnSetter for parentInvoiceId. * @return Builder */ - public Builder parentInvoiceNumber(Integer parentInvoiceNumber) { - this.parentInvoiceNumber = OptionalNullable.of(parentInvoiceNumber); + public Builder unsetParentInvoiceId() { + parentInvoiceId = null; return this; } /** - * UnSetter for parentInvoiceNumber. + * Setter for collectionMethod. + * @param collectionMethod CollectionMethod value for collectionMethod. * @return Builder */ - public Builder unsetParentInvoiceNumber() { - parentInvoiceNumber = null; + public Builder collectionMethod(CollectionMethod collectionMethod) { + this.collectionMethod = collectionMethod; return this; } /** - * Setter for remainingPrepaymentAmount. - * @param remainingPrepaymentAmount String value for remainingPrepaymentAmount. + * Setter for paymentInstructions. + * @param paymentInstructions String value for paymentInstructions. * @return Builder */ - public Builder remainingPrepaymentAmount(String remainingPrepaymentAmount) { - this.remainingPrepaymentAmount = OptionalNullable.of(remainingPrepaymentAmount); + public Builder paymentInstructions(String paymentInstructions) { + this.paymentInstructions = paymentInstructions; return this; } /** - * UnSetter for remainingPrepaymentAmount. + * Setter for currency. + * @param currency String value for currency. * @return Builder */ - public Builder unsetRemainingPrepaymentAmount() { - remainingPrepaymentAmount = null; + public Builder currency(String currency) { + this.currency = currency; return this; } /** - * Setter for prepayment. - * @param prepayment Boolean value for prepayment. + * Setter for parentInvoiceUid. + * @param parentInvoiceUid String value for parentInvoiceUid. * @return Builder */ - public Builder prepayment(Boolean prepayment) { - this.prepayment = prepayment; + public Builder parentInvoiceUid(String parentInvoiceUid) { + this.parentInvoiceUid = OptionalNullable.of(parentInvoiceUid); return this; } /** - * Setter for external. - * @param external Boolean value for external. + * UnSetter for parentInvoiceUid. * @return Builder */ - public Builder external(Boolean external) { - this.external = external; + public Builder unsetParentInvoiceUid() { + parentInvoiceUid = null; return this; } /** - * Setter for fromCollectionMethod. - * @param fromCollectionMethod String value for fromCollectionMethod. + * Setter for subscriptionGroupId. + * @param subscriptionGroupId Integer value for subscriptionGroupId. * @return Builder */ - public Builder fromCollectionMethod(String fromCollectionMethod) { - this.fromCollectionMethod = fromCollectionMethod; + public Builder subscriptionGroupId(Integer subscriptionGroupId) { + this.subscriptionGroupId = OptionalNullable.of(subscriptionGroupId); return this; } /** - * Setter for toCollectionMethod. - * @param toCollectionMethod String value for toCollectionMethod. + * UnSetter for subscriptionGroupId. * @return Builder */ - public Builder toCollectionMethod(String toCollectionMethod) { - this.toCollectionMethod = toCollectionMethod; + public Builder unsetSubscriptionGroupId() { + subscriptionGroupId = null; return this; } /** - * Setter for consolidationLevel. - * @param consolidationLevel InvoiceConsolidationLevel value for consolidationLevel. + * Setter for groupPrimarySubscriptionId. + * @param groupPrimarySubscriptionId Integer value for groupPrimarySubscriptionId. * @return Builder */ - public Builder consolidationLevel(InvoiceConsolidationLevel consolidationLevel) { - this.consolidationLevel = consolidationLevel; + public Builder groupPrimarySubscriptionId(Integer groupPrimarySubscriptionId) { + this.groupPrimarySubscriptionId = OptionalNullable.of(groupPrimarySubscriptionId); return this; } /** - * Setter for fromStatus. - * @param fromStatus InvoiceStatus value for fromStatus. + * UnSetter for groupPrimarySubscriptionId. * @return Builder */ - public Builder fromStatus(InvoiceStatus fromStatus) { - this.fromStatus = fromStatus; + public Builder unsetGroupPrimarySubscriptionId() { + groupPrimarySubscriptionId = null; return this; } /** - * Setter for toStatus. - * @param toStatus InvoiceStatus value for toStatus. + * Setter for productName. + * @param productName String value for productName. * @return Builder */ - public Builder toStatus(InvoiceStatus toStatus) { - this.toStatus = toStatus; + public Builder productName(String productName) { + this.productName = productName; return this; } /** - * Setter for dueAmount. - * @param dueAmount String value for dueAmount. + * Setter for productFamilyName. + * @param productFamilyName String value for productFamilyName. * @return Builder */ - public Builder dueAmount(String dueAmount) { - this.dueAmount = dueAmount; + public Builder productFamilyName(String productFamilyName) { + this.productFamilyName = productFamilyName; return this; } /** - * Setter for totalAmount. - * @param totalAmount String value for totalAmount. + * Setter for seller. + * @param seller InvoiceSeller value for seller. * @return Builder */ - public Builder totalAmount(String totalAmount) { - this.totalAmount = totalAmount; + public Builder seller(InvoiceSeller seller) { + this.seller = seller; return this; } /** - * Setter for applyCredit. - * @param applyCredit Boolean value for applyCredit. + * Setter for customer. + * @param customer InvoiceCustomer value for customer. * @return Builder */ - public Builder applyCredit(Boolean applyCredit) { - this.applyCredit = applyCredit; + public Builder customer(InvoiceCustomer customer) { + this.customer = customer; return this; } /** - * Setter for creditNoteAttributes. - * @param creditNoteAttributes CreditNote1 value for creditNoteAttributes. + * Setter for payer. + * @param payer InvoicePayer value for payer. * @return Builder */ - public Builder creditNoteAttributes(CreditNote1 creditNoteAttributes) { - this.creditNoteAttributes = creditNoteAttributes; + public Builder payer(InvoicePayer payer) { + this.payer = payer; return this; } /** - * Setter for paymentId. - * @param paymentId Integer value for paymentId. + * Setter for recipientEmails. + * @param recipientEmails List of String value for recipientEmails. * @return Builder */ - public Builder paymentId(Integer paymentId) { - this.paymentId = paymentId; + public Builder recipientEmails(List recipientEmails) { + this.recipientEmails = recipientEmails; return this; } /** - * Setter for refundAmount. - * @param refundAmount String value for refundAmount. + * Setter for netTerms. + * @param netTerms Integer value for netTerms. * @return Builder */ - public Builder refundAmount(String refundAmount) { - this.refundAmount = refundAmount; + public Builder netTerms(Integer netTerms) { + this.netTerms = netTerms; return this; } /** - * Setter for refundId. - * @param refundId Integer value for refundId. + * Setter for billingAddress. + * @param billingAddress BillingAddress value for billingAddress. * @return Builder */ - public Builder refundId(Integer refundId) { - this.refundId = refundId; + public Builder billingAddress(BillingAddress billingAddress) { + this.billingAddress = billingAddress; return this; } /** - * Setter for isAdvanceInvoice. - * @param isAdvanceInvoice Boolean value for isAdvanceInvoice. + * Setter for shippingAddress. + * @param shippingAddress ShippingAddress value for shippingAddress. * @return Builder */ - public Builder isAdvanceInvoice(Boolean isAdvanceInvoice) { - this.isAdvanceInvoice = isAdvanceInvoice; + public Builder shippingAddress(ShippingAddress shippingAddress) { + this.shippingAddress = shippingAddress; return this; } /** - * Setter for reason. - * @param reason String value for reason. + * Setter for subtotalAmount. + * @param subtotalAmount String value for subtotalAmount. * @return Builder */ - public Builder reason(String reason) { - this.reason = reason; + public Builder subtotalAmount(String subtotalAmount) { + this.subtotalAmount = subtotalAmount; + return this; + } + + /** + * Setter for discountAmount. + * @param discountAmount String value for discountAmount. + * @return Builder + */ + public Builder discountAmount(String discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Setter for taxAmount. + * @param taxAmount String value for taxAmount. + * @return Builder + */ + public Builder taxAmount(String taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + /** + * Setter for creditAmount. + * @param creditAmount String value for creditAmount. + * @return Builder + */ + public Builder creditAmount(String creditAmount) { + this.creditAmount = creditAmount; + return this; + } + + /** + * Setter for paidAmount. + * @param paidAmount String value for paidAmount. + * @return Builder + */ + public Builder paidAmount(String paidAmount) { + this.paidAmount = paidAmount; + return this; + } + + /** + * Setter for lineItems. + * @param lineItems List of InvoiceLineItem1 value for lineItems. + * @return Builder + */ + public Builder lineItems(List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * Setter for discounts. + * @param discounts List of InvoiceDiscount value for discounts. + * @return Builder + */ + public Builder discounts(List discounts) { + this.discounts = discounts; + return this; + } + + /** + * Setter for taxes. + * @param taxes List of InvoiceTax value for taxes. + * @return Builder + */ + public Builder taxes(List taxes) { + this.taxes = taxes; + return this; + } + + /** + * Setter for credits. + * @param credits List of InvoiceCredit value for credits. + * @return Builder + */ + public Builder credits(List credits) { + this.credits = credits; + return this; + } + + /** + * Setter for refunds. + * @param refunds List of InvoiceRefund value for refunds. + * @return Builder + */ + public Builder refunds(List refunds) { + this.refunds = refunds; + return this; + } + + /** + * Setter for payments. + * @param payments List of InvoicePayment value for payments. + * @return Builder + */ + public Builder payments(List payments) { + this.payments = payments; + return this; + } + + /** + * Setter for customFields. + * @param customFields List of InvoiceCustomField value for customFields. + * @return Builder + */ + public Builder customFields(List customFields) { + this.customFields = customFields; + return this; + } + + /** + * Setter for displaySettings. + * @param displaySettings InvoiceDisplaySettings value for displaySettings. + * @return Builder + */ + public Builder displaySettings(InvoiceDisplaySettings displaySettings) { + this.displaySettings = displaySettings; + return this; + } + + /** + * Setter for publicUrl. + * @param publicUrl String value for publicUrl. + * @return Builder + */ + public Builder publicUrl(String publicUrl) { + this.publicUrl = publicUrl; + return this; + } + + /** + * Setter for previousBalanceData. + * @param previousBalanceData InvoicePreviousBalance value for previousBalanceData. + * @return Builder + */ + public Builder previousBalanceData(InvoicePreviousBalance previousBalanceData) { + this.previousBalanceData = previousBalanceData; + return this; + } + + /** + * Setter for gatewayTransId. + * @param gatewayTransId String value for gatewayTransId. + * @return Builder + */ + public Builder gatewayTransId(String gatewayTransId) { + this.gatewayTransId = gatewayTransId; + return this; + } + + /** + * Setter for amount. + * @param amount String value for amount. + * @return Builder + */ + public Builder amount(String amount) { + this.amount = amount; + return this; + } + + /** + * Setter for amountInCents. + * @param amountInCents Integer value for amountInCents. + * @return Builder + */ + public Builder amountInCents(Integer amountInCents) { + this.amountInCents = amountInCents; + return this; + } + + /** + * Setter for originCreditNoteUid. + * @param originCreditNoteUid String value for originCreditNoteUid. + * @return Builder + */ + public Builder originCreditNoteUid(String originCreditNoteUid) { + this.originCreditNoteUid = originCreditNoteUid; + return this; + } + + /** + * Setter for originCreditNoteNumber. + * @param originCreditNoteNumber String value for originCreditNoteNumber. + * @return Builder + */ + public Builder originCreditNoteNumber(String originCreditNoteNumber) { + this.originCreditNoteNumber = originCreditNoteNumber; + return this; + } + + /** + * Setter for appliedDate. + * @param appliedDate LocalDate value for appliedDate. + * @return Builder + */ + public Builder appliedDate(LocalDate appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + /** + * Setter for remainingAmount. + * @param remainingAmount String value for remainingAmount. + * @return Builder + */ + public Builder remainingAmount(String remainingAmount) { + this.remainingAmount = remainingAmount; + return this; + } + + /** + * Setter for applications. + * @param applications List of CreditNoteApplication value for applications. + * @return Builder + */ + public Builder applications(List applications) { + this.applications = applications; + return this; + } + + /** + * Setter for originInvoices. + * @param originInvoices List of OriginInvoice value for originInvoices. + * @return Builder + */ + public Builder originInvoices(List originInvoices) { + this.originInvoices = originInvoices; + return this; + } + + /** + * Setter for chargebackStatus. + * @param chargebackStatus ChargebackStatus value for chargebackStatus. + * @return Builder + */ + public Builder chargebackStatus(ChargebackStatus chargebackStatus) { + this.chargebackStatus = chargebackStatus; return this; } @@ -1421,11 +3712,21 @@ public Builder reason(String reason) { public InvoiceEventData build() { return new InvoiceEventData(uid, creditNoteNumber, creditNoteUid, originalAmount, appliedAmount, transactionTime, memo, role, consolidatedInvoice, - appliedCreditNotes, debitNoteNumber, debitNoteUid, paymentMethod, transactionId, - parentInvoiceNumber, remainingPrepaymentAmount, prepayment, external, - fromCollectionMethod, toCollectionMethod, consolidationLevel, fromStatus, + appliedCreditNotes, debitNoteNumber, debitNoteUid, consolidationLevel, + paymentMethod, transactionId, parentInvoiceNumber, remainingPrepaymentAmount, + prepayment, external, fromCollectionMethod, toCollectionMethod, fromStatus, toStatus, dueAmount, totalAmount, applyCredit, creditNoteAttributes, paymentId, - refundAmount, refundId, isAdvanceInvoice, reason); + refundAmount, refundId, isAdvanceInvoice, reason, id, siteId, customerId, + subscriptionId, number, sequenceNumber, createdAt, updatedAt, issueDate, + dueDate, paidDate, status, parentInvoiceId, collectionMethod, + paymentInstructions, currency, parentInvoiceUid, subscriptionGroupId, + groupPrimarySubscriptionId, productName, productFamilyName, seller, customer, + payer, recipientEmails, netTerms, billingAddress, shippingAddress, + subtotalAmount, discountAmount, taxAmount, creditAmount, paidAmount, lineItems, + discounts, taxes, credits, refunds, payments, customFields, displaySettings, + publicUrl, previousBalanceData, gatewayTransId, amount, amountInCents, + originCreditNoteUid, originCreditNoteNumber, appliedDate, remainingAmount, + applications, originInvoices, chargebackStatus); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java index 3ff4774f..83465c54 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java @@ -27,6 +27,8 @@ public enum InvoiceEventType { APPLY_DEBIT_NOTE, + CREATE_DEBIT_NOTE, + REFUND_INVOICE, VOID_INVOICE, @@ -55,6 +57,7 @@ public enum InvoiceEventType { CREATE_CREDIT_NOTE.value = "create_credit_note"; APPLY_PAYMENT.value = "apply_payment"; APPLY_DEBIT_NOTE.value = "apply_debit_note"; + CREATE_DEBIT_NOTE.value = "create_debit_note"; REFUND_INVOICE.value = "refund_invoice"; VOID_INVOICE.value = "void_invoice"; VOID_REMAINDER.value = "void_remainder"; @@ -70,6 +73,7 @@ public enum InvoiceEventType { valueMap.put("create_credit_note", CREATE_CREDIT_NOTE); valueMap.put("apply_payment", APPLY_PAYMENT); valueMap.put("apply_debit_note", APPLY_DEBIT_NOTE); + valueMap.put("create_debit_note", CREATE_DEBIT_NOTE); valueMap.put("refund_invoice", REFUND_INVOICE); valueMap.put("void_invoice", VOID_INVOICE); valueMap.put("void_remainder", VOID_REMAINDER); diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceLineItem1.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceLineItem1.java new file mode 100644 index 00000000..08234f1b --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceLineItem1.java @@ -0,0 +1,1235 @@ +/* + * 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 io.apimatic.core.types.OptionalNullable; +import java.time.LocalDate; + +/** + * This is a model class for InvoiceLineItem1 type. + */ +public class InvoiceLineItem1 + extends BaseModel { + private String uid; + private String title; + private String description; + private String quantity; + private String unitPrice; + private String subtotalAmount; + private String discountAmount; + private String taxAmount; + private String totalAmount; + private Boolean tieredUnitPrice; + private LocalDate periodRangeStart; + private LocalDate periodRangeEnd; + private Integer transactionId; + private OptionalNullable productId; + private OptionalNullable productVersion; + private OptionalNullable componentId; + private OptionalNullable pricePointId; + private Boolean hide; + private OptionalNullable componentCostData; + private OptionalNullable productPricePointId; + private Boolean customItem; + private String kind; + private OptionalNullable billingScheduleItemId; + + /** + * Default constructor. + */ + public InvoiceLineItem1() { + } + + /** + * Initialization constructor. + * @param uid String value for uid. + * @param title String value for title. + * @param description String value for description. + * @param quantity String value for quantity. + * @param unitPrice String value for unitPrice. + * @param subtotalAmount String value for subtotalAmount. + * @param discountAmount String value for discountAmount. + * @param taxAmount String value for taxAmount. + * @param totalAmount String value for totalAmount. + * @param tieredUnitPrice Boolean value for tieredUnitPrice. + * @param periodRangeStart LocalDate value for periodRangeStart. + * @param periodRangeEnd LocalDate value for periodRangeEnd. + * @param transactionId Integer value for transactionId. + * @param productId Integer value for productId. + * @param productVersion Integer value for productVersion. + * @param componentId Integer value for componentId. + * @param pricePointId Integer value for pricePointId. + * @param hide Boolean value for hide. + * @param componentCostData InvoiceLineItemComponentCostData value for componentCostData. + * @param productPricePointId Integer value for productPricePointId. + * @param customItem Boolean value for customItem. + * @param kind String value for kind. + * @param billingScheduleItemId Integer value for billingScheduleItemId. + */ + public InvoiceLineItem1( + String uid, + String title, + String description, + String quantity, + String unitPrice, + String subtotalAmount, + String discountAmount, + String taxAmount, + String totalAmount, + Boolean tieredUnitPrice, + LocalDate periodRangeStart, + LocalDate periodRangeEnd, + Integer transactionId, + Integer productId, + Integer productVersion, + Integer componentId, + Integer pricePointId, + Boolean hide, + InvoiceLineItemComponentCostData componentCostData, + Integer productPricePointId, + Boolean customItem, + String kind, + Integer billingScheduleItemId) { + this.uid = uid; + this.title = title; + this.description = description; + this.quantity = quantity; + this.unitPrice = unitPrice; + this.subtotalAmount = subtotalAmount; + this.discountAmount = discountAmount; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + this.tieredUnitPrice = tieredUnitPrice; + this.periodRangeStart = periodRangeStart; + this.periodRangeEnd = periodRangeEnd; + this.transactionId = transactionId; + this.productId = OptionalNullable.of(productId); + this.productVersion = OptionalNullable.of(productVersion); + this.componentId = OptionalNullable.of(componentId); + this.pricePointId = OptionalNullable.of(pricePointId); + this.hide = hide; + this.componentCostData = OptionalNullable.of(componentCostData); + this.productPricePointId = OptionalNullable.of(productPricePointId); + this.customItem = customItem; + this.kind = kind; + this.billingScheduleItemId = OptionalNullable.of(billingScheduleItemId); + } + + /** + * Initialization constructor. + * @param uid String value for uid. + * @param title String value for title. + * @param description String value for description. + * @param quantity String value for quantity. + * @param unitPrice String value for unitPrice. + * @param subtotalAmount String value for subtotalAmount. + * @param discountAmount String value for discountAmount. + * @param taxAmount String value for taxAmount. + * @param totalAmount String value for totalAmount. + * @param tieredUnitPrice Boolean value for tieredUnitPrice. + * @param periodRangeStart LocalDate value for periodRangeStart. + * @param periodRangeEnd LocalDate value for periodRangeEnd. + * @param transactionId Integer value for transactionId. + * @param productId Integer value for productId. + * @param productVersion Integer value for productVersion. + * @param componentId Integer value for componentId. + * @param pricePointId Integer value for pricePointId. + * @param hide Boolean value for hide. + * @param componentCostData InvoiceLineItemComponentCostData value for componentCostData. + * @param productPricePointId Integer value for productPricePointId. + * @param customItem Boolean value for customItem. + * @param kind String value for kind. + * @param billingScheduleItemId Integer value for billingScheduleItemId. + */ + + protected InvoiceLineItem1(String uid, String title, String description, String quantity, + String unitPrice, String subtotalAmount, String discountAmount, String taxAmount, + String totalAmount, Boolean tieredUnitPrice, LocalDate periodRangeStart, + LocalDate periodRangeEnd, Integer transactionId, OptionalNullable productId, + OptionalNullable productVersion, OptionalNullable componentId, + OptionalNullable pricePointId, Boolean hide, + OptionalNullable componentCostData, + OptionalNullable productPricePointId, Boolean customItem, String kind, + OptionalNullable billingScheduleItemId) { + this.uid = uid; + this.title = title; + this.description = description; + this.quantity = quantity; + this.unitPrice = unitPrice; + this.subtotalAmount = subtotalAmount; + this.discountAmount = discountAmount; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + this.tieredUnitPrice = tieredUnitPrice; + this.periodRangeStart = periodRangeStart; + this.periodRangeEnd = periodRangeEnd; + this.transactionId = transactionId; + this.productId = productId; + this.productVersion = productVersion; + this.componentId = componentId; + this.pricePointId = pricePointId; + this.hide = hide; + this.componentCostData = componentCostData; + this.productPricePointId = productPricePointId; + this.customItem = customItem; + this.kind = kind; + this.billingScheduleItemId = billingScheduleItemId; + } + + /** + * Getter for Uid. + * Unique identifier for the line item. Useful when cross-referencing the line against + * individual discounts in the `discounts` or `taxes` lists. + * @return Returns the String + */ + @JsonGetter("uid") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUid() { + return uid; + } + + /** + * Setter for Uid. + * Unique identifier for the line item. Useful when cross-referencing the line against + * individual discounts in the `discounts` or `taxes` lists. + * @param uid Value for String + */ + @JsonSetter("uid") + public void setUid(String uid) { + this.uid = uid; + } + + /** + * Getter for Title. + * A short descriptor for the charge or item represented by this line. + * @return Returns the String + */ + @JsonGetter("title") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTitle() { + return title; + } + + /** + * Setter for Title. + * A short descriptor for the charge or item represented by this line. + * @param title Value for String + */ + @JsonSetter("title") + public void setTitle(String title) { + this.title = title; + } + + /** + * Getter for Description. + * 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. + * @return Returns the String + */ + @JsonGetter("description") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDescription() { + return description; + } + + /** + * Setter for Description. + * 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. + * @param description Value for String + */ + @JsonSetter("description") + public void setDescription(String description) { + this.description = description; + } + + /** + * Getter for Quantity. + * The quantity or count of units billed by the line item. This is a decimal number represented + * as a string. (See "About Decimal Numbers".) + * @return Returns the String + */ + @JsonGetter("quantity") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getQuantity() { + return quantity; + } + + /** + * Setter for Quantity. + * The quantity or count of units billed by the line item. This is a decimal number represented + * as a string. (See "About Decimal Numbers".) + * @param quantity Value for String + */ + @JsonSetter("quantity") + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + /** + * Getter for UnitPrice. + * 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 + */ + @JsonGetter("unit_price") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getUnitPrice() { + return unitPrice; + } + + /** + * Setter for UnitPrice. + * 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 + */ + @JsonSetter("unit_price") + public void setUnitPrice(String unitPrice) { + this.unitPrice = unitPrice; + } + + /** + * Getter for SubtotalAmount. + * 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). + * @return Returns the String + */ + @JsonGetter("subtotal_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getSubtotalAmount() { + return subtotalAmount; + } + + /** + * Setter for SubtotalAmount. + * 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). + * @param subtotalAmount Value for String + */ + @JsonSetter("subtotal_amount") + public void setSubtotalAmount(String subtotalAmount) { + this.subtotalAmount = subtotalAmount; + } + + /** + * Getter for DiscountAmount. + * 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. + * @return Returns the String + */ + @JsonGetter("discount_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getDiscountAmount() { + return discountAmount; + } + + /** + * Setter for DiscountAmount. + * 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. + * @param discountAmount Value for String + */ + @JsonSetter("discount_amount") + public void setDiscountAmount(String discountAmount) { + this.discountAmount = discountAmount; + } + + /** + * Getter for TaxAmount. + * 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. + * @return Returns the String + */ + @JsonGetter("tax_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTaxAmount() { + return taxAmount; + } + + /** + * Setter for TaxAmount. + * 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. + * @param taxAmount Value for String + */ + @JsonSetter("tax_amount") + public void setTaxAmount(String taxAmount) { + this.taxAmount = taxAmount; + } + + /** + * Getter for TotalAmount. + * 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`. + * @return Returns the String + */ + @JsonGetter("total_amount") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTotalAmount() { + return totalAmount; + } + + /** + * Setter for TotalAmount. + * 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`. + * @param totalAmount Value for String + */ + @JsonSetter("total_amount") + public void setTotalAmount(String totalAmount) { + this.totalAmount = totalAmount; + } + + /** + * Getter for TieredUnitPrice. + * 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. + * @return Returns the Boolean + */ + @JsonGetter("tiered_unit_price") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getTieredUnitPrice() { + return tieredUnitPrice; + } + + /** + * Setter for TieredUnitPrice. + * 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. + * @param tieredUnitPrice Value for Boolean + */ + @JsonSetter("tiered_unit_price") + public void setTieredUnitPrice(Boolean tieredUnitPrice) { + this.tieredUnitPrice = 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 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 + */ + @JsonGetter("period_range_start") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.SimpleDateSerializer.class) + public LocalDate getPeriodRangeStart() { + return periodRangeStart; + } + + /** + * 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 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 + */ + @JsonSetter("period_range_start") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setPeriodRangeStart(LocalDate periodRangeStart) { + this.periodRangeStart = 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 + * billing date. * For non-periodic charges, this date and the start date will match. + * @return Returns the LocalDate + */ + @JsonGetter("period_range_end") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = DateTimeHelper.SimpleDateSerializer.class) + public LocalDate getPeriodRangeEnd() { + return periodRangeEnd; + } + + /** + * 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 + * billing date. * For non-periodic charges, this date and the start date will match. + * @param periodRangeEnd Value for LocalDate + */ + @JsonSetter("period_range_end") + @JsonDeserialize(using = DateTimeHelper.SimpleDateDeserializer.class) + public void setPeriodRangeEnd(LocalDate periodRangeEnd) { + this.periodRangeEnd = periodRangeEnd; + } + + /** + * Getter for TransactionId. + * @return Returns the Integer + */ + @JsonGetter("transaction_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTransactionId() { + return transactionId; + } + + /** + * Setter for TransactionId. + * @param transactionId Value for Integer + */ + @JsonSetter("transaction_id") + public void setTransactionId(Integer transactionId) { + this.transactionId = transactionId; + } + + /** + * Internal Getter for ProductId. + * 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`. + * @return Returns the Internal Integer + */ + @JsonGetter("product_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetProductId() { + return this.productId; + } + + /** + * Getter for ProductId. + * 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`. + * @return Returns the Integer + */ + public Integer getProductId() { + return OptionalNullable.getFrom(productId); + } + + /** + * Setter for ProductId. + * 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`. + * @param productId Value for Integer + */ + @JsonSetter("product_id") + public void setProductId(Integer productId) { + this.productId = OptionalNullable.of(productId); + } + + /** + * UnSetter for ProductId. + * 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`. + */ + public void unsetProductId() { + productId = null; + } + + /** + * Internal Getter for ProductVersion. + * The version of the product subscribed when the charge was made. + * @return Returns the Internal Integer + */ + @JsonGetter("product_version") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetProductVersion() { + return this.productVersion; + } + + /** + * Getter for ProductVersion. + * The version of the product subscribed when the charge was made. + * @return Returns the Integer + */ + public Integer getProductVersion() { + return OptionalNullable.getFrom(productVersion); + } + + /** + * Setter for ProductVersion. + * The version of the product subscribed when the charge was made. + * @param productVersion Value for Integer + */ + @JsonSetter("product_version") + public void setProductVersion(Integer productVersion) { + this.productVersion = OptionalNullable.of(productVersion); + } + + /** + * UnSetter for ProductVersion. + * The version of the product subscribed when the charge was made. + */ + public void unsetProductVersion() { + productVersion = null; + } + + /** + * Internal Getter for ComponentId. + * The ID of the component being billed. Will be `nil` for non-component charges. + * @return Returns the Internal Integer + */ + @JsonGetter("component_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetComponentId() { + return this.componentId; + } + + /** + * Getter for ComponentId. + * The ID of the component being billed. Will be `nil` for non-component charges. + * @return Returns the Integer + */ + public Integer getComponentId() { + return OptionalNullable.getFrom(componentId); + } + + /** + * Setter for ComponentId. + * The ID of the component being billed. Will be `nil` for non-component charges. + * @param componentId Value for Integer + */ + @JsonSetter("component_id") + public void setComponentId(Integer componentId) { + this.componentId = OptionalNullable.of(componentId); + } + + /** + * UnSetter for ComponentId. + * The ID of the component being billed. Will be `nil` for non-component charges. + */ + public void unsetComponentId() { + componentId = null; + } + + /** + * Internal Getter for PricePointId. + * The price point ID of the component being billed. Will be `nil` for non-component charges. + * @return Returns the Internal Integer + */ + @JsonGetter("price_point_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetPricePointId() { + return this.pricePointId; + } + + /** + * Getter for PricePointId. + * The price point ID of the component being billed. Will be `nil` for non-component charges. + * @return Returns the Integer + */ + public Integer getPricePointId() { + return OptionalNullable.getFrom(pricePointId); + } + + /** + * Setter for PricePointId. + * The price point ID of the component being billed. Will be `nil` for non-component charges. + * @param pricePointId Value for Integer + */ + @JsonSetter("price_point_id") + public void setPricePointId(Integer pricePointId) { + this.pricePointId = OptionalNullable.of(pricePointId); + } + + /** + * UnSetter for PricePointId. + * The price point ID of the component being billed. Will be `nil` for non-component charges. + */ + public void unsetPricePointId() { + pricePointId = null; + } + + /** + * Getter for Hide. + * @return Returns the Boolean + */ + @JsonGetter("hide") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getHide() { + return hide; + } + + /** + * Setter for Hide. + * @param hide Value for Boolean + */ + @JsonSetter("hide") + public void setHide(Boolean hide) { + this.hide = hide; + } + + /** + * Internal Getter for ComponentCostData. + * @return Returns the Internal InvoiceLineItemComponentCostData + */ + @JsonGetter("component_cost_data") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetComponentCostData() { + return this.componentCostData; + } + + /** + * Getter for ComponentCostData. + * @return Returns the InvoiceLineItemComponentCostData + */ + public InvoiceLineItemComponentCostData getComponentCostData() { + return OptionalNullable.getFrom(componentCostData); + } + + /** + * Setter for ComponentCostData. + * @param componentCostData Value for InvoiceLineItemComponentCostData + */ + @JsonSetter("component_cost_data") + public void setComponentCostData(InvoiceLineItemComponentCostData componentCostData) { + this.componentCostData = OptionalNullable.of(componentCostData); + } + + /** + * UnSetter for ComponentCostData. + */ + public void unsetComponentCostData() { + componentCostData = null; + } + + /** + * Internal Getter for ProductPricePointId. + * The price point ID of the line item's product + * @return Returns the Internal Integer + */ + @JsonGetter("product_price_point_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetProductPricePointId() { + return this.productPricePointId; + } + + /** + * Getter for ProductPricePointId. + * The price point ID of the line item's product + * @return Returns the Integer + */ + public Integer getProductPricePointId() { + return OptionalNullable.getFrom(productPricePointId); + } + + /** + * Setter for ProductPricePointId. + * The price point ID of the line item's product + * @param productPricePointId Value for Integer + */ + @JsonSetter("product_price_point_id") + public void setProductPricePointId(Integer productPricePointId) { + this.productPricePointId = OptionalNullable.of(productPricePointId); + } + + /** + * UnSetter for ProductPricePointId. + * The price point ID of the line item's product + */ + public void unsetProductPricePointId() { + productPricePointId = null; + } + + /** + * Getter for CustomItem. + * @return Returns the Boolean + */ + @JsonGetter("custom_item") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getCustomItem() { + return customItem; + } + + /** + * Setter for CustomItem. + * @param customItem Value for Boolean + */ + @JsonSetter("custom_item") + public void setCustomItem(Boolean customItem) { + this.customItem = customItem; + } + + /** + * Getter for Kind. + * @return Returns the String + */ + @JsonGetter("kind") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getKind() { + return kind; + } + + /** + * Setter for Kind. + * @param kind Value for String + */ + @JsonSetter("kind") + public void setKind(String kind) { + this.kind = kind; + } + + /** + * Internal Getter for BillingScheduleItemId. + * @return Returns the Internal Integer + */ + @JsonGetter("billing_schedule_item_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetBillingScheduleItemId() { + return this.billingScheduleItemId; + } + + /** + * Getter for BillingScheduleItemId. + * @return Returns the Integer + */ + public Integer getBillingScheduleItemId() { + return OptionalNullable.getFrom(billingScheduleItemId); + } + + /** + * Setter for BillingScheduleItemId. + * @param billingScheduleItemId Value for Integer + */ + @JsonSetter("billing_schedule_item_id") + public void setBillingScheduleItemId(Integer billingScheduleItemId) { + this.billingScheduleItemId = OptionalNullable.of(billingScheduleItemId); + } + + /** + * UnSetter for BillingScheduleItemId. + */ + public void unsetBillingScheduleItemId() { + billingScheduleItemId = null; + } + + /** + * Converts this InvoiceLineItem1 into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "InvoiceLineItem1 [" + "uid=" + uid + ", title=" + title + ", description=" + + description + ", quantity=" + quantity + ", unitPrice=" + unitPrice + + ", subtotalAmount=" + subtotalAmount + ", discountAmount=" + discountAmount + + ", taxAmount=" + taxAmount + ", totalAmount=" + totalAmount + ", tieredUnitPrice=" + + tieredUnitPrice + ", periodRangeStart=" + periodRangeStart + ", periodRangeEnd=" + + periodRangeEnd + ", transactionId=" + transactionId + ", productId=" + productId + + ", productVersion=" + productVersion + ", componentId=" + componentId + + ", pricePointId=" + pricePointId + ", hide=" + hide + ", componentCostData=" + + componentCostData + ", productPricePointId=" + productPricePointId + + ", customItem=" + customItem + ", kind=" + kind + ", billingScheduleItemId=" + + billingScheduleItemId + ", additionalProperties=" + getAdditionalProperties() + + "]"; + } + + /** + * Builds a new {@link InvoiceLineItem1.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link InvoiceLineItem1.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .uid(getUid()) + .title(getTitle()) + .description(getDescription()) + .quantity(getQuantity()) + .unitPrice(getUnitPrice()) + .subtotalAmount(getSubtotalAmount()) + .discountAmount(getDiscountAmount()) + .taxAmount(getTaxAmount()) + .totalAmount(getTotalAmount()) + .tieredUnitPrice(getTieredUnitPrice()) + .periodRangeStart(getPeriodRangeStart()) + .periodRangeEnd(getPeriodRangeEnd()) + .transactionId(getTransactionId()) + .hide(getHide()) + .customItem(getCustomItem()) + .kind(getKind()); + builder.productId = internalGetProductId(); + builder.productVersion = internalGetProductVersion(); + builder.componentId = internalGetComponentId(); + builder.pricePointId = internalGetPricePointId(); + builder.componentCostData = internalGetComponentCostData(); + builder.productPricePointId = internalGetProductPricePointId(); + builder.billingScheduleItemId = internalGetBillingScheduleItemId(); + return builder; + } + + /** + * Class to build instances of {@link InvoiceLineItem1}. + */ + public static class Builder { + private String uid; + private String title; + private String description; + private String quantity; + private String unitPrice; + private String subtotalAmount; + private String discountAmount; + private String taxAmount; + private String totalAmount; + private Boolean tieredUnitPrice; + private LocalDate periodRangeStart; + private LocalDate periodRangeEnd; + private Integer transactionId; + private OptionalNullable productId; + private OptionalNullable productVersion; + private OptionalNullable componentId; + private OptionalNullable pricePointId; + private Boolean hide; + private OptionalNullable componentCostData; + private OptionalNullable productPricePointId; + private Boolean customItem; + private String kind; + private OptionalNullable billingScheduleItemId; + + + + /** + * Setter for uid. + * @param uid String value for uid. + * @return Builder + */ + public Builder uid(String uid) { + this.uid = uid; + return this; + } + + /** + * Setter for title. + * @param title String value for title. + * @return Builder + */ + public Builder title(String title) { + this.title = title; + 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 quantity. + * @param quantity String value for quantity. + * @return Builder + */ + public Builder quantity(String quantity) { + this.quantity = quantity; + return this; + } + + /** + * Setter for unitPrice. + * @param unitPrice String value for unitPrice. + * @return Builder + */ + public Builder unitPrice(String unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + /** + * Setter for subtotalAmount. + * @param subtotalAmount String value for subtotalAmount. + * @return Builder + */ + public Builder subtotalAmount(String subtotalAmount) { + this.subtotalAmount = subtotalAmount; + return this; + } + + /** + * Setter for discountAmount. + * @param discountAmount String value for discountAmount. + * @return Builder + */ + public Builder discountAmount(String discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Setter for taxAmount. + * @param taxAmount String value for taxAmount. + * @return Builder + */ + public Builder taxAmount(String taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + /** + * Setter for totalAmount. + * @param totalAmount String value for totalAmount. + * @return Builder + */ + public Builder totalAmount(String totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + /** + * Setter for tieredUnitPrice. + * @param tieredUnitPrice Boolean value for tieredUnitPrice. + * @return Builder + */ + public Builder tieredUnitPrice(Boolean tieredUnitPrice) { + this.tieredUnitPrice = tieredUnitPrice; + return this; + } + + /** + * Setter for periodRangeStart. + * @param periodRangeStart LocalDate value for periodRangeStart. + * @return Builder + */ + public Builder periodRangeStart(LocalDate periodRangeStart) { + this.periodRangeStart = periodRangeStart; + return this; + } + + /** + * Setter for periodRangeEnd. + * @param periodRangeEnd LocalDate value for periodRangeEnd. + * @return Builder + */ + public Builder periodRangeEnd(LocalDate periodRangeEnd) { + this.periodRangeEnd = periodRangeEnd; + return this; + } + + /** + * Setter for transactionId. + * @param transactionId Integer value for transactionId. + * @return Builder + */ + public Builder transactionId(Integer transactionId) { + this.transactionId = transactionId; + return this; + } + + /** + * Setter for productId. + * @param productId Integer value for productId. + * @return Builder + */ + public Builder productId(Integer productId) { + this.productId = OptionalNullable.of(productId); + return this; + } + + /** + * UnSetter for productId. + * @return Builder + */ + public Builder unsetProductId() { + productId = null; + return this; + } + + /** + * Setter for productVersion. + * @param productVersion Integer value for productVersion. + * @return Builder + */ + public Builder productVersion(Integer productVersion) { + this.productVersion = OptionalNullable.of(productVersion); + return this; + } + + /** + * UnSetter for productVersion. + * @return Builder + */ + public Builder unsetProductVersion() { + productVersion = null; + return this; + } + + /** + * Setter for componentId. + * @param componentId Integer value for componentId. + * @return Builder + */ + public Builder componentId(Integer componentId) { + this.componentId = OptionalNullable.of(componentId); + return this; + } + + /** + * UnSetter for componentId. + * @return Builder + */ + public Builder unsetComponentId() { + componentId = null; + return this; + } + + /** + * Setter for pricePointId. + * @param pricePointId Integer value for pricePointId. + * @return Builder + */ + public Builder pricePointId(Integer pricePointId) { + this.pricePointId = OptionalNullable.of(pricePointId); + return this; + } + + /** + * UnSetter for pricePointId. + * @return Builder + */ + public Builder unsetPricePointId() { + pricePointId = null; + return this; + } + + /** + * Setter for hide. + * @param hide Boolean value for hide. + * @return Builder + */ + public Builder hide(Boolean hide) { + this.hide = hide; + return this; + } + + /** + * Setter for componentCostData. + * @param componentCostData InvoiceLineItemComponentCostData value for componentCostData. + * @return Builder + */ + public Builder componentCostData(InvoiceLineItemComponentCostData componentCostData) { + this.componentCostData = OptionalNullable.of(componentCostData); + return this; + } + + /** + * UnSetter for componentCostData. + * @return Builder + */ + public Builder unsetComponentCostData() { + componentCostData = null; + return this; + } + + /** + * Setter for productPricePointId. + * @param productPricePointId Integer value for productPricePointId. + * @return Builder + */ + public Builder productPricePointId(Integer productPricePointId) { + this.productPricePointId = OptionalNullable.of(productPricePointId); + return this; + } + + /** + * UnSetter for productPricePointId. + * @return Builder + */ + public Builder unsetProductPricePointId() { + productPricePointId = null; + return this; + } + + /** + * Setter for customItem. + * @param customItem Boolean value for customItem. + * @return Builder + */ + public Builder customItem(Boolean customItem) { + this.customItem = customItem; + return this; + } + + /** + * Setter for kind. + * @param kind String value for kind. + * @return Builder + */ + public Builder kind(String kind) { + this.kind = kind; + return this; + } + + /** + * Setter for billingScheduleItemId. + * @param billingScheduleItemId Integer value for billingScheduleItemId. + * @return Builder + */ + public Builder billingScheduleItemId(Integer billingScheduleItemId) { + this.billingScheduleItemId = OptionalNullable.of(billingScheduleItemId); + return this; + } + + /** + * UnSetter for billingScheduleItemId. + * @return Builder + */ + public Builder unsetBillingScheduleItemId() { + billingScheduleItemId = null; + return this; + } + + /** + * Builds a new {@link InvoiceLineItem1} object using the set fields. + * @return {@link InvoiceLineItem1} + */ + public InvoiceLineItem1 build() { + return new InvoiceLineItem1(uid, title, description, quantity, unitPrice, + subtotalAmount, discountAmount, taxAmount, totalAmount, tieredUnitPrice, + periodRangeStart, periodRangeEnd, transactionId, productId, productVersion, + componentId, pricePointId, hide, componentCostData, productPricePointId, + customItem, kind, billingScheduleItemId); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceRole1.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceRole1.java new file mode 100644 index 00000000..89822c22 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceRole1.java @@ -0,0 +1,124 @@ +/* + * 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; + + +/** + * InvoiceRole1 to be used. + */ +public enum InvoiceRole1 { + UNSET, + + SIGNUP, + + RENEWAL, + + USAGE, + + REACTIVATION, + + PRORATION, + + MIGRATION, + + ADHOC, + + BACKPORT, + + BACKPORTBALANCERECONCILIATION; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + UNSET.value = "unset"; + SIGNUP.value = "signup"; + RENEWAL.value = "renewal"; + USAGE.value = "usage"; + REACTIVATION.value = "reactivation"; + PRORATION.value = "proration"; + MIGRATION.value = "migration"; + ADHOC.value = "adhoc"; + BACKPORT.value = "backport"; + BACKPORTBALANCERECONCILIATION.value = "backport-balance-reconciliation"; + + valueMap.put("unset", UNSET); + valueMap.put("signup", SIGNUP); + valueMap.put("renewal", RENEWAL); + valueMap.put("usage", USAGE); + valueMap.put("reactivation", REACTIVATION); + valueMap.put("proration", PRORATION); + valueMap.put("migration", MIGRATION); + valueMap.put("adhoc", ADHOC); + valueMap.put("backport", BACKPORT); + valueMap.put("backport-balance-reconciliation", BACKPORTBALANCERECONCILIATION); + } + + /** + * 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 InvoiceRole1 constructFromString(String toConvert) throws IOException { + InvoiceRole1 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 InvoiceRole1 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 InvoiceRole1 values to list of string values. + * @param toConvert The list of InvoiceRole1 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 (InvoiceRole1 enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/IssueInvoiceEventData.java b/src/main/java/com/maxio/advancedbilling/models/IssueInvoiceEventData.java index e124322e..55627721 100644 --- a/src/main/java/com/maxio/advancedbilling/models/IssueInvoiceEventData.java +++ b/src/main/java/com/maxio/advancedbilling/models/IssueInvoiceEventData.java @@ -85,8 +85,8 @@ public void setConsolidationLevel(InvoiceConsolidationLevel consolidationLevel) /** * Getter for FromStatus. - * The status of the invoice before event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * The status of the invoice before event occurrence. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statusess) * for more. * @return Returns the InvoiceStatus */ @@ -97,8 +97,8 @@ public InvoiceStatus getFromStatus() { /** * Setter for FromStatus. - * The status of the invoice before event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * The status of the invoice before event occurrence. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statusess) * for more. * @param fromStatus Value for InvoiceStatus */ @@ -109,8 +109,8 @@ public void setFromStatus(InvoiceStatus fromStatus) { /** * Getter for ToStatus. - * The status of the invoice after event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * The status of the invoice after event occurrence. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statusess) * for more. * @return Returns the InvoiceStatus */ @@ -121,8 +121,8 @@ public InvoiceStatus getToStatus() { /** * Setter for ToStatus. - * The status of the invoice after event occurence. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * The status of the invoice after event occurrence. See [Invoice + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statusess) * for more. * @param toStatus Value for InvoiceStatus */ diff --git a/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java index 333e3a81..b9f49972 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListEventsInput.java @@ -17,8 +17,8 @@ public class ListEventsInput { private Integer page; private Integer perPage; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private Direction direction; private List filter; private ListEventsDateField dateField; @@ -40,8 +40,8 @@ public ListEventsInput() { * Initialization constructor. * @param page Integer value for page. * @param perPage Integer value for perPage. - * @param sinceId Integer value for sinceId. - * @param maxId Integer value for maxId. + * @param sinceId Long value for sinceId. + * @param maxId Long value for maxId. * @param direction Direction value for direction. * @param filter List of EventType value for filter. * @param dateField ListEventsDateField value for dateField. @@ -53,8 +53,8 @@ public ListEventsInput() { public ListEventsInput( Integer page, Integer perPage, - Integer sinceId, - Integer maxId, + Long sinceId, + Long maxId, Direction direction, List filter, ListEventsDateField dateField, @@ -132,42 +132,42 @@ public void setPerPage(Integer perPage) { /** * Getter for SinceId. * Returns events with an id greater than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("since_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getSinceId() { + public Long getSinceId() { return sinceId; } /** * Setter for SinceId. * Returns events with an id greater than or equal to the one specified - * @param sinceId Value for Integer + * @param sinceId Value for Long */ @JsonSetter("since_id") - public void setSinceId(Integer sinceId) { + public void setSinceId(Long sinceId) { this.sinceId = sinceId; } /** * Getter for MaxId. * Returns events with an id less than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("max_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getMaxId() { + public Long getMaxId() { return maxId; } /** * Setter for MaxId. * Returns events with an id less than or equal to the one specified - * @param maxId Value for Integer + * @param maxId Value for Long */ @JsonSetter("max_id") - public void setMaxId(Integer maxId) { + public void setMaxId(Long maxId) { this.maxId = maxId; } @@ -377,8 +377,8 @@ public Builder toBuilder() { public static class Builder { private Integer page = 1; private Integer perPage = 20; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private Direction direction = Direction.DESC; private List filter; private ListEventsDateField dateField; @@ -411,20 +411,20 @@ public Builder perPage(Integer perPage) { /** * Setter for sinceId. - * @param sinceId Integer value for sinceId. + * @param sinceId Long value for sinceId. * @return Builder */ - public Builder sinceId(Integer sinceId) { + public Builder sinceId(Long sinceId) { this.sinceId = sinceId; return this; } /** * Setter for maxId. - * @param maxId Integer value for maxId. + * @param maxId Long value for maxId. * @return Builder */ - public Builder maxId(Integer maxId) { + public Builder maxId(Long maxId) { this.maxId = maxId; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListInvoiceEventsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListInvoiceEventsInput.java index ccfac808..e6227903 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListInvoiceEventsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListInvoiceEventsInput.java @@ -16,7 +16,7 @@ */ public class ListInvoiceEventsInput { private String sinceDate; - private Integer sinceId; + private Long sinceId; private Integer page; private Integer perPage; private String invoiceUid; @@ -34,7 +34,7 @@ public ListInvoiceEventsInput() { /** * Initialization constructor. * @param sinceDate String value for sinceDate. - * @param sinceId Integer value for sinceId. + * @param sinceId Long value for sinceId. * @param page Integer value for page. * @param perPage Integer value for perPage. * @param invoiceUid String value for invoiceUid. @@ -43,7 +43,7 @@ public ListInvoiceEventsInput() { */ public ListInvoiceEventsInput( String sinceDate, - Integer sinceId, + Long sinceId, Integer page, Integer perPage, String invoiceUid, @@ -88,11 +88,11 @@ public void setSinceDate(String sinceDate) { * The ID of the event from which you want to start the search(ID is not included. e.g. if ID is * set to 2, then all events with ID 3 and more will be shown) This parameter is not used if * since_date is defined. - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("since_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getSinceId() { + public Long getSinceId() { return sinceId; } @@ -101,10 +101,10 @@ public Integer getSinceId() { * The ID of the event from which you want to start the search(ID is not included. e.g. if ID is * set to 2, then all events with ID 3 and more will be shown) This parameter is not used if * since_date is defined. - * @param sinceId Value for Integer + * @param sinceId Value for Long */ @JsonSetter("since_id") - public void setSinceId(Integer sinceId) { + public void setSinceId(Long sinceId) { this.sinceId = sinceId; } @@ -261,7 +261,7 @@ public Builder toBuilder() { */ public static class Builder { private String sinceDate; - private Integer sinceId; + private Long sinceId; private Integer page = 1; private Integer perPage = 100; private String invoiceUid; @@ -282,10 +282,10 @@ public Builder sinceDate(String sinceDate) { /** * Setter for sinceId. - * @param sinceId Integer value for sinceId. + * @param sinceId Long value for sinceId. * @return Builder */ - public Builder sinceId(Integer sinceId) { + public Builder sinceId(Long sinceId) { this.sinceId = sinceId; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInput.java index 1bb7a3b1..7d166b22 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionComponentsInput.java @@ -27,6 +27,7 @@ public class ListSubscriptionComponentsInput { private String startDate; private String startDatetime; private List include; + private Boolean inUse; /** * Default constructor. @@ -48,6 +49,7 @@ public ListSubscriptionComponentsInput() { * @param startDate String value for startDate. * @param startDatetime String value for startDatetime. * @param include List of ListSubscriptionComponentsInclude value for include. + * @param inUse Boolean value for inUse. */ public ListSubscriptionComponentsInput( int subscriptionId, @@ -61,7 +63,8 @@ public ListSubscriptionComponentsInput( ListSubscriptionComponentsSort sort, String startDate, String startDatetime, - List include) { + List include, + Boolean inUse) { this.subscriptionId = subscriptionId; this.dateField = dateField; this.direction = direction; @@ -74,6 +77,7 @@ public ListSubscriptionComponentsInput( this.startDate = startDate; this.startDatetime = startDatetime; this.include = include; + this.inUse = inUse; } /** @@ -351,6 +355,29 @@ public void setInclude(List include) { this.include = include; } + /** + * Getter for InUse. + * If in_use is set to true, it returns only components that are currently in use. However, if + * it's set to false or not provided, it returns all components connected with the subscription. + * @return Returns the Boolean + */ + @JsonGetter("in_use") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Boolean getInUse() { + return inUse; + } + + /** + * Setter for InUse. + * If in_use is set to true, it returns only components that are currently in use. However, if + * it's set to false or not provided, it returns all components connected with the subscription. + * @param inUse Value for Boolean + */ + @JsonSetter("in_use") + public void setInUse(Boolean inUse) { + this.inUse = inUse; + } + /** * Converts this ListSubscriptionComponentsInput into string format. * @return String representation of this class @@ -362,7 +389,7 @@ public String toString() { + ", endDate=" + endDate + ", endDatetime=" + endDatetime + ", pricePointIds=" + pricePointIds + ", productFamilyIds=" + productFamilyIds + ", sort=" + sort + ", startDate=" + startDate + ", startDatetime=" + startDatetime + ", include=" - + include + "]"; + + include + ", inUse=" + inUse + "]"; } /** @@ -382,7 +409,8 @@ public Builder toBuilder() { .sort(getSort()) .startDate(getStartDate()) .startDatetime(getStartDatetime()) - .include(getInclude()); + .include(getInclude()) + .inUse(getInUse()); return builder; } @@ -402,6 +430,7 @@ public static class Builder { private String startDate; private String startDatetime; private List include; + private Boolean inUse; /** * Initialization constructor. @@ -537,6 +566,16 @@ public Builder include(List include) { return this; } + /** + * Setter for inUse. + * @param inUse Boolean value for inUse. + * @return Builder + */ + public Builder inUse(Boolean inUse) { + this.inUse = inUse; + return this; + } + /** * Builds a new {@link ListSubscriptionComponentsInput} object using the set fields. * @return {@link ListSubscriptionComponentsInput} @@ -544,7 +583,7 @@ public Builder include(List include) { public ListSubscriptionComponentsInput build() { return new ListSubscriptionComponentsInput(subscriptionId, dateField, direction, filter, endDate, endDatetime, pricePointIds, productFamilyIds, sort, startDate, - startDatetime, include); + startDatetime, include, inUse); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java index 8b679754..27d09806 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubscriptionEventsInput.java @@ -18,8 +18,8 @@ public class ListSubscriptionEventsInput { private int subscriptionId; private Integer page; private Integer perPage; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private Direction direction; private List filter; @@ -37,8 +37,8 @@ public ListSubscriptionEventsInput() { * @param subscriptionId int value for subscriptionId. * @param page Integer value for page. * @param perPage Integer value for perPage. - * @param sinceId Integer value for sinceId. - * @param maxId Integer value for maxId. + * @param sinceId Long value for sinceId. + * @param maxId Long value for maxId. * @param direction Direction value for direction. * @param filter List of EventType value for filter. */ @@ -46,8 +46,8 @@ public ListSubscriptionEventsInput( int subscriptionId, Integer page, Integer perPage, - Integer sinceId, - Integer maxId, + Long sinceId, + Long maxId, Direction direction, List filter) { this.subscriptionId = subscriptionId; @@ -136,42 +136,42 @@ public void setPerPage(Integer perPage) { /** * Getter for SinceId. * Returns events with an id greater than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("since_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getSinceId() { + public Long getSinceId() { return sinceId; } /** * Setter for SinceId. * Returns events with an id greater than or equal to the one specified - * @param sinceId Value for Integer + * @param sinceId Value for Long */ @JsonSetter("since_id") - public void setSinceId(Integer sinceId) { + public void setSinceId(Long sinceId) { this.sinceId = sinceId; } /** * Getter for MaxId. * Returns events with an id less than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("max_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getMaxId() { + public Long getMaxId() { return maxId; } /** * Setter for MaxId. * Returns events with an id less than or equal to the one specified - * @param maxId Value for Integer + * @param maxId Value for Long */ @JsonSetter("max_id") - public void setMaxId(Integer maxId) { + public void setMaxId(Long maxId) { this.maxId = maxId; } @@ -253,8 +253,8 @@ public static class Builder { private int subscriptionId; private Integer page = 1; private Integer perPage = 20; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private Direction direction = Direction.DESC; private List filter; @@ -304,20 +304,20 @@ public Builder perPage(Integer perPage) { /** * Setter for sinceId. - * @param sinceId Integer value for sinceId. + * @param sinceId Long value for sinceId. * @return Builder */ - public Builder sinceId(Integer sinceId) { + public Builder sinceId(Long sinceId) { this.sinceId = sinceId; return this; } /** * Setter for maxId. - * @param maxId Integer value for maxId. + * @param maxId Long value for maxId. * @return Builder */ - public Builder maxId(Integer maxId) { + public Builder maxId(Long maxId) { this.maxId = maxId; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java b/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java index 05f6c420..74701d75 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListUsagesInput.java @@ -21,8 +21,8 @@ public class ListUsagesInput { private int subscriptionId; private ListUsagesInputComponentId componentId; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private LocalDate sinceDate; private LocalDate untilDate; private Integer page; @@ -40,8 +40,8 @@ public ListUsagesInput() { * Initialization constructor. * @param subscriptionId int value for subscriptionId. * @param componentId ListUsagesInputComponentId value for componentId. - * @param sinceId Integer value for sinceId. - * @param maxId Integer value for maxId. + * @param sinceId Long value for sinceId. + * @param maxId Long value for maxId. * @param sinceDate LocalDate value for sinceDate. * @param untilDate LocalDate value for untilDate. * @param page Integer value for page. @@ -50,8 +50,8 @@ public ListUsagesInput() { public ListUsagesInput( int subscriptionId, ListUsagesInputComponentId componentId, - Integer sinceId, - Integer maxId, + Long sinceId, + Long maxId, LocalDate sinceDate, LocalDate untilDate, Integer page, @@ -109,42 +109,42 @@ public void setComponentId(ListUsagesInputComponentId componentId) { /** * Getter for SinceId. * Returns usages with an id greater than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("since_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getSinceId() { + public Long getSinceId() { return sinceId; } /** * Setter for SinceId. * Returns usages with an id greater than or equal to the one specified - * @param sinceId Value for Integer + * @param sinceId Value for Long */ @JsonSetter("since_id") - public void setSinceId(Integer sinceId) { + public void setSinceId(Long sinceId) { this.sinceId = sinceId; } /** * Getter for MaxId. * Returns usages with an id less than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("max_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getMaxId() { + public Long getMaxId() { return maxId; } /** * Setter for MaxId. * Returns usages with an id less than or equal to the one specified - * @param maxId Value for Integer + * @param maxId Value for Long */ @JsonSetter("max_id") - public void setMaxId(Integer maxId) { + public void setMaxId(Long maxId) { this.maxId = maxId; } @@ -286,8 +286,8 @@ public Builder toBuilder() { public static class Builder { private int subscriptionId; private ListUsagesInputComponentId componentId; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private LocalDate sinceDate; private LocalDate untilDate; private Integer page = 1; @@ -331,20 +331,20 @@ public Builder componentId(ListUsagesInputComponentId componentId) { /** * Setter for sinceId. - * @param sinceId Integer value for sinceId. + * @param sinceId Long value for sinceId. * @return Builder */ - public Builder sinceId(Integer sinceId) { + public Builder sinceId(Long sinceId) { this.sinceId = sinceId; return this; } /** * Setter for maxId. - * @param maxId Integer value for maxId. + * @param maxId Long value for maxId. * @return Builder */ - public Builder maxId(Integer maxId) { + public Builder maxId(Long maxId) { this.maxId = maxId; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/PaidInvoice.java b/src/main/java/com/maxio/advancedbilling/models/PaidInvoice.java index 573fa719..3e5a9175 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PaidInvoice.java +++ b/src/main/java/com/maxio/advancedbilling/models/PaidInvoice.java @@ -69,7 +69,7 @@ public void setInvoiceId(String invoiceId) { /** * Getter for Status. * The current status of the invoice. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) * for more. * @return Returns the InvoiceStatus */ @@ -82,7 +82,7 @@ public InvoiceStatus getStatus() { /** * Setter for Status. * The current status of the invoice. See [Invoice - * Statuses](https://chargify.zendesk.com/hc/en-us/articles/4407737494171#line-item-breakdowns) + * Statuses](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253-Introduction-to-Invoices#invoice-statuses) * for more. * @param status Value for InvoiceStatus */ diff --git a/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java b/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java index 626d29e9..6b893d94 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ReadEventsCountInput.java @@ -17,8 +17,8 @@ public class ReadEventsCountInput { private Integer page; private Integer perPage; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private Direction direction; private List filter; @@ -35,16 +35,16 @@ public ReadEventsCountInput() { * Initialization constructor. * @param page Integer value for page. * @param perPage Integer value for perPage. - * @param sinceId Integer value for sinceId. - * @param maxId Integer value for maxId. + * @param sinceId Long value for sinceId. + * @param maxId Long value for maxId. * @param direction Direction value for direction. * @param filter List of EventType value for filter. */ public ReadEventsCountInput( Integer page, Integer perPage, - Integer sinceId, - Integer maxId, + Long sinceId, + Long maxId, Direction direction, List filter) { this.page = page; @@ -112,42 +112,42 @@ public void setPerPage(Integer perPage) { /** * Getter for SinceId. * Returns events with an id greater than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("since_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getSinceId() { + public Long getSinceId() { return sinceId; } /** * Setter for SinceId. * Returns events with an id greater than or equal to the one specified - * @param sinceId Value for Integer + * @param sinceId Value for Long */ @JsonSetter("since_id") - public void setSinceId(Integer sinceId) { + public void setSinceId(Long sinceId) { this.sinceId = sinceId; } /** * Getter for MaxId. * Returns events with an id less than or equal to the one specified - * @return Returns the Integer + * @return Returns the Long */ @JsonGetter("max_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public Integer getMaxId() { + public Long getMaxId() { return maxId; } /** * Setter for MaxId. * Returns events with an id less than or equal to the one specified - * @param maxId Value for Integer + * @param maxId Value for Long */ @JsonSetter("max_id") - public void setMaxId(Integer maxId) { + public void setMaxId(Long maxId) { this.maxId = maxId; } @@ -228,8 +228,8 @@ public Builder toBuilder() { public static class Builder { private Integer page = 1; private Integer perPage = 20; - private Integer sinceId; - private Integer maxId; + private Long sinceId; + private Long maxId; private Direction direction = Direction.DESC; private List filter; @@ -257,20 +257,20 @@ public Builder perPage(Integer perPage) { /** * Setter for sinceId. - * @param sinceId Integer value for sinceId. + * @param sinceId Long value for sinceId. * @return Builder */ - public Builder sinceId(Integer sinceId) { + public Builder sinceId(Long sinceId) { this.sinceId = sinceId; return this; } /** * Setter for maxId. - * @param maxId Integer value for maxId. + * @param maxId Long value for maxId. * @return Builder */ - public Builder maxId(Integer maxId) { + public Builder maxId(Long maxId) { this.maxId = maxId; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/InvoiceEventEventData.java b/src/main/java/com/maxio/advancedbilling/models/containers/InvoiceEventEventData.java index e445debb..0848d5d4 100644 --- a/src/main/java/com/maxio/advancedbilling/models/containers/InvoiceEventEventData.java +++ b/src/main/java/com/maxio/advancedbilling/models/containers/InvoiceEventEventData.java @@ -19,7 +19,13 @@ import com.maxio.advancedbilling.models.ApplyCreditNoteEventData; import com.maxio.advancedbilling.models.ApplyDebitNoteEventData; import com.maxio.advancedbilling.models.ApplyPaymentEventData; +import com.maxio.advancedbilling.models.ChangeChargebackStatusEventData; import com.maxio.advancedbilling.models.ChangeInvoiceCollectionMethodEventData; +import com.maxio.advancedbilling.models.ChangeInvoiceStatusEventData; +import com.maxio.advancedbilling.models.CreditNote; +import com.maxio.advancedbilling.models.DebitNote; +import com.maxio.advancedbilling.models.FailedPaymentEventData; +import com.maxio.advancedbilling.models.Invoice; import com.maxio.advancedbilling.models.IssueInvoiceEventData; import com.maxio.advancedbilling.models.RefundInvoiceEventData; import com.maxio.advancedbilling.models.RemovePaymentEventData; @@ -125,6 +131,63 @@ public static InvoiceEventEventData fromVoidRemainderEventData( return voidRemainderEventData == null ? null : new VoidRemainderEventDataCase(voidRemainderEventData); } + /** + * This is Invoice case. + * @param invoice Invoice value for invoice. + * @return The InvoiceCase object. + */ + public static InvoiceEventEventData fromInvoice(Invoice invoice) { + return invoice == null ? null : new InvoiceCase(invoice); + } + + /** + * This is Change Invoice Status Event Data case. + * @param changeInvoiceStatusEventData ChangeInvoiceStatusEventData value for changeInvoiceStatusEventData. + * @return The ChangeInvoiceStatusEventDataCase object. + */ + public static InvoiceEventEventData fromChangeInvoiceStatusEventData( + ChangeInvoiceStatusEventData changeInvoiceStatusEventData) { + return changeInvoiceStatusEventData == null ? null : new ChangeInvoiceStatusEventDataCase(changeInvoiceStatusEventData); + } + + /** + * This is Failed Payment Event Data case. + * @param failedPaymentEventData FailedPaymentEventData value for failedPaymentEventData. + * @return The FailedPaymentEventDataCase object. + */ + public static InvoiceEventEventData fromFailedPaymentEventData( + FailedPaymentEventData failedPaymentEventData) { + return failedPaymentEventData == null ? null : new FailedPaymentEventDataCase(failedPaymentEventData); + } + + /** + * This is Debit Note case. + * @param debitNote DebitNote value for debitNote. + * @return The DebitNoteCase object. + */ + public static InvoiceEventEventData fromDebitNote(DebitNote debitNote) { + return debitNote == null ? null : new DebitNoteCase(debitNote); + } + + /** + * This is Credit Note case. + * @param creditNote CreditNote value for creditNote. + * @return The CreditNoteCase object. + */ + public static InvoiceEventEventData fromCreditNote(CreditNote creditNote) { + return creditNote == null ? null : new CreditNoteCase(creditNote); + } + + /** + * This is Change Chargeback Status Event Data case. + * @param changeChargebackStatusEventData ChangeChargebackStatusEventData value for changeChargebackStatusEventData. + * @return The ChangeChargebackStatusEventDataCase object. + */ + public static InvoiceEventEventData fromChangeChargebackStatusEventData( + ChangeChargebackStatusEventData changeChargebackStatusEventData) { + return changeChargebackStatusEventData == null ? null : new ChangeChargebackStatusEventDataCase(changeChargebackStatusEventData); + } + /** * Method to match from the provided any-of cases. * @param The type to return after applying callback. @@ -155,6 +218,18 @@ public interface Cases { R voidInvoiceEventData(VoidInvoiceEventData voidInvoiceEventData); R voidRemainderEventData(VoidRemainderEventData voidRemainderEventData); + + R invoice(Invoice invoice); + + R changeInvoiceStatusEventData(ChangeInvoiceStatusEventData changeInvoiceStatusEventData); + + R failedPaymentEventData(FailedPaymentEventData failedPaymentEventData); + + R debitNote(DebitNote debitNote); + + R creditNote(CreditNote creditNote); + + R changeChargebackStatusEventData(ChangeChargebackStatusEventData changeChargebackStatusEventData); } /** @@ -436,6 +511,192 @@ public String toString() { } } + /** + * This is a implementation class for InvoiceCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "Invoice") + private static class InvoiceCase extends InvoiceEventEventData { + + @JsonValue + private Invoice invoice; + + InvoiceCase(Invoice invoice) { + this.invoice = invoice; + } + + @Override + public R match(Cases cases) { + return cases.invoice(this.invoice); + } + + @JsonCreator + private InvoiceCase(JsonNode jsonNode) throws IOException { + this.invoice = ApiHelper.deserialize(jsonNode, + Invoice.class); + } + + @Override + public String toString() { + return invoice.toString(); + } + } + + /** + * This is a implementation class for ChangeInvoiceStatusEventDataCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "ChangeInvoiceStatusEventData") + private static class ChangeInvoiceStatusEventDataCase extends InvoiceEventEventData { + + @JsonValue + private ChangeInvoiceStatusEventData changeInvoiceStatusEventData; + + ChangeInvoiceStatusEventDataCase(ChangeInvoiceStatusEventData changeInvoiceStatusEventData) { + this.changeInvoiceStatusEventData = changeInvoiceStatusEventData; + } + + @Override + public R match(Cases cases) { + return cases.changeInvoiceStatusEventData(this.changeInvoiceStatusEventData); + } + + @JsonCreator + private ChangeInvoiceStatusEventDataCase(JsonNode jsonNode) throws IOException { + this.changeInvoiceStatusEventData = ApiHelper.deserialize(jsonNode, + ChangeInvoiceStatusEventData.class); + } + + @Override + public String toString() { + return changeInvoiceStatusEventData.toString(); + } + } + + /** + * This is a implementation class for FailedPaymentEventDataCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "FailedPaymentEventData") + private static class FailedPaymentEventDataCase extends InvoiceEventEventData { + + @JsonValue + private FailedPaymentEventData failedPaymentEventData; + + FailedPaymentEventDataCase(FailedPaymentEventData failedPaymentEventData) { + this.failedPaymentEventData = failedPaymentEventData; + } + + @Override + public R match(Cases cases) { + return cases.failedPaymentEventData(this.failedPaymentEventData); + } + + @JsonCreator + private FailedPaymentEventDataCase(JsonNode jsonNode) throws IOException { + this.failedPaymentEventData = ApiHelper.deserialize(jsonNode, + FailedPaymentEventData.class); + } + + @Override + public String toString() { + return failedPaymentEventData.toString(); + } + } + + /** + * This is a implementation class for DebitNoteCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "DebitNote") + private static class DebitNoteCase extends InvoiceEventEventData { + + @JsonValue + private DebitNote debitNote; + + DebitNoteCase(DebitNote debitNote) { + this.debitNote = debitNote; + } + + @Override + public R match(Cases cases) { + return cases.debitNote(this.debitNote); + } + + @JsonCreator + private DebitNoteCase(JsonNode jsonNode) throws IOException { + this.debitNote = ApiHelper.deserialize(jsonNode, + DebitNote.class); + } + + @Override + public String toString() { + return debitNote.toString(); + } + } + + /** + * This is a implementation class for CreditNoteCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "CreditNote") + private static class CreditNoteCase extends InvoiceEventEventData { + + @JsonValue + private CreditNote creditNote; + + CreditNoteCase(CreditNote creditNote) { + this.creditNote = creditNote; + } + + @Override + public R match(Cases cases) { + return cases.creditNote(this.creditNote); + } + + @JsonCreator + private CreditNoteCase(JsonNode jsonNode) throws IOException { + this.creditNote = ApiHelper.deserialize(jsonNode, + CreditNote.class); + } + + @Override + public String toString() { + return creditNote.toString(); + } + } + + /** + * This is a implementation class for ChangeChargebackStatusEventDataCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "ChangeChargebackStatusEventData") + private static class ChangeChargebackStatusEventDataCase extends InvoiceEventEventData { + + @JsonValue + private ChangeChargebackStatusEventData changeChargebackStatusEventData; + + ChangeChargebackStatusEventDataCase(ChangeChargebackStatusEventData changeChargebackStatusEventData) { + this.changeChargebackStatusEventData = changeChargebackStatusEventData; + } + + @Override + public R match(Cases cases) { + return cases.changeChargebackStatusEventData(this.changeChargebackStatusEventData); + } + + @JsonCreator + private ChangeChargebackStatusEventDataCase(JsonNode jsonNode) throws IOException { + this.changeChargebackStatusEventData = ApiHelper.deserialize(jsonNode, + ChangeChargebackStatusEventData.class); + } + + @Override + public String toString() { + return changeChargebackStatusEventData.toString(); + } + } + /** * This is a custom deserializer class for InvoiceEventEventData. */ @@ -452,7 +713,10 @@ public InvoiceEventEventData deserialize(JsonParser jp, DeserializationContext c ChangeInvoiceCollectionMethodEventDataCase.class, IssueInvoiceEventDataCase.class, RefundInvoiceEventDataCase.class, RemovePaymentEventDataCase.class, VoidInvoiceEventDataCase.class, - VoidRemainderEventDataCase.class), false); + VoidRemainderEventDataCase.class, InvoiceCase.class, + ChangeInvoiceStatusEventDataCase.class, FailedPaymentEventDataCase.class, + DebitNoteCase.class, CreditNoteCase.class, + ChangeChargebackStatusEventDataCase.class), false); } } 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 584cc941..0d73951d 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 @@ -7,7 +7,9 @@ import com.maxio.advancedbilling.models.ApplyCreditNoteEventData; import com.maxio.advancedbilling.models.ApplyDebitNoteEventData; import com.maxio.advancedbilling.models.ApplyPaymentEventData; +import com.maxio.advancedbilling.models.ChangeChargebackStatusEventData; import com.maxio.advancedbilling.models.ChangeInvoiceCollectionMethodEventData; +import com.maxio.advancedbilling.models.ChangeInvoiceStatusEventData; import com.maxio.advancedbilling.models.CreateInvoiceCoupon; import com.maxio.advancedbilling.models.CreateInvoiceItem; import com.maxio.advancedbilling.models.CreateInvoicePayment; @@ -16,6 +18,8 @@ import com.maxio.advancedbilling.models.CreditNote; import com.maxio.advancedbilling.models.CreditNoteStatus; import com.maxio.advancedbilling.models.Customer; +import com.maxio.advancedbilling.models.DebitNote; +import com.maxio.advancedbilling.models.FailedPaymentEventData; import com.maxio.advancedbilling.models.Invoice; import com.maxio.advancedbilling.models.InvoiceConsolidationLevel; import com.maxio.advancedbilling.models.InvoiceEvent; @@ -454,6 +458,36 @@ public R voidRemainderEventData(VoidRemainderEventData voidRemainderEventData) { return cast(voidRemainderEventData); } + @Override + public R invoice(Invoice invoice) { + return cast(invoice); + } + + @Override + public R changeInvoiceStatusEventData(ChangeInvoiceStatusEventData changeInvoiceStatusEventData) { + return cast(changeInvoiceStatusEventData); + } + + @Override + public R failedPaymentEventData(FailedPaymentEventData failedPaymentEventData) { + return cast(failedPaymentEventData); + } + + @Override + public R debitNote(DebitNote debitNote) { + return cast(debitNote); + } + + @Override + public R creditNote(CreditNote creditNote) { + return cast(creditNote); + } + + @Override + public R changeChargebackStatusEventData(ChangeChargebackStatusEventData changeChargebackStatusEventData) { + return cast(changeChargebackStatusEventData); + } + private R cast(Object o) { assertThat(o).isInstanceOf(clazz); return clazz.cast(o); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadCreditNoteTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadCreditNoteTest.java index 865887f7..a29d9bbd 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadCreditNoteTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/invoices/InvoicesControllerReadCreditNoteTest.java @@ -225,7 +225,7 @@ void shouldReadCreditNotes() throws IOException, ApiException, InterruptedExcept assertThat(creditNote.getApplications()) .hasSize(1) - .usingRecursiveFieldByFieldElementComparatorIgnoringFields("uid", "transactionTime") + .usingRecursiveFieldByFieldElementComparatorIgnoringFields("uid", "transactionTime", "additionalProperties") .containsExactly(new CreditNoteApplication.Builder() .invoiceUid(paidInvoice.getUid()) .memo("Special refund") diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerTestBase.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerTestBase.java index f10cb179..43e53596 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerTestBase.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerTestBase.java @@ -11,6 +11,7 @@ import com.maxio.advancedbilling.models.IntervalUnit; import com.maxio.advancedbilling.models.Product; import com.maxio.advancedbilling.models.ProductFamily; +import com.maxio.advancedbilling.utils.TestSetup; import org.apache.commons.lang3.RandomStringUtils; import org.junit.jupiter.api.BeforeAll; @@ -22,13 +23,7 @@ abstract class ProductsControllerTestBase { @BeforeAll static void setup() throws IOException, ApiException { - ProductFamiliesController productFamiliesController = TestClient.createClient() - .getProductFamiliesController(); - - productFamily = productFamiliesController.createProductFamily(new CreateProductFamilyRequest( - new CreateProductFamily("Test Product Family " - + RandomStringUtils.randomAlphanumeric(5), null))) - .getProductFamily(); + productFamily = new TestSetup().createProductFamily(); } protected Product createProduct() throws IOException, ApiException { diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java index bffe4ffc..6bc7e429 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java @@ -25,10 +25,10 @@ void shouldReadSite() throws Exception { // then assertThat(site.getId()).isEqualTo(SITE_ID); - assertThat(site.getName()).isEqualTo("Java SDK Env"); + assertThat(site.getName()).isEqualTo("Java SDK"); assertThat(site.getSubdomain()).isEqualTo("java-sdk"); assertThat(site.getCurrency()).isEqualTo("USD"); - assertThat(site.getSellerId()).isEqualTo(722159); + assertThat(site.getSellerId()).isEqualTo(56887); assertThat(site.getNonPrimaryCurrencies()).containsExactlyInAnyOrder("EUR"); assertThat(site.getRelationshipInvoicingEnabled()).isTrue(); assertThat(site.getCustomerHierarchyEnabled()).isFalse(); @@ -47,7 +47,7 @@ void shouldReadSite() throws Exception { assertThat(organizationAddress.getState()).isEqualTo("TX"); assertThat(organizationAddress.getZip()).isEqualTo("78015"); assertThat(organizationAddress.getCountry()).isEqualTo("US"); - assertThat(organizationAddress.getName()).isEqualTo("Developer Experience"); + assertThat(organizationAddress.getName()).isEqualTo("Maxio Developer Experience"); assertThat(organizationAddress.getPhone()).isEqualTo("555 111 222"); TaxConfiguration taxConfiguration = site.getTaxConfiguration(); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsBulkResetSubscriptionComponentsPricePointsTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsBulkResetSubscriptionComponentsPricePointsTest.java index 183be93e..b23ef298 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsBulkResetSubscriptionComponentsPricePointsTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsBulkResetSubscriptionComponentsPricePointsTest.java @@ -100,7 +100,8 @@ void shouldResetSubscriptionComponentsPricePoints() throws IOException, ApiExcep "group", "prepaidDunning", "productPricePointType", - "updatedAt" + "updatedAt", + "customer.locale" ) .isEqualTo(subscription); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsControllerListUsagesTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsControllerListUsagesTest.java index fcfc71d5..f922311c 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsControllerListUsagesTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptioncomponents/SubscriptionComponentsControllerListUsagesTest.java @@ -120,8 +120,8 @@ void shouldReturnUsagesBetweenIds() throws IOException, ApiException { List usages = SUBSCRIPTION_COMPONENTS_CONTROLLER.listUsages(new ListUsagesInput.Builder() .subscriptionId(subscription.getId()) .componentId(ListUsagesInputComponentId.fromNumber(meteredComponent.getId())) - .sinceId(Math.toIntExact(usage1.getId())) - .maxId(Math.toIntExact(usage2.getId())) + .sinceId(usage1.getId()) + .maxId(usage2.getId()) .build() ); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerPauseSubscriptionTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerPauseSubscriptionTest.java index ba2d9532..94da3e1d 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerPauseSubscriptionTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerPauseSubscriptionTest.java @@ -29,7 +29,8 @@ void shouldPauseActiveSubscription() throws IOException, ApiException { // then assertThat(pausedSubscription).usingRecursiveComparison() .ignoringFields("state", "updatedAt", "onHoldAt", "prepaidDunning", - "productPricePointType", "dunningCommunicationDelayEnabled") + "productPricePointType", "dunningCommunicationDelayEnabled", + "customer.countryName", "customer.stateName") .isEqualTo(subscription); assertThat(pausedSubscription.getState()).isEqualTo(SubscriptionState.ON_HOLD); assertThat(pausedSubscription.getUpdatedAt()).isAfter(timestamp); @@ -53,7 +54,8 @@ void shouldPauseActiveSubscriptionSettingAutomaticallyResumeAt() throws IOExcept // then assertThat(pausedSubscription).usingRecursiveComparison() .ignoringFields("state", "updatedAt", "onHoldAt", "prepaidDunning", - "productPricePointType", "automaticallyResumeAt", "dunningCommunicationDelayEnabled") + "productPricePointType", "automaticallyResumeAt", "dunningCommunicationDelayEnabled", + "customer.countryName", "customer.stateName") .isEqualTo(subscription); assertThat(pausedSubscription.getState()).isEqualTo(SubscriptionState.ON_HOLD); assertThat(pausedSubscription.getUpdatedAt()).isAfter(timestamp); @@ -85,7 +87,8 @@ void shouldUpdatePausedSubscriptionAutomaticResumptionDateToNull() throws IOExce // then assertThat(pausedSubscription).usingRecursiveComparison() .ignoringFields("state", "updatedAt", "onHoldAt", "prepaidDunning", - "productPricePointType", "automaticallyResumeAt", "dunningCommunicationDelayEnabled") + "productPricePointType", "automaticallyResumeAt", "dunningCommunicationDelayEnabled", + "customer.countryName", "customer.stateName") .isEqualTo(subscription); assertThat(pausedSubscription.getState()).isEqualTo(SubscriptionState.ON_HOLD); assertThat(pausedSubscription.getUpdatedAt()).isAfter(timestamp); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerReactivateSubscriptionTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerReactivateSubscriptionTest.java index 0a87fcfb..b4ee475c 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerReactivateSubscriptionTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerReactivateSubscriptionTest.java @@ -44,7 +44,7 @@ void shouldReactivateSubscription() throws IOException, ApiException { // then assertThat(reactivatedSubscription).usingRecursiveComparison() .ignoringFields("updatedAt", "cancelAtEndOfPeriod", "previousState", "productPricePointType", - "dunningCommunicationDelayEnabled") + "dunningCommunicationDelayEnabled", "prepaidDunning", "customer.countryName", "customer.stateName") .isEqualTo(subscription); assertThat(reactivatedSubscription.getPreviousState()).isEqualTo(CANCELED); } diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerResumeSubscriptionTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerResumeSubscriptionTest.java index dc23edfa..72196a02 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerResumeSubscriptionTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerResumeSubscriptionTest.java @@ -29,7 +29,7 @@ void shouldResumePausedSubscription() throws IOException, ApiException { // then assertThat(resumedSubscription).usingRecursiveComparison() .ignoringFields("updatedAt", "prepaidDunning", "previousState", "productPricePointType", - "dunningCommunicationDelayEnabled") + "dunningCommunicationDelayEnabled", "customer.countryName", "customer.stateName", "customer.locale") .isEqualTo(subscription); assertThat(resumedSubscription.getUpdatedAt()).isAfter(timestamp); assertThat(resumedSubscription.getState()).isEqualTo(ACTIVE); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerRetrySubscriptionTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerRetrySubscriptionTest.java index 499a7a03..93c9e76d 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerRetrySubscriptionTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerRetrySubscriptionTest.java @@ -23,7 +23,8 @@ void shouldRetryFailedSubscription() throws IOException, ApiException { // then assertThat(retriedSubscription).usingRecursiveComparison() - .ignoringFields("productPricePointType", "prepaidDunning", "updatedAt", "dunningCommunicationDelayEnabled") + .ignoringFields("productPricePointType", "prepaidDunning", "updatedAt", + "dunningCommunicationDelayEnabled", "customer.countryName", "customer.stateName") .isEqualTo(subscription); } diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerTestBase.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerTestBase.java index 6d030e79..4318c9aa 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerTestBase.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerTestBase.java @@ -1,35 +1,26 @@ package com.maxio.advancedbilling.controllers.subscriptionstatus; import com.maxio.advancedbilling.TestClient; -import com.maxio.advancedbilling.controllers.ProductFamiliesController; import com.maxio.advancedbilling.controllers.ProductsController; import com.maxio.advancedbilling.controllers.SubscriptionStatusController; import com.maxio.advancedbilling.controllers.SubscriptionsController; import com.maxio.advancedbilling.exceptions.ApiException; -import com.maxio.advancedbilling.models.CreateCustomer; -import com.maxio.advancedbilling.models.CreateCustomerRequest; -import com.maxio.advancedbilling.models.CreateOrUpdateProduct; -import com.maxio.advancedbilling.models.CreateOrUpdateProductRequest; -import com.maxio.advancedbilling.models.CreateProductFamily; -import com.maxio.advancedbilling.models.CreateProductFamilyRequest; import com.maxio.advancedbilling.models.CreateSubscription; import com.maxio.advancedbilling.models.CreateSubscriptionRequest; import com.maxio.advancedbilling.models.Customer; -import com.maxio.advancedbilling.models.IntervalUnit; import com.maxio.advancedbilling.models.PaymentProfileAttributes; import com.maxio.advancedbilling.models.Product; import com.maxio.advancedbilling.models.ProductFamily; import com.maxio.advancedbilling.models.Subscription; import com.maxio.advancedbilling.models.containers.PaymentProfileAttributesExpirationMonth; import com.maxio.advancedbilling.models.containers.PaymentProfileAttributesExpirationYear; -import org.apache.commons.lang3.RandomStringUtils; +import com.maxio.advancedbilling.utils.TestSetup; import org.junit.jupiter.api.BeforeAll; import java.io.IOException; abstract class SubscriptionStatusControllerTestBase { - protected static final ProductsController productsController = TestClient.createClient().getProductsController(); protected static final SubscriptionsController subscriptionsController = TestClient.createClient().getSubscriptionsController(); protected static final SubscriptionStatusController subscriptionStatusController = TestClient.createClient().getSubscriptionStatusController(); @@ -41,36 +32,12 @@ abstract class SubscriptionStatusControllerTestBase { @BeforeAll static void setup() throws IOException, ApiException { - ProductFamiliesController productFamiliesController = TestClient.createClient() - .getProductFamiliesController(); - String seed = RandomStringUtils.randomAlphanumeric(5).toLowerCase(); - - ProductFamily productFamily = productFamiliesController.createProductFamily(new CreateProductFamilyRequest( - new CreateProductFamily("Test Product Family " + seed, null))) - .getProductFamily(); + TestSetup testSetup = new TestSetup(); + ProductFamily productFamily = testSetup.createProductFamily(); productFamilyId = productFamily.getId(); - - product = productsController - .createProduct(productFamily.getId(), new CreateOrUpdateProductRequest( - new CreateOrUpdateProduct.Builder() - .name("Initial Sample product-" + RandomStringUtils.randomAlphanumeric(5)) - .handle("initial-sample-product-" + seed) - .priceInCents(1000) - .interval(1) - .intervalUnit(IntervalUnit.MONTH) - .build() - )) - .getProduct(); + product = testSetup.createProduct(productFamily); productId = product.getId(); - - customer = TestClient.createClient().getCustomersController() - .createCustomer(new CreateCustomerRequest(new CreateCustomer.Builder() - .firstName("Joe") - .lastName("Blow") - .email("joe@example.com") - .build()) - ) - .getCustomer(); + customer = testSetup.createCustomer(); } Subscription createSubscription() throws IOException, ApiException { diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerUpdateAutomaticResumptionTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerUpdateAutomaticResumptionTest.java index b0e180b9..98054e18 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerUpdateAutomaticResumptionTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/subscriptionstatus/SubscriptionStatusControllerUpdateAutomaticResumptionTest.java @@ -34,7 +34,8 @@ void shouldUpdatePausedSubscriptionAutomaticResumptionDate() throws IOException, // then assertThat(pausedSubscription).usingRecursiveComparison() .ignoringFields("state", "updatedAt", "onHoldAt", "prepaidDunning", - "productPricePointType", "automaticallyResumeAt", "dunningCommunicationDelayEnabled") + "productPricePointType", "automaticallyResumeAt", "dunningCommunicationDelayEnabled", + "customer.countryName", "customer.stateName", "customer.locale") .isEqualTo(subscription); assertThat(pausedSubscription.getState()).isEqualTo(SubscriptionState.ON_HOLD); assertThat(pausedSubscription.getUpdatedAt()).isAfter(timestamp); diff --git a/tests/src/test/java/com/maxio/advancedbilling/utils/TestFixtures.java b/tests/src/test/java/com/maxio/advancedbilling/utils/TestFixtures.java index c626af1d..aabd4b66 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/utils/TestFixtures.java +++ b/tests/src/test/java/com/maxio/advancedbilling/utils/TestFixtures.java @@ -4,11 +4,11 @@ import com.maxio.advancedbilling.models.InvoiceSeller; public class TestFixtures { - private static final Integer DEFAULT_SITE_ID = 4512; + private static final Integer DEFAULT_SITE_ID = 86550; public static final Integer SITE_ID = getSiteId(); public static final InvoiceSeller INVOICE_SELLER = new InvoiceSeller.Builder() - .name("Developer Experience") + .name("Maxio Developer Experience") .address(new InvoiceAddress.Builder() .street("Asdf Street") .line2("123/444")