diff --git a/README.md b/README.md index b0521cf7..a1171725 100644 --- a/README.md +++ b/README.md @@ -293,8 +293,7 @@ The following parameters are configurable for the API Client: | `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/1.0.1/doc/http-client-configuration.md) | Http Client Configuration instance. | -| `basicAuthUserName` | `String` | The username to use with basic authentication | -| `basicAuthPassword` | `String` | The password to use with basic authentication | +| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-java-sdk/tree/1.0.1/doc/$a/https://www.github.com/maxio-com/ab-java-sdk/tree/1.0.1/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: @@ -302,7 +301,11 @@ The API client can be initialized as follows: AdvancedBillingClient client = new AdvancedBillingClient.Builder() .httpClientConfig(configBuilder -> configBuilder .timeout(0)) - .basicAuthCredentials("BasicAuthUserName", "BasicAuthPassword") + .basicAuthCredentials(new BasicAuthModel.Builder( + "BasicAuthUserName", + "BasicAuthPassword" + ) + .build()) .environment(Environment.PRODUCTION) .subdomain("subdomain") .domain("chargify.com") @@ -322,7 +325,9 @@ The SDK can be configured to use a different environment for making API calls. A ## Authorization -This API uses `Basic Authentication`. +This API uses the following authentication schemes. + +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-java-sdk/tree/1.0.1/doc/$a/https://www.github.com/maxio-com/ab-java-sdk/tree/1.0.1/basic-authentication.md) ## List of APIs diff --git a/doc/auth/basic-authentication.md b/doc/auth/basic-authentication.md new file mode 100644 index 00000000..0dc3d4a0 --- /dev/null +++ b/doc/auth/basic-authentication.md @@ -0,0 +1,35 @@ + +# Basic Authentication + + + +Documentation for accessing and setting credentials for BasicAuth. + +## Auth Credentials + +| Name | Type | Description | Setter | Getter | +| --- | --- | --- | --- | --- | +| BasicAuthUserName | `String` | The username to use with basic authentication | `username` | `getBasicAuthUserName()` | +| BasicAuthPassword | `String` | The password to use with basic authentication | `password` | `getBasicAuthPassword()` | + + + +**Note:** Auth credentials can be set using `basicAuthCredentials` in the client builder and accessed through `getBasicAuthCredentials` method in the client instance. + +## Usage Example + +### Client Initialization + +You must provide credentials in the client as shown in the following code snippet. + +```java +AdvancedBillingClient client = new AdvancedBillingClient.Builder() + .basicAuthCredentials(new BasicAuthModel.Builder( + "BasicAuthUserName", + "BasicAuthPassword" + ) + .build()) + .build(); +``` + + diff --git a/doc/client.md b/doc/client.md index f133a76f..952d14bc 100644 --- a/doc/client.md +++ b/doc/client.md @@ -9,8 +9,7 @@ The following parameters are configurable for the API Client: | `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. | -| `basicAuthUserName` | `String` | The username to use with basic authentication | -| `basicAuthPassword` | `String` | The password to use with basic authentication | +| `basicAuthCredentials` | [`BasicAuthCredentials`]($a/basic-authentication.md) | The Credentials Setter for Basic Authentication | The API client can be initialized as follows: @@ -18,7 +17,11 @@ The API client can be initialized as follows: AdvancedBillingClient client = new AdvancedBillingClient.Builder() .httpClientConfig(configBuilder -> configBuilder .timeout(0)) - .basicAuthCredentials("BasicAuthUserName", "BasicAuthPassword") + .basicAuthCredentials(new BasicAuthModel.Builder( + "BasicAuthUserName", + "BasicAuthPassword" + ) + .build()) .environment(Environment.PRODUCTION) .subdomain("subdomain") .domain("chargify.com") @@ -75,6 +78,7 @@ The gateway for the SDK. This class acts as a factory for the Controllers and al | `getDomain()` | The Chargify server domain. | `String` | | `getHttpClient()` | The HTTP Client instance to use for making HTTP requests. | `HttpClient` | | `getHttpClientConfig()` | Http Client Configuration instance. | [`ReadonlyHttpClientConfiguration`](http-client-configuration.md) | +| `getBasicAuthCredentials()` | The credentials to use with BasicAuth. | [`BasicAuthCredentials`]($a/basic-authentication.md) | | `getBaseUri(Server server)` | Get base URI by current environment | `String` | | `getBaseUri()` | Get base URI by current environment | `String` | diff --git a/doc/configuration-interface.md b/doc/configuration-interface.md index ade67df6..5d05edb8 100644 --- a/doc/configuration-interface.md +++ b/doc/configuration-interface.md @@ -1,7 +1,7 @@ # Configuration Interface -This is the base class for all exceptions that represent an error response from the server. +This is the interface for client class that holds the configuration getters. ## Methods diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index d2a9c4ed..7bb9f2d4 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -1913,7 +1913,7 @@ Excess payment will result in the creation of a prepayment on the Invoice Accoun Only ungrouped or primary subscriptions may be paid using the "bulk" payment request. ```java -PaymentResponse recordPaymentForSubscription( +RecordPaymentResponse recordPaymentForSubscription( final int subscriptionId, final RecordPaymentRequest body) ``` @@ -1927,7 +1927,7 @@ PaymentResponse recordPaymentForSubscription( ## Response Type -[`PaymentResponse`](../../doc/models/payment-response.md) +[`RecordPaymentResponse`](../../doc/models/record-payment-response.md) ## Example Usage @@ -1938,14 +1938,14 @@ RecordPaymentRequest body = new RecordPaymentRequest.Builder( "10.0", "to pay the bills", "check number 8675309", - "check" + InvoicePaymentMethodType.CHECK ) .build() ) .build(); try { - PaymentResponse result = invoicesController.recordPaymentForSubscription(subscriptionId, body); + RecordPaymentResponse result = invoicesController.recordPaymentForSubscription(subscriptionId, body); System.out.println(result); } catch (ApiException e) { e.printStackTrace(); @@ -1960,23 +1960,19 @@ try { { "paid_invoices": [ { - "invoice_uid": "xyz_012345678", + "invoice_id": "inv_bchyhr6z5grby", "status": "paid", "due_amount": "0.0", "paid_amount": "50.0" }, { - "invoice_uid": "xyz_012345678", + "invoice_id": "inv_bchyhrgvyb6vm", "status": "paid", "due_amount": "0.0", "paid_amount": "50.0" } ], - "prepayment": { - "subscription_id": "123456", - "amount_in_cents": "5000", - "ending_balance_in_cents": "5000" - } + "prepayment": null } ``` diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 3f68e370..4dada6d6 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -120,14 +120,14 @@ Proforma invoices are only available on Relationship Invoicing sites. ```java ProformaInvoice readProformaInvoice( - final int proformaInvoiceUid) + final String proformaInvoiceUid) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `proformaInvoiceUid` | `int` | Template, Required | The uid of the proforma invoice | +| `proformaInvoiceUid` | `String` | Template, Required | The uid of the proforma invoice | ## Response Type @@ -136,7 +136,7 @@ ProformaInvoice readProformaInvoice( ## Example Usage ```java -int proformaInvoiceUid = 242; +String proformaInvoiceUid = "proforma_invoice_uid4"; try { ProformaInvoice result = proformaInvoicesController.readProformaInvoice(proformaInvoiceUid); @@ -207,7 +207,7 @@ try { By default, proforma invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. ```java -List listProformaInvoices( +ListProformaInvoicesResponse listProformaInvoices( final ListProformaInvoicesInput input) ``` @@ -231,7 +231,7 @@ List listProformaInvoices( ## Response Type -[`List`](../../doc/models/proforma-invoice.md) +[`ListProformaInvoicesResponse`](../../doc/models/list-proforma-invoices-response.md) ## Example Usage @@ -251,7 +251,7 @@ ListProformaInvoicesInput listProformaInvoicesInput = new ListProformaInvoicesIn .build(); try { - List result = proformaInvoicesController.listProformaInvoices(listProformaInvoicesInput); + ListProformaInvoicesResponse result = proformaInvoicesController.listProformaInvoices(listProformaInvoicesInput); System.out.println(result); } catch (ApiException e) { e.printStackTrace(); diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index cd273dc1..44531368 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -89,7 +89,7 @@ CreatePrepaymentRequest body = new CreatePrepaymentRequest.Builder( 100D, "John Doe signup for $100", "Signup for $100", - PrepaymentMethod.CHECK + CreatePrepaymentMethod.CHECK ) .build() ) diff --git a/doc/models/containers/record-payment-response-prepayment.md b/doc/models/containers/record-payment-response-prepayment.md new file mode 100644 index 00000000..546d61f1 --- /dev/null +++ b/doc/models/containers/record-payment-response-prepayment.md @@ -0,0 +1,13 @@ + +# Record Payment Response Prepayment + +## Class Name + +`RecordPaymentResponsePrepayment` + +## Cases + +| Type | Factory Method | +| --- | --- | +| [`InvoicePrePayment`](../../../doc/models/invoice-pre-payment.md) | RecordPaymentResponsePrepayment.fromInvoicePrePayment(InvoicePrePayment invoicePrePayment) | + diff --git a/doc/models/create-or-update-product-request.md b/doc/models/create-or-update-product-request.md index aa7ad564..c61d350a 100644 --- a/doc/models/create-or-update-product-request.md +++ b/doc/models/create-or-update-product-request.md @@ -24,8 +24,8 @@ "price_in_cents": 54, "interval": 186, "interval_unit": "day", - "auto_create_signup_page": false, - "tax_code": "tax_code8" + "trial_price_in_cents": 34, + "trial_interval": 88 } } ``` diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index d19b70a4..9635ee37 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -17,6 +17,12 @@ | `PriceInCents` | `long` | Required | The product price, in integer cents | long getPriceInCents() | setPriceInCents(long priceInCents) | | `Interval` | `int` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | int getInterval() | setInterval(int interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | +| `TrialPriceInCents` | `Long` | Optional | The product trial price, in integer cents | Long getTrialPriceInCents() | setTrialPriceInCents(Long trialPriceInCents) | +| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | +| `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | +| `TrialType` | `String` | Optional | - | String getTrialType() | setTrialType(String trialType) | +| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `ExpirationIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month or day | IntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(IntervalUnit expirationIntervalUnit) | | `AutoCreateSignupPage` | `Boolean` | Optional | - | Boolean getAutoCreateSignupPage() | setAutoCreateSignupPage(Boolean autoCreateSignupPage) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
**Constraints**: *Maximum Length*: `10` | String getTaxCode() | setTaxCode(String taxCode) | @@ -32,8 +38,8 @@ "price_in_cents": 190, "interval": 174, "interval_unit": "day", - "auto_create_signup_page": false, - "tax_code": "tax_code6" + "trial_price_in_cents": 22, + "trial_interval": 76 } ``` diff --git a/doc/models/create-payment.md b/doc/models/create-payment.md index 3808f6fd..7b678716 100644 --- a/doc/models/create-payment.md +++ b/doc/models/create-payment.md @@ -12,7 +12,7 @@ | `Amount` | `String` | Required | - | String getAmount() | setAmount(String amount) | | `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | | `PaymentDetails` | `String` | Required | - | String getPaymentDetails() | setPaymentDetails(String paymentDetails) | -| `PaymentMethod` | `String` | Required | - | String getPaymentMethod() | setPaymentMethod(String paymentMethod) | +| `PaymentMethod` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | The type of payment method used. Defaults to other. | InvoicePaymentMethodType getPaymentMethod() | setPaymentMethod(InvoicePaymentMethodType paymentMethod) | ## Example (as JSON) @@ -21,7 +21,7 @@ "amount": "amount6", "memo": "memo8", "payment_details": "payment_details4", - "payment_method": "payment_method6" + "payment_method": "cash" } ``` diff --git a/doc/models/create-prepayment-method.md b/doc/models/create-prepayment-method.md new file mode 100644 index 00000000..2f15e906 --- /dev/null +++ b/doc/models/create-prepayment-method.md @@ -0,0 +1,22 @@ + +# Create Prepayment Method + +:- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. + +## Enumeration + +`CreatePrepaymentMethod` + +## Fields + +| Name | +| --- | +| `Check` | +| `Cash` | +| `MoneyOrder` | +| `Ach` | +| `PaypalAccount` | +| `CreditCard` | +| `CreditCardOnFile` | +| `Other` | + diff --git a/doc/models/create-prepayment-request.md b/doc/models/create-prepayment-request.md index 8dc2943c..5bfcb6c9 100644 --- a/doc/models/create-prepayment-request.md +++ b/doc/models/create-prepayment-request.md @@ -19,7 +19,7 @@ "amount": 11.6, "details": "details8", "memo": "memo2", - "method": "cash", + "method": "money_order", "payment_profile_id": 240 } } diff --git a/doc/models/create-prepayment.md b/doc/models/create-prepayment.md index 9196d58e..31e25660 100644 --- a/doc/models/create-prepayment.md +++ b/doc/models/create-prepayment.md @@ -12,7 +12,7 @@ | `Amount` | `double` | Required | - | double getAmount() | setAmount(double amount) | | `Details` | `String` | Required | - | String getDetails() | setDetails(String details) | | `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | -| `Method` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Required | :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | PrepaymentMethod getMethod() | setMethod(PrepaymentMethod method) | +| `Method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | CreatePrepaymentMethod getMethod() | setMethod(CreatePrepaymentMethod method) | | `PaymentProfileId` | `Integer` | Optional | - | Integer getPaymentProfileId() | setPaymentProfileId(Integer paymentProfileId) | ## Example (as JSON) @@ -22,7 +22,7 @@ "amount": 23.92, "details": "details6", "memo": "memo0", - "method": "paypal_account", + "method": "credit_card_on_file", "payment_profile_id": 240 } ``` diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 5e017506..5834490c 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -15,12 +15,12 @@ | `Interval` | `int` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | int getInterval() | setInterval(int interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product price point, either month or day | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `TrialPriceInCents` | `Long` | Optional | The product price point trial price, in integer cents | Long getTrialPriceInCents() | setTrialPriceInCents(Long trialPriceInCents) | -| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | +| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | | `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | | `TrialType` | `String` | Optional | - | String getTrialType() | setTrialType(String trialType) | | `InitialChargeInCents` | `Long` | Optional | The product price point initial charge, in integer cents | Long getInitialChargeInCents() | setInitialChargeInCents(Long initialChargeInCents) | | `InitialChargeAfterTrial` | `Boolean` | Optional | - | Boolean getInitialChargeAfterTrial() | setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) | -| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire every 30 days | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month or day | IntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(IntervalUnit expirationIntervalUnit) | | `UseSiteExchangeRate` | `Boolean` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.
**Default**: `true` | Boolean getUseSiteExchangeRate() | setUseSiteExchangeRate(Boolean useSiteExchangeRate) | diff --git a/doc/models/invoice-pre-payment.md b/doc/models/invoice-pre-payment.md index 60e0c808..7cea90f3 100644 --- a/doc/models/invoice-pre-payment.md +++ b/doc/models/invoice-pre-payment.md @@ -9,17 +9,17 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `SubscriptionId` | `String` | Optional | The subscription id for the prepayment account | String getSubscriptionId() | setSubscriptionId(String subscriptionId) | -| `AmountInCents` | `String` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | String getAmountInCents() | setAmountInCents(String amountInCents) | -| `EndingBalanceInCents` | `String` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | String getEndingBalanceInCents() | setEndingBalanceInCents(String endingBalanceInCents) | +| `SubscriptionId` | `Integer` | Optional | The subscription id for the prepayment account | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | +| `AmountInCents` | `Long` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | Long getAmountInCents() | setAmountInCents(Long amountInCents) | +| `EndingBalanceInCents` | `Long` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | Long getEndingBalanceInCents() | setEndingBalanceInCents(Long endingBalanceInCents) | ## Example (as JSON) ```json { - "subscription_id": "subscription_id0", - "amount_in_cents": "amount_in_cents2", - "ending_balance_in_cents": "ending_balance_in_cents4" + "subscription_id": 180, + "amount_in_cents": 100, + "ending_balance_in_cents": 60 } ``` diff --git a/doc/models/list-proforma-invoices-meta.md b/doc/models/list-proforma-invoices-meta.md new file mode 100644 index 00000000..69078d52 --- /dev/null +++ b/doc/models/list-proforma-invoices-meta.md @@ -0,0 +1,27 @@ + +# List Proforma Invoices Meta + +## Structure + +`ListProformaInvoicesMeta` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `TotalCount` | `Integer` | Optional | - | Integer getTotalCount() | setTotalCount(Integer totalCount) | +| `CurrentPage` | `Integer` | Optional | - | Integer getCurrentPage() | setCurrentPage(Integer currentPage) | +| `TotalPages` | `Integer` | Optional | - | Integer getTotalPages() | setTotalPages(Integer totalPages) | +| `StatusCode` | `Integer` | Optional | - | Integer getStatusCode() | setStatusCode(Integer statusCode) | + +## Example (as JSON) + +```json +{ + "total_count": 226, + "current_page": 202, + "total_pages": 214, + "status_code": 244 +} +``` + diff --git a/doc/models/list-proforma-invoices-response.md b/doc/models/list-proforma-invoices-response.md new file mode 100644 index 00000000..a0c469a6 --- /dev/null +++ b/doc/models/list-proforma-invoices-response.md @@ -0,0 +1,50 @@ + +# List Proforma Invoices Response + +## Structure + +`ListProformaInvoicesResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `ProformaInvoices` | [`List`](../../doc/models/proforma-invoice.md) | Optional | - | List getProformaInvoices() | setProformaInvoices(List proformaInvoices) | +| `Meta` | [`ListProformaInvoicesMeta`](../../doc/models/list-proforma-invoices-meta.md) | Optional | - | ListProformaInvoicesMeta getMeta() | setMeta(ListProformaInvoicesMeta meta) | + +## Example (as JSON) + +```json +{ + "proforma_invoices": [ + { + "uid": "uid0", + "site_id": 140, + "customer_id": 252, + "subscription_id": 68, + "number": 56 + }, + { + "uid": "uid0", + "site_id": 140, + "customer_id": 252, + "subscription_id": 68, + "number": 56 + }, + { + "uid": "uid0", + "site_id": 140, + "customer_id": 252, + "subscription_id": 68, + "number": 56 + } + ], + "meta": { + "total_count": 150, + "current_page": 126, + "total_pages": 138, + "status_code": 168 + } +} +``` + diff --git a/doc/models/list-subcription-group-prepayment-item.md b/doc/models/list-subcription-group-prepayment-item.md index 55b867f1..9c1f3fde 100644 --- a/doc/models/list-subcription-group-prepayment-item.md +++ b/doc/models/list-subcription-group-prepayment-item.md @@ -16,7 +16,7 @@ | `Details` | `String` | Optional | - | String getDetails() | setDetails(String details) | | `External` | `Boolean` | Optional | - | Boolean getExternal() | setExternal(Boolean external) | | `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | -| `PaymentType` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | PrepaymentMethod getPaymentType() | setPaymentType(PrepaymentMethod paymentType) | +| `PaymentType` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | - | PrepaymentMethod getPaymentType() | setPaymentType(PrepaymentMethod paymentType) | | `CreatedAt` | `String` | Optional | - | String getCreatedAt() | setCreatedAt(String createdAt) | ## Example (as JSON) diff --git a/doc/models/payment.md b/doc/models/paid-invoice.md similarity index 73% rename from doc/models/payment.md rename to doc/models/paid-invoice.md index dd13cdb0..325aa24b 100644 --- a/doc/models/payment.md +++ b/doc/models/paid-invoice.md @@ -1,15 +1,15 @@ -# Payment +# Paid Invoice ## Structure -`Payment` +`PaidInvoice` ## Fields | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `InvoiceUid` | `String` | Optional | The uid of the paid invoice | String getInvoiceUid() | setInvoiceUid(String invoiceUid) | +| `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) | | `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) | @@ -18,10 +18,10 @@ ```json { - "invoice_uid": "invoice_uid8", - "status": "voided", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" + "invoice_id": "invoice_id6", + "status": "draft", + "due_amount": "due_amount8", + "paid_amount": "paid_amount8" } ``` diff --git a/doc/models/payment-response.md b/doc/models/payment-response.md deleted file mode 100644 index 0459431c..00000000 --- a/doc/models/payment-response.md +++ /dev/null @@ -1,34 +0,0 @@ - -# Payment Response - -## Structure - -`PaymentResponse` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `PaidInvoices` | [`List`](../../doc/models/payment.md) | Optional | - | List getPaidInvoices() | setPaidInvoices(List paidInvoices) | -| `Prepayment` | [`InvoicePrePayment`](../../doc/models/invoice-pre-payment.md) | Optional | - | InvoicePrePayment getPrepayment() | setPrepayment(InvoicePrePayment prepayment) | - -## Example (as JSON) - -```json -{ - "paid_invoices": [ - { - "invoice_uid": "invoice_uid8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - } - ], - "prepayment": { - "subscription_id": "subscription_id8", - "amount_in_cents": "amount_in_cents6", - "ending_balance_in_cents": "ending_balance_in_cents4" - } -} -``` - diff --git a/doc/models/prepayment-method.md b/doc/models/prepayment-method.md index 4fbf8fb7..10b58a6e 100644 --- a/doc/models/prepayment-method.md +++ b/doc/models/prepayment-method.md @@ -1,8 +1,6 @@ # Prepayment Method -:- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. - ## Enumeration `PrepaymentMethod` @@ -16,6 +14,6 @@ | `MoneyOrder` | | `Ach` | | `PaypalAccount` | -| `CreditCardOnFile` | +| `CreditCard` | | `Other` | diff --git a/doc/models/prepayment-response.md b/doc/models/prepayment-response.md index f5573b44..9c5efe1d 100644 --- a/doc/models/prepayment-response.md +++ b/doc/models/prepayment-response.md @@ -24,7 +24,7 @@ "details": "details8", "external": false, "memo": "memo2", - "payment_type": "credit_card_on_file", + "payment_type": "credit_card", "created_at": "created_at6" } } diff --git a/doc/models/product-price-point.md b/doc/models/product-price-point.md index 5e06e4da..1a797140 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -16,13 +16,13 @@ | `Interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | Integer getInterval() | setInterval(Integer interval) | | `IntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product price point, either month or day | IntervalUnit getIntervalUnit() | setIntervalUnit(IntervalUnit intervalUnit) | | `TrialPriceInCents` | `Long` | Optional | The product price point trial price, in integer cents | Long getTrialPriceInCents() | setTrialPriceInCents(Long trialPriceInCents) | -| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of day would mean this product price point would renew every 30 days | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | +| `TrialInterval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days | Integer getTrialInterval() | setTrialInterval(Integer trialInterval) | | `TrialIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | IntervalUnit getTrialIntervalUnit() | setTrialIntervalUnit(IntervalUnit trialIntervalUnit) | | `TrialType` | `String` | Optional | - | String getTrialType() | setTrialType(String trialType) | | `IntroductoryOffer` | `Boolean` | Optional | reserved for future use | Boolean getIntroductoryOffer() | setIntroductoryOffer(Boolean introductoryOffer) | | `InitialChargeInCents` | `Long` | Optional | The product price point initial charge, in integer cents | Long getInitialChargeInCents() | setInitialChargeInCents(Long initialChargeInCents) | | `InitialChargeAfterTrial` | `Boolean` | Optional | - | Boolean getInitialChargeAfterTrial() | setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) | -| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire every 30 days | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | +| `ExpirationInterval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days | Integer getExpirationInterval() | setExpirationInterval(Integer expirationInterval) | | `ExpirationIntervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month or day | IntervalUnit getExpirationIntervalUnit() | setExpirationIntervalUnit(IntervalUnit expirationIntervalUnit) | | `ProductId` | `Integer` | Optional | The product id this price point belongs to | Integer getProductId() | setProductId(Integer productId) | | `ArchivedAt` | `ZonedDateTime` | Optional | Timestamp indicating when this price point was archived | ZonedDateTime getArchivedAt() | setArchivedAt(ZonedDateTime archivedAt) | diff --git a/doc/models/record-payment-request.md b/doc/models/record-payment-request.md index f9a45cfc..c61de6fb 100644 --- a/doc/models/record-payment-request.md +++ b/doc/models/record-payment-request.md @@ -19,7 +19,7 @@ "amount": "amount8", "memo": "memo0", "payment_details": "payment_details6", - "payment_method": "payment_method4" + "payment_method": "cash" } } ``` diff --git a/doc/models/record-payment-response.md b/doc/models/record-payment-response.md new file mode 100644 index 00000000..678d3cc9 --- /dev/null +++ b/doc/models/record-payment-response.md @@ -0,0 +1,46 @@ + +# Record Payment Response + +## Structure + +`RecordPaymentResponse` + +## Fields + +| Name | Type | Tags | Description | Getter | Setter | +| --- | --- | --- | --- | --- | --- | +| `PaidInvoices` | [`List`](../../doc/models/paid-invoice.md) | Optional | - | List getPaidInvoices() | setPaidInvoices(List paidInvoices) | +| `Prepayment` | [`RecordPaymentResponsePrepayment`](../../doc/models/containers/record-payment-response-prepayment.md) | Optional | This is a container for one-of cases. | RecordPaymentResponsePrepayment getPrepayment() | setPrepayment(RecordPaymentResponsePrepayment prepayment) | + +## Example (as JSON) + +```json +{ + "paid_invoices": [ + { + "invoice_id": "invoice_id8", + "status": "draft", + "due_amount": "due_amount0", + "paid_amount": "paid_amount0" + }, + { + "invoice_id": "invoice_id8", + "status": "draft", + "due_amount": "due_amount0", + "paid_amount": "paid_amount0" + }, + { + "invoice_id": "invoice_id8", + "status": "draft", + "due_amount": "due_amount0", + "paid_amount": "paid_amount0" + } + ], + "prepayment": { + "subscription_id": 180, + "amount_in_cents": 100, + "ending_balance_in_cents": 60 + } +} +``` + diff --git a/pom.xml b/pom.xml index db5f43f1..31e2eb00 100644 --- a/pom.xml +++ b/pom.xml @@ -46,17 +46,17 @@ Maxio integrates directly into your product, so you can seamlessly manage your p io.apimatic core-interfaces - [0.1, 0.2) + [0.2, 0.3) io.apimatic core - [0.4, 0.5) + [0.5, 0.6) io.apimatic okhttp-client-adapter - [0.1, 0.2) + [0.2, 0.3) @@ -129,6 +129,19 @@ Maxio integrates directly into your product, so you can seamlessly manage your p false + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + diff --git a/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java b/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java index 645cd4d8..fd7500c9 100644 --- a/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java +++ b/src/main/java/com/maxio/advancedbilling/AdvancedBillingClient.java @@ -6,6 +6,8 @@ package com.maxio.advancedbilling; +import com.maxio.advancedbilling.authentication.BasicAuthManager; +import com.maxio.advancedbilling.authentication.BasicAuthModel; import com.maxio.advancedbilling.controllers.APIExportsController; import com.maxio.advancedbilling.controllers.AdvanceInvoiceController; import com.maxio.advancedbilling.controllers.BillingPortalController; @@ -125,16 +127,19 @@ public final class AdvancedBillingClient implements Configuration { */ private BasicAuthManager basicAuthManager; + /** + * The instance of BasicAuthModel. + */ + private BasicAuthModel basicAuthModel; + /** * Map of authentication Managers. */ private Map authentications; - private AdvancedBillingClient(Environment environment, String subdomain, String domain, HttpClient httpClient, ReadonlyHttpClientConfiguration httpClientConfig, - String basicAuthUserName, String basicAuthPassword, - Map authentications) { + BasicAuthModel basicAuthModel, Map authentications) { this.environment = environment; this.subdomain = subdomain; this.domain = domain; @@ -142,19 +147,23 @@ private AdvancedBillingClient(Environment environment, String subdomain, String this.httpClientConfig = httpClientConfig; this.authentications = (authentications == null) ? new HashMap<>() : new HashMap<>(authentications); - if (this.authentications.containsKey("global")) { - this.basicAuthManager = (BasicAuthManager) this.authentications.get("global"); + this.basicAuthModel = basicAuthModel; + + if (this.authentications.containsKey("BasicAuth")) { + this.basicAuthManager = (BasicAuthManager) this.authentications.get("BasicAuth"); } - if (!this.authentications.containsKey("global") - || !getBasicAuthCredentials().equals(basicAuthUserName, basicAuthPassword)) { - this.basicAuthManager = new BasicAuthManager(basicAuthUserName, basicAuthPassword); - this.authentications.put("global", basicAuthManager); + if (!this.authentications.containsKey("BasicAuth") + || !getBasicAuthCredentials().equals(basicAuthModel.getUsername(), + basicAuthModel.getPassword())) { + this.basicAuthManager = new BasicAuthManager(basicAuthModel); + this.authentications.put("BasicAuth", basicAuthManager); } GlobalConfiguration globalConfig = new GlobalConfiguration.Builder() - .authentication(this.authentications).compatibilityFactory(compatibilityFactory) .httpClient(httpClient).baseUri(server -> getBaseUri(server)) + .compatibilityFactory(compatibilityFactory) + .authentication(this.authentications) .userAgent(userAgent) .build(); aPIExports = new APIExportsController(globalConfig); @@ -493,6 +502,14 @@ public ReadonlyHttpClientConfiguration getHttpClientConfig() { public BasicAuthCredentials getBasicAuthCredentials() { return basicAuthManager; } + + /** + * The auth credential model for BasicAuth. + * @return the instance of BasicAuthModel + */ + public BasicAuthModel getBasicAuthModel() { + return basicAuthModel; + } /** * The timeout to use for making HTTP requests. * @deprecated This method will be removed in a future version. Use @@ -583,8 +600,8 @@ public Builder newBuilder() { builder.subdomain = getSubdomain(); builder.domain = getDomain(); builder.httpClient = getHttpClient(); - builder.basicAuthUserName = getBasicAuthCredentials().getBasicAuthUserName(); - builder.basicAuthPassword = getBasicAuthCredentials().getBasicAuthPassword(); + builder.basicAuthCredentials(getBasicAuthModel() + .toBuilder().build()); builder.authentications = authentications; builder.httpClientConfig(configBldr -> configBldr = ((HttpClientConfiguration) httpClientConfig).newBuilder()); @@ -600,8 +617,7 @@ public static class Builder { private String subdomain = "subdomain"; private String domain = "chargify.com"; private HttpClient httpClient; - private String basicAuthUserName = "TODO: Replace"; - private String basicAuthPassword = "TODO: Replace"; + private BasicAuthModel basicAuthModel = new BasicAuthModel.Builder("", "").build(); private Map authentications = null; private HttpClientConfiguration.Builder httpClientConfigBuilder = new HttpClientConfiguration.Builder(); @@ -611,17 +627,26 @@ public static class Builder { * Credentials setter for BasicAuth. * @param basicAuthUserName String value for basicAuthUserName. * @param basicAuthPassword String value for basicAuthPassword. - * @return Builder + * @deprecated This builder method is deprecated. + * Use {@link #basicAuthCredentials(BasicAuthModel) basicAuthCredentials} instead. + * @return The current instance of builder. */ + @Deprecated public Builder basicAuthCredentials(String basicAuthUserName, String basicAuthPassword) { - if (basicAuthUserName == null) { - throw new NullPointerException("BasicAuthUserName cannot be null."); - } - if (basicAuthPassword == null) { - throw new NullPointerException("BasicAuthPassword cannot be null."); - } - this.basicAuthUserName = basicAuthUserName; - this.basicAuthPassword = basicAuthPassword; + basicAuthModel = basicAuthModel.toBuilder() + .username(basicAuthUserName) + .password(basicAuthPassword) + .build(); + return this; + } + + /** + * Credentials setter for BasicAuthCredentials. + * @param basicAuthModel The instance of BasicAuthModel. + * @return The current instance of builder. + */ + public Builder basicAuthCredentials(BasicAuthModel basicAuthModel) { + this.basicAuthModel = basicAuthModel; return this; } @@ -689,7 +714,7 @@ public AdvancedBillingClient build() { httpClient = new OkClient(httpClientConfig.getConfiguration(), compatibilityFactory); return new AdvancedBillingClient(environment, subdomain, domain, httpClient, - httpClientConfig, basicAuthUserName, basicAuthPassword, authentications); + httpClientConfig, basicAuthModel, authentications); } } } \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/Configuration.java b/src/main/java/com/maxio/advancedbilling/Configuration.java index 0ac7466b..af3ca342 100644 --- a/src/main/java/com/maxio/advancedbilling/Configuration.java +++ b/src/main/java/com/maxio/advancedbilling/Configuration.java @@ -6,6 +6,7 @@ package com.maxio.advancedbilling; +import com.maxio.advancedbilling.authentication.BasicAuthModel; import com.maxio.advancedbilling.http.client.ReadonlyHttpClientConfiguration; /** @@ -49,6 +50,12 @@ public interface Configuration { */ BasicAuthCredentials getBasicAuthCredentials(); + /** + * The auth credential model for BasicAuth. + * @return the instance of BasicAuthModel + */ + BasicAuthModel getBasicAuthModel(); + /** * Get base URI by current environment. * @param server Server for which to get the base URI diff --git a/src/main/java/com/maxio/advancedbilling/BasicAuthManager.java b/src/main/java/com/maxio/advancedbilling/authentication/BasicAuthManager.java similarity index 53% rename from src/main/java/com/maxio/advancedbilling/BasicAuthManager.java rename to src/main/java/com/maxio/advancedbilling/authentication/BasicAuthManager.java index ae3ff52a..321a28e7 100644 --- a/src/main/java/com/maxio/advancedbilling/BasicAuthManager.java +++ b/src/main/java/com/maxio/advancedbilling/authentication/BasicAuthManager.java @@ -4,8 +4,10 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -package com.maxio.advancedbilling; +package com.maxio.advancedbilling.authentication; +import com.maxio.advancedbilling.ApiHelper; +import com.maxio.advancedbilling.BasicAuthCredentials; import io.apimatic.core.authentication.HeaderAuth; import java.util.Collections; @@ -14,20 +16,21 @@ */ public class BasicAuthManager extends HeaderAuth implements BasicAuthCredentials { - private String basicAuthUserName; - - private String basicAuthPassword; + /** + * Private instance of the auth model containing the auth credentials. + */ + private BasicAuthModel authModel; /** * Constructor. - * @param username String value for username. - * @param password String value for password. + * @param authModel The data model instance for auth credentials. */ - public BasicAuthManager(String username, String password) { + public BasicAuthManager(BasicAuthModel authModel) { super(Collections.singletonMap("Authorization", - ApiHelper.getBase64EncodedCredentials(username, password))); - this.basicAuthUserName = username; - this.basicAuthPassword = password; + ApiHelper.getBase64EncodedCredentials( + authModel.getUsername(), + authModel.getPassword()))); + this.authModel = authModel; } /** @@ -35,7 +38,7 @@ public BasicAuthManager(String username, String password) { * @return basicAuthUserName */ public String getBasicAuthUserName() { - return basicAuthUserName; + return authModel.getUsername(); } /** @@ -43,7 +46,7 @@ public String getBasicAuthUserName() { * @return basicAuthPassword */ public String getBasicAuthPassword() { - return basicAuthPassword; + return authModel.getPassword(); } /** @@ -63,8 +66,21 @@ public boolean equals(String basicAuthUserName, String basicAuthPassword) { */ @Override public String toString() { - return "BasicAuthManager [" + "basicAuthUserName=" + basicAuthUserName - + ", basicAuthPassword=" + basicAuthPassword + "]"; + return "BasicAuthManager [" + "basicAuthUserName=" + getBasicAuthUserName() + + ", basicAuthPassword=" + getBasicAuthPassword() + "]"; } + /** + * Returns the error message if the auth credentials are not valid. + * @return the auth specific error message. + */ + @Override + public String getErrorMessage() { + String errorMessage = super.getErrorMessage(); + if (errorMessage == null) { + return null; + } + + return "BasicAuth - " + errorMessage; + } } diff --git a/src/main/java/com/maxio/advancedbilling/authentication/BasicAuthModel.java b/src/main/java/com/maxio/advancedbilling/authentication/BasicAuthModel.java new file mode 100644 index 00000000..0e2062b9 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/authentication/BasicAuthModel.java @@ -0,0 +1,110 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.authentication; + +/** + * A data class for Basic Authentication credentials. + */ +public class BasicAuthModel { + private String username; + private String password; + + /** + * A Constructor for BasicAuthModel. + */ + private BasicAuthModel(String username, String password) { + this.username = username; + this.password = password; + } + + /** + * Getter for username. + * @return username The value of Username. + */ + public String getUsername() { + return this.username; + } + + /** + * Getter for password. + * @return password The value of Password. + */ + public String getPassword() { + return this.password; + } + + /** + * Builds a new {@link BasicAuthModel.Builder} object. + * Creates the instance with the state of the current auth model. + * @return a new {@link BasicAuthModel.Builder} object. + */ + public Builder toBuilder() { + return new Builder(getUsername(), getPassword()); + } + + /** + * A Builder class for Basic Authentication credentials. + */ + public static class Builder { + private String username; + private String password; + + /** + * The constructor with required auth credentials. + * @param username The value of Username. + * @param password The value of Password. + */ + public Builder(String username, String password) { + if (username == null) { + throw new NullPointerException("Username cannot be null."); + } + + if (password == null) { + throw new NullPointerException("Password cannot be null."); + } + + this.username = username; + this.password = password; + } + + /** + * Setter for username. + * @param username The value of Username. + * @return Builder The current instance of Builder. + */ + public Builder username(String username) { + if (username == null) { + throw new NullPointerException("Username cannot be null."); + } + + this.username = username; + return this; + } + + /** + * Setter for password. + * @param password The value of Password. + * @return Builder The current instance of Builder. + */ + public Builder password(String password) { + if (password == null) { + throw new NullPointerException("Password cannot be null."); + } + + this.password = password; + return this; + } + + /** + * Builds the instance of BasicAuthModel using the provided credentials. + * @return The instance of BasicAuthModel. + */ + public BasicAuthModel build() { + return new BasicAuthModel(username, password); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java b/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java index c1b39a45..9fd5e83c 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/APIExportsController.java @@ -69,7 +69,8 @@ private ApiCall, ApiException> prepareListExportedProforma .templateParam(param -> param.key("batch_id").value(input.getBatchId()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -116,7 +117,8 @@ private ApiCall, ApiException> prepareListExportedInvoicesRequest( .templateParam(param -> param.key("batch_id").value(input.getBatchId()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -163,7 +165,8 @@ private ApiCall, ApiException> prepareListExportedSubscriptio .templateParam(param -> param.key("batch_id").value(input.getBatchId()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -200,7 +203,8 @@ private ApiCall prepareExportProformaInvoicesReq .server(Server.ENUM_DEFAULT.value()) .path("/api_exports/proforma_invoices.json") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -238,7 +242,8 @@ private ApiCall prepareExportInvoicesRequest() t .server(Server.ENUM_DEFAULT.value()) .path("/api_exports/invoices.json") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -276,7 +281,8 @@ private ApiCall prepareExportSubscriptionsReques .server(Server.ENUM_DEFAULT.value()) .path("/api_exports/subscriptions.json") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -316,7 +322,8 @@ private ApiCall prepareReadProformaInvoicesExpor .templateParam(param -> param.key("batch_id").value(batchId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -356,7 +363,8 @@ private ApiCall prepareReadInvoicesExportRequest .templateParam(param -> param.key("batch_id").value(batchId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -396,7 +404,8 @@ private ApiCall prepareReadSubscriptionsExportRe .templateParam(param -> param.key("batch_id").value(batchId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java b/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java index 48e9d8a5..b2a5efbc 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/AdvanceInvoiceController.java @@ -75,7 +75,8 @@ private ApiCall prepareIssueAdvanceInvoiceRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -120,7 +121,8 @@ private ApiCall prepareReadAdvanceInvoiceRequest( .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -171,7 +173,8 @@ private ApiCall prepareVoidAdvanceInvoiceRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/BaseController.java b/src/main/java/com/maxio/advancedbilling/controllers/BaseController.java index 312ee641..e16edc19 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/BaseController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/BaseController.java @@ -17,7 +17,6 @@ * Base class for all Controllers. */ public abstract class BaseController { - protected final static String AUTHENTICATION_KEY = "global"; protected static final Map> GLOBAL_ERROR_CASES = new HashMap>(); private GlobalConfiguration globalConfig; diff --git a/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java b/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java index 51664cd6..6513385c 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/BillingPortalController.java @@ -84,7 +84,8 @@ private ApiCall prepareEnableBillingPortalForCus .templateParam(param -> param.key("customer_id").value(customerId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -131,7 +132,8 @@ private ApiCall prepareReadBillingPortalLink .templateParam(param -> param.key("customer_id").value(customerId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -181,7 +183,8 @@ private ApiCall prepareResendBillingPortalInvita .templateParam(param -> param.key("customer_id").value(customerId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -226,7 +229,8 @@ private ApiCall prepareRevokeBillingPortalAcces .templateParam(param -> param.key("customer_id").value(customerId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java index ac41bd49..7818adfd 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ComponentsController.java @@ -98,7 +98,8 @@ private ApiCall prepareCreateMeteredComponentRe .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -160,7 +161,8 @@ private ApiCall prepareCreateQuantityBasedCompo .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -216,7 +218,8 @@ private ApiCall prepareCreateOnOffComponentRequ .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -274,7 +277,8 @@ private ApiCall prepareCreatePrepaidUsageCompon .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -334,7 +338,8 @@ private ApiCall prepareCreateEventBasedComponen .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -379,7 +384,8 @@ private ApiCall prepareFindComponentRequest( .queryParam(param -> param.key("handle") .value(handle)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -425,7 +431,8 @@ private ApiCall prepareReadComponentRequest( .templateParam(param -> param.key("component_id").value(componentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -479,7 +486,8 @@ private ApiCall prepareUpdateProductFamilyCompo .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -527,7 +535,8 @@ private ApiCall prepareArchiveComponentRequest( .templateParam(param -> param.key("component_id").value(componentId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -585,7 +594,8 @@ private ApiCall, ApiException> prepareListComponentsRequ .queryParam(param -> param.key("filter[use_site_exchange_rate]") .value(input.getFilterUseSiteExchangeRate()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -631,7 +641,8 @@ private ApiCall prepareUpdateComponentRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -683,7 +694,8 @@ private ApiCall preparePromoteComponentPricePoi .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -740,7 +752,8 @@ private ApiCall, ApiException> prepareListComponentsForP .templateParam(param -> param.key("product_family_id").value(input.getProductFamilyId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -785,7 +798,8 @@ private ApiCall prepareCreateComponen .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -836,7 +850,8 @@ private ApiCall prepareListComponent .templateParam(param -> param.key("component_id").value(input.getComponentId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -881,7 +896,8 @@ private ApiCall prepareBulkCreateCom .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -935,7 +951,8 @@ private ApiCall prepareUpdateComponen .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -982,7 +999,8 @@ private ApiCall prepareArchiveCompone .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1028,7 +1046,8 @@ private ApiCall prepareUnarchiveCompo .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1076,7 +1095,8 @@ private ApiCall prepareCreateCurr .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1125,7 +1145,8 @@ private ApiCall prepareUpdateCurr .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1187,7 +1208,8 @@ private ApiCall prepareListAllC .queryParam(param -> param.key("filter[archived_at]") .value((input.getFilterArchivedAt() != null) ? input.getFilterArchivedAt().value() : null).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java b/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java index dbbcbf99..99633ce9 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/CouponsController.java @@ -88,7 +88,8 @@ private ApiCall prepareCreateCouponRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -152,7 +153,8 @@ private ApiCall, ApiException> prepareListCouponsForProduct .templateParam(param -> param.key("product_family_id").value(input.getProductFamilyId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -200,7 +202,8 @@ private ApiCall prepareFindCouponRequest( .queryParam(param -> param.key("code") .value(code).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -250,7 +253,8 @@ private ApiCall prepareReadCouponRequest( .templateParam(param -> param.key("coupon_id").value(couponId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -303,7 +307,8 @@ private ApiCall prepareUpdateCouponRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -348,7 +353,8 @@ private ApiCall prepareArchiveCouponRequest( .templateParam(param -> param.key("coupon_id").value(couponId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -417,7 +423,8 @@ private ApiCall, ApiException> prepareListCouponsRequest( .queryParam(param -> param.key("filter[use_site_exchange_rate]") .value(input.getFilterUseSiteExchangeRate()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -462,7 +469,8 @@ private ApiCall, ApiException> prepareReadCouponUsageRequest( .templateParam(param -> param.key("coupon_id").value(couponId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -519,7 +527,8 @@ private ApiCall prepareValidateCouponRequest( .queryParam(param -> param.key("product_family_id") .value(productFamilyId).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -571,7 +580,8 @@ private ApiCall prepareCreateOrUpdateCoupo .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -631,7 +641,8 @@ private ApiCall prepareCreateCouponSubcode .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -672,7 +683,8 @@ private ApiCall prepareListCouponSubcodesRequest( .templateParam(param -> param.key("coupon_id").value(input.getCouponId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -720,7 +732,8 @@ private ApiCall prepareUpdateCouponSubcode .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -768,7 +781,8 @@ private ApiCall prepareDeleteCouponSubcodeRequest( .shouldEncode(true)) .templateParam(param -> param.key("subcode").value(subcode) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/CustomFieldsController.java b/src/main/java/com/maxio/advancedbilling/controllers/CustomFieldsController.java index 892f8642..df7ae1dc 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/CustomFieldsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/CustomFieldsController.java @@ -99,7 +99,8 @@ private ApiCall, ApiException> prepareCreateMetafieldsRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -149,7 +150,8 @@ private ApiCall prepareListMetafieldsReque .templateParam(param -> param.key("resource_type").value((input.getResourceType() != null) ? input.getResourceType().value() : null) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -194,7 +196,8 @@ private ApiCall, ApiException> prepareUpdateMetafieldRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -240,7 +243,8 @@ private ApiCall prepareDeleteMetafieldRequest( .value(name).isRequired(false)) .templateParam(param -> param.key("resource_type").value((resourceType != null) ? resourceType.value() : null) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -308,7 +312,8 @@ private ApiCall, ApiException> prepareCreateMetadataRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -357,7 +362,8 @@ private ApiCall prepareListMetadataRequest( .templateParam(param -> param.key("resource_id").value(input.getResourceId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -408,7 +414,8 @@ private ApiCall, ApiException> prepareUpdateMetadataRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -471,7 +478,8 @@ private ApiCall prepareDeleteMetadataRequest( .shouldEncode(true)) .templateParam(param -> param.key("resource_id").value(resourceId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -534,7 +542,8 @@ private ApiCall prepareListMetadataForResourceT .templateParam(param -> param.key("resource_type").value((input.getResourceType() != null) ? input.getResourceType().value() : null) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java b/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java index 7b3535d5..e20a3b09 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/CustomersController.java @@ -85,7 +85,8 @@ private ApiCall prepareCreateCustomerRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -147,7 +148,8 @@ private ApiCall, ApiException> prepareListCustomersReques .queryParam(param -> param.key("q") .value(input.getQ()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -185,7 +187,8 @@ private ApiCall prepareReadCustomerRequest( .templateParam(param -> param.key("id").value(id).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -229,7 +232,8 @@ private ApiCall prepareUpdateCustomerRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -270,7 +274,8 @@ private ApiCall prepareDeleteCustomerRequest( .path("/customers/{id}.json") .templateParam(param -> param.key("id").value(id).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -306,7 +311,8 @@ private ApiCall prepareReadCustomerByReferenceRe .queryParam(param -> param.key("reference") .value(reference)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -343,7 +349,8 @@ private ApiCall, ApiException> prepareListCustomerSub .templateParam(param -> param.key("customer_id").value(customerId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java b/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java index dfc325f2..1dfce3c8 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/EventsBasedBillingSegmentsController.java @@ -81,7 +81,8 @@ private ApiCall prepareCreateSegmentRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -142,7 +143,8 @@ private ApiCall prepareListSegmentsForPriceP .templateParam(param -> param.key("price_point_id").value(input.getPricePointId()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -205,7 +207,8 @@ private ApiCall prepareUpdateSegmentRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -258,7 +261,8 @@ private ApiCall prepareDeleteSegmentRequest( .shouldEncode(true)) .templateParam(param -> param.key("id").value(id).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -317,7 +321,8 @@ private ApiCall prepareBulkCreateSegmentsReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -378,7 +383,8 @@ private ApiCall prepareBulkUpdateSegmentsReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java b/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java index fd828e96..f29952de 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/EventsController.java @@ -101,7 +101,8 @@ private ApiCall, ApiException> prepareListEventsRequest( .queryParam(param -> param.key("end_datetime") .value(input.getEndDatetime()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -152,7 +153,8 @@ private ApiCall, ApiException> prepareListSubscriptionEvents .templateParam(param -> param.key("subscription_id").value(input.getSubscriptionId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -200,7 +202,8 @@ private ApiCall prepareReadEventsCountRequest( .queryParam(param -> param.key("filter") .value(EventType.toValue(input.getFilter())).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java b/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java index 306e78dd..27cebbc6 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/InsightsController.java @@ -62,7 +62,8 @@ private ApiCall prepareReadSiteStatsRequest() throws .server(Server.ENUM_DEFAULT.value()) .path("/stats.json") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -109,7 +110,8 @@ private ApiCall prepareReadMrrRequest( .queryParam(param -> param.key("subscription_id") .value(subscriptionId).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -167,7 +169,8 @@ private ApiCall prepareListMrrMovementsRequest( .queryParam(param -> param.key("direction") .value((input.getDirection() != null) ? input.getDirection().value() : null).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -216,7 +219,8 @@ private ApiCall prepareListMrrPerSubscrip .queryParam(param -> param.key("direction") .value((input.getDirection() != null) ? input.getDirection().value() : null).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java b/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java index 0e452859..4eb8b592 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java @@ -31,8 +31,8 @@ import com.maxio.advancedbilling.models.ListInvoicesInput; import com.maxio.advancedbilling.models.ListInvoicesResponse; import com.maxio.advancedbilling.models.MultiInvoicePaymentResponse; -import com.maxio.advancedbilling.models.PaymentResponse; import com.maxio.advancedbilling.models.RecordPaymentRequest; +import com.maxio.advancedbilling.models.RecordPaymentResponse; import com.maxio.advancedbilling.models.RefundInvoiceRequest; import com.maxio.advancedbilling.models.SendInvoiceRequest; import com.maxio.advancedbilling.models.VoidInvoiceRequest; @@ -91,7 +91,8 @@ private ApiCall prepareRefundInvoiceRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -176,7 +177,8 @@ private ApiCall prepareListInvoicesRequest( .queryParam(param -> param.key("sort") .value((input.getSort() != null) ? input.getSort().value() : "number").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -214,7 +216,8 @@ private ApiCall prepareReadInvoiceRequest( .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -271,7 +274,8 @@ private ApiCall prepareListInvoiceEvent .queryParam(param -> param.key("event_types") .value(InvoiceEventType.toValue(input.getEventTypes())).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -333,7 +337,8 @@ private ApiCall prepareRecordPaymentForInvoiceRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -382,7 +387,8 @@ private ApiCall prepareRecordPaymentF .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -439,7 +445,8 @@ private ApiCall prepareListCreditNotesReq .queryParam(param -> param.key("applications") .value(input.getApplications()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -476,7 +483,8 @@ private ApiCall prepareReadCreditNoteRequest( .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -496,11 +504,11 @@ private ApiCall prepareReadCreditNoteRequest( * subscriptions may be paid using the "bulk" payment request. * @param subscriptionId Required parameter: The Chargify id of the subscription * @param body Optional parameter: Example: - * @return Returns the PaymentResponse response from the API call + * @return Returns the RecordPaymentResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public PaymentResponse recordPaymentForSubscription( + public RecordPaymentResponse recordPaymentForSubscription( final int subscriptionId, final RecordPaymentRequest body) throws ApiException, IOException { return prepareRecordPaymentForSubscriptionRequest(subscriptionId, body).execute(); @@ -509,10 +517,10 @@ public PaymentResponse recordPaymentForSubscription( /** * Builds the ApiCall object for recordPaymentForSubscription. */ - private ApiCall prepareRecordPaymentForSubscriptionRequest( + private ApiCall prepareRecordPaymentForSubscriptionRequest( final int subscriptionId, final RecordPaymentRequest body) throws JsonProcessingException, IOException { - return new ApiCall.Builder() + return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) @@ -524,11 +532,12 @@ private ApiCall prepareRecordPaymentForSubscripti .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( - response -> ApiHelper.deserialize(response, PaymentResponse.class)) + response -> ApiHelper.deserialize(response, RecordPaymentResponse.class)) .nullify404(false) .localErrorCase("422", ErrorCase.setTemplate("HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.", @@ -576,7 +585,8 @@ private ApiCall prepareReopenInvoiceRequest( .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -629,7 +639,8 @@ private ApiCall prepareVoidInvoiceRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -679,7 +690,8 @@ private ApiCall prepareListConsolidatedInvoic .templateParam(param -> param.key("invoice_uid").value(input.getInvoiceUid()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -790,7 +802,8 @@ private ApiCall prepareCreateInvoiceRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -846,7 +859,8 @@ private ApiCall prepareSendInvoiceRequest( .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -889,7 +903,8 @@ private ApiCall preparePreviewCust .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -937,7 +952,8 @@ private ApiCall prepareUpdateCustomerInformationRequest( .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1006,7 +1022,8 @@ private ApiCall prepareIssueInvoiceRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java b/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java index fbcd8be5..e6cd3985 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/OffersController.java @@ -70,7 +70,8 @@ private ApiCall prepareCreateOfferRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -114,7 +115,8 @@ private ApiCall prepareListOffersRequest( .queryParam(param -> param.key("include_archived") .value(input.getIncludeArchived()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -152,7 +154,8 @@ private ApiCall prepareReadOfferRequest( .templateParam(param -> param.key("offer_id").value(offerId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -187,7 +190,8 @@ private ApiCall prepareArchiveOfferRequest( .path("/offers/{offer_id}/archive.json") .templateParam(param -> param.key("offer_id").value(offerId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -221,7 +225,8 @@ private ApiCall prepareUnarchiveOfferRequest( .path("/offers/{offer_id}/unarchive.json") .templateParam(param -> param.key("offer_id").value(offerId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .nullify404(false) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java b/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java index be4a553a..07dd8dcc 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/PaymentProfilesController.java @@ -199,7 +199,8 @@ private ApiCall prepareCreatePaymentProfil .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -248,7 +249,8 @@ private ApiCall, ApiException> prepareListPaymentPr .queryParam(param -> param.key("customer_id") .value(input.getCustomerId()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -296,7 +298,8 @@ private ApiCall prepareReadPaymentProfileR .templateParam(param -> param.key("payment_profile_id").value(paymentProfileId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -364,7 +367,8 @@ private ApiCall prepareUpdatePaymentProfil .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -406,7 +410,8 @@ private ApiCall prepareDeleteUnusedPaymentProfileRequest( .path("/payment_profiles/{payment_profile_id}.json") .templateParam(param -> param.key("payment_profile_id").value(paymentProfileId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -456,7 +461,8 @@ private ApiCall prepareDeleteSubscriptionsPaymentProfileRequ .shouldEncode(true)) .templateParam(param -> param.key("payment_profile_id").value(paymentProfileId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -499,7 +505,8 @@ private ApiCall prepareVerifyBankAccountReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -547,7 +554,8 @@ private ApiCall prepareDeleteSubscriptionGroupPaymentProfile .shouldEncode(true)) .templateParam(param -> param.key("payment_profile_id").value(paymentProfileId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -590,7 +598,8 @@ private ApiCall prepareChangeSubscriptionD .templateParam(param -> param.key("payment_profile_id").value(paymentProfileId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -643,7 +652,8 @@ private ApiCall prepareChangeSubscriptionG .templateParam(param -> param.key("payment_profile_id").value(paymentProfileId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -687,7 +697,8 @@ private ApiCall prepareReadOneTimeTokenReq .templateParam(param -> param.key("chargify_token").value(chargifyToken) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -735,7 +746,8 @@ private ApiCall prepareSendRequestUpdatePaymentEmailRequest( .path("/subscriptions/{subscription_id}/request_payment_profiles_update.json") .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java index 62fa0e72..05295682 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProductFamiliesController.java @@ -84,7 +84,8 @@ private ApiCall, ApiException> prepareListProductsForProdu .templateParam(param -> param.key("product_family_id").value(input.getProductFamilyId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -130,7 +131,8 @@ private ApiCall prepareCreateProductFamilyR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -178,7 +180,8 @@ private ApiCall, ApiException> prepareListProductFam .queryParam(param -> param.key("end_datetime") .value(input.getEndDatetime()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -218,7 +221,8 @@ private ApiCall prepareReadProductFamilyReq .templateParam(param -> param.key("id").value(id).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java index 593e42ad..002f706b 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java @@ -88,7 +88,8 @@ private ApiCall prepareCreateProductPri .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -136,7 +137,8 @@ private ApiCall prepareListProduct .templateParam(param -> param.key("product_id").value(input.getProductId()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -188,7 +190,8 @@ private ApiCall prepareUpdateProductPri .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -243,7 +246,8 @@ private ApiCall prepareReadProductPrice .templateParam(param -> param.key("price_point_id").value(pricePointId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -287,7 +291,8 @@ private ApiCall prepareArchiveProductPr .templateParam(param -> param.key("price_point_id").value(pricePointId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -333,7 +338,8 @@ private ApiCall prepareUnarchiveProduct .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PATCH)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -377,7 +383,8 @@ private ApiCall preparePromoteProductPricePointTo .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PATCH)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -422,7 +429,8 @@ private ApiCall prepareBulkC .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -473,7 +481,8 @@ private ApiCall prepareCreateProductCurren .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -524,7 +533,8 @@ private ApiCall prepareUpdateProductCurren .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -586,7 +596,8 @@ private ApiCall prepareListAllProd .queryParam(param -> param.key("per_page") .value(input.getPerPage()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java index 5e2f2901..67cec11e 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProductsController.java @@ -72,7 +72,8 @@ private ApiCall prepareCreateProductRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -113,7 +114,8 @@ private ApiCall prepareReadProductRequest( .templateParam(param -> param.key("product_id").value(productId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -161,7 +163,8 @@ private ApiCall prepareUpdateProductRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -204,7 +207,8 @@ private ApiCall prepareArchiveProductRequest( .templateParam(param -> param.key("product_id").value(productId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -244,7 +248,8 @@ private ApiCall prepareReadProductByHandleRequest .templateParam(param -> param.key("api_handle").value(apiHandle) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -301,7 +306,8 @@ private ApiCall, ApiException> prepareListProductsRequest( .queryParam(param -> param.key("filter[use_site_exchange_rate]") .value(input.getFilterUseSiteExchangeRate()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java index eaab2fa1..4b9277c2 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProformaInvoicesController.java @@ -16,6 +16,7 @@ import com.maxio.advancedbilling.http.request.HttpMethod; import com.maxio.advancedbilling.models.CreateSubscriptionRequest; import com.maxio.advancedbilling.models.ListProformaInvoicesInput; +import com.maxio.advancedbilling.models.ListProformaInvoicesResponse; import com.maxio.advancedbilling.models.ProformaInvoice; import com.maxio.advancedbilling.models.ProformaInvoicePreview; import com.maxio.advancedbilling.models.SignupProformaPreviewResponse; @@ -25,7 +26,6 @@ import io.apimatic.core.GlobalConfiguration; import io.apimatic.coreinterfaces.http.request.ArraySerializationFormat; import java.io.IOException; -import java.util.List; /** * This class lists all the endpoints of the groups. @@ -70,7 +70,8 @@ private ApiCall prepareCreateConsolidatedProformaInvoiceRequ .path("/subscription_groups/{uid}/proforma_invoices.json") .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -111,7 +112,8 @@ private ApiCall prepareListSubscriptionGroupProfo .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -135,7 +137,7 @@ private ApiCall prepareListSubscriptionGroupProfo * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ProformaInvoice readProformaInvoice( - final int proformaInvoiceUid) throws ApiException, IOException { + final String proformaInvoiceUid) throws ApiException, IOException { return prepareReadProformaInvoiceRequest(proformaInvoiceUid).execute(); } @@ -143,16 +145,17 @@ public ProformaInvoice readProformaInvoice( * Builds the ApiCall object for readProformaInvoice. */ private ApiCall prepareReadProformaInvoiceRequest( - final int proformaInvoiceUid) throws IOException { + final String proformaInvoiceUid) throws IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) .path("/proforma_invoices/{proforma_invoice_uid}.json") - .templateParam(param -> param.key("proforma_invoice_uid").value(proformaInvoiceUid).isRequired(false) + .templateParam(param -> param.key("proforma_invoice_uid").value(proformaInvoiceUid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -197,7 +200,8 @@ private ApiCall prepareCreateProformaInvoiceReque .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -218,11 +222,11 @@ private ApiCall prepareCreateProformaInvoiceReque * To include breakdowns, pass the specific field as a key in the query with a value set to * `true`. * @param input ListProformaInvoicesInput object containing request parameters - * @return Returns the List of ProformaInvoice response from the API call + * @return Returns the ListProformaInvoicesResponse response from the API call * @throws ApiException Represents error response from the server. * @throws IOException Signals that an I/O exception of some sort has occurred. */ - public List listProformaInvoices( + public ListProformaInvoicesResponse listProformaInvoices( final ListProformaInvoicesInput input) throws ApiException, IOException { return prepareListProformaInvoicesRequest(input).execute(); } @@ -230,9 +234,9 @@ public List listProformaInvoices( /** * Builds the ApiCall object for listProformaInvoices. */ - private ApiCall, ApiException> prepareListProformaInvoicesRequest( + private ApiCall prepareListProformaInvoicesRequest( final ListProformaInvoicesInput input) throws IOException { - return new ApiCall.Builder, ApiException>() + return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) @@ -264,12 +268,12 @@ private ApiCall, ApiException> prepareListProformaInvoices .templateParam(param -> param.key("subscription_id").value(input.getSubscriptionId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( - response -> ApiHelper.deserializeArray(response, - ProformaInvoice[].class)) + response -> ApiHelper.deserialize(response, ListProformaInvoicesResponse.class)) .nullify404(false) .globalErrorCase(GLOBAL_ERROR_CASES)) .endpointConfiguration(param -> param @@ -314,7 +318,8 @@ private ApiCall prepareVoidProformaInvoiceRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -368,7 +373,8 @@ private ApiCall preparePreviewProformaInvo .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -422,7 +428,8 @@ private ApiCall prepareCreateSignupProformaInvoic .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -482,7 +489,8 @@ private ApiCall preparePreviewSignu .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java index a520dc6f..47cc1a4b 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ReasonCodesController.java @@ -72,7 +72,8 @@ private ApiCall prepareCreateReasonCodeRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -115,7 +116,8 @@ private ApiCall, ApiException> prepareListReasonCodesRe .queryParam(param -> param.key("per_page") .value(input.getPerPage()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -154,7 +156,8 @@ private ApiCall prepareReadReasonCodeRequest( .templateParam(param -> param.key("reason_code_id").value(reasonCodeId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -201,7 +204,8 @@ private ApiCall prepareUpdateReasonCodeRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -242,7 +246,8 @@ private ApiCall prepareDeleteReasonCodeRe .templateParam(param -> param.key("reason_code_id").value(reasonCodeId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java b/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java index e30f27aa..7efd1061 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ReferralCodesController.java @@ -62,7 +62,8 @@ private ApiCall prepareValidateReferra .queryParam(param -> param.key("code") .value(code)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java index bdbe015e..1240b514 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SalesCommissionsController.java @@ -78,7 +78,8 @@ private ApiCall, ApiException> prepareListSalesCommissionS .headerParam(param -> param.key("Authorization") .value(input.getAuthorization()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -134,7 +135,8 @@ private ApiCall, ApiException> prepareListSalesRepsRequest .headerParam(param -> param.key("Authorization") .value(input.getAuthorization()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -217,7 +219,8 @@ private ApiCall prepareReadSalesRepRequest( .headerParam(param -> param.key("Authorization") .value((authorization != null) ? authorization : "Bearer <>").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java b/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java index be0780ea..0e1ba76e 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SitesController.java @@ -60,7 +60,8 @@ private ApiCall prepareReadSiteRequest() throws IOEx .server(Server.ENUM_DEFAULT.value()) .path("/site.json") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -102,7 +103,8 @@ private ApiCall prepareClearSiteRequest( .path("/sites/clear_data.json") .queryParam(param -> param.key("cleanup_scope") .value((cleanupScope != null) ? cleanupScope.value() : "all").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -139,7 +141,8 @@ private ApiCall prepareListChargifyJsPubli .queryParam(param -> param.key("per_page") .value(input.getPerPage()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java index f214efb8..2211b70c 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionComponentsController.java @@ -86,7 +86,8 @@ private ApiCall prepareReadSubscrip .templateParam(param -> param.key("component_id").value(componentId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -152,7 +153,8 @@ private ApiCall, ApiException> prepareListSu .templateParam(param -> param.key("subscription_id").value(input.getSubscriptionId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -200,7 +202,8 @@ private ApiCall prepareBulkUpd .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -242,7 +245,8 @@ private ApiCall prepareBulkResetSubscription .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -332,7 +336,8 @@ private ApiCall prepareAllocateComponentReques .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -394,7 +399,8 @@ private ApiCall, ApiException> prepareListAllocationsRe .templateParam(param -> param.key("component_id").value(componentId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -450,7 +456,8 @@ private ApiCall, ApiException> prepareAllocateComponent .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -509,7 +516,8 @@ private ApiCall preparePreviewAllocatio .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -574,7 +582,8 @@ private ApiCall prepareUpdatePrepaidUsageAllocationExpiratio .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -638,7 +647,8 @@ private ApiCall prepareDeletePrepaidUsageAllocationRequest( .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -721,7 +731,8 @@ private ApiCall prepareCreateUsageRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -783,7 +794,8 @@ private ApiCall, ApiException> prepareListUsagesRequest( .templateParam(param -> param.key("component_id").value(input.getComponentId()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -832,7 +844,8 @@ private ApiCall prepareActivateEventBasedComponentRequest( .shouldEncode(true)) .templateParam(param -> param.key("component_id").value(componentId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -872,7 +885,8 @@ private ApiCall prepareDeactivateEventBasedComponentRequest( .shouldEncode(true)) .templateParam(param -> param.key("component_id").value(componentId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -933,7 +947,8 @@ private ApiCall prepareRecordEventRequest( .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -988,7 +1003,8 @@ private ApiCall prepareBulkRecordEventsRequest( .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -1063,7 +1079,8 @@ private ApiCall prepareListSub .queryParam(param -> param.key("filter[subscription][end_datetime]") .value(input.getFilterSubscriptionEndDatetime()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupInvoiceAccountController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupInvoiceAccountController.java index 5bbeba5a..718a1477 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupInvoiceAccountController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupInvoiceAccountController.java @@ -74,7 +74,8 @@ private ApiCall prepareCreate .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -124,7 +125,8 @@ private ApiCall prepareLi .templateParam(param -> param.key("uid").value(input.getUid()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -173,7 +175,8 @@ private ApiCall prepareIssueSubscriptionGro .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -221,7 +224,8 @@ private ApiCall prepareDeductSubscriptionGroupServi .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupStatusController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupStatusController.java index 84e6a416..4d47593b 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupStatusController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupStatusController.java @@ -69,7 +69,8 @@ private ApiCall prepareCancelSubscriptionsInGroupRequest( .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -108,7 +109,8 @@ private ApiCall prepareInitiateDelayedCancellationForGroupRe .path("/subscription_groups/{uid}/delayed_cancel.json") .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -146,7 +148,8 @@ private ApiCall prepareCancelDelayedCancellationForGroupRequ .path("/subscription_groups/{uid}/delayed_cancel.json") .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -214,7 +217,8 @@ private ApiCall prepareReacti .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java index cf6515ae..666a6157 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionGroupsController.java @@ -78,7 +78,8 @@ private ApiCall prepareSignupWith .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -120,7 +121,8 @@ private ApiCall prepareCreateSubscripti .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -168,7 +170,8 @@ private ApiCall prepareListSubscri .queryParam(param -> param.key("include") .value(input.getInclude()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -208,7 +211,8 @@ private ApiCall prepareReadSubscrip .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -255,7 +259,8 @@ private ApiCall prepareUpdateSubscripti .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -295,7 +300,8 @@ private ApiCall prepareDeleteSubs .templateParam(param -> param.key("uid").value(uid) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -337,7 +343,8 @@ private ApiCall prepareFindSubscrip .queryParam(param -> param.key("subscription_id") .value(subscriptionId)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -403,7 +410,8 @@ private ApiCall prepareAddSubscriptionT .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -441,7 +449,8 @@ private ApiCall prepareRemoveSubscriptionFromGroupRequest( .path("/subscriptions/{subscription_id}/group.json") .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java index 0a690966..d6493c2a 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java @@ -70,7 +70,8 @@ private ApiCall prepareReadAccountBalancesRequest .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -118,7 +119,8 @@ private ApiCall prepareCreatePrepaymentR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -165,7 +167,8 @@ private ApiCall prepareListPrepaymentsRequest .templateParam(param -> param.key("subscription_id").value(input.getSubscriptionId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -213,7 +216,8 @@ private ApiCall prepareIssueServiceCreditRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -256,7 +260,8 @@ private ApiCall prepareDeductServiceCreditRequest( .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -309,7 +314,8 @@ private ApiCall prepareRefundPrepaymentRequest .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java index 87453021..b11d0db6 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionNotesController.java @@ -69,7 +69,8 @@ private ApiCall prepareCreateSubscriptio .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -111,7 +112,8 @@ private ApiCall, ApiException> prepareListSubscri .templateParam(param -> param.key("subscription_id").value(input.getSubscriptionId()).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -155,7 +157,8 @@ private ApiCall prepareReadSubscriptionN .templateParam(param -> param.key("note_id").value(noteId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -204,7 +207,8 @@ private ApiCall prepareUpdateSubscriptio .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -244,7 +248,8 @@ private ApiCall prepareDeleteSubscriptionNoteRequest( .shouldEncode(true)) .templateParam(param -> param.key("note_id").value(noteId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .nullify404(false) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java index e41c7344..bc65f5cf 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionProductsController.java @@ -119,7 +119,8 @@ private ApiCall prepareMigrateSubscriptionPr .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -170,7 +171,8 @@ private ApiCall preparePrevi .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java index 6634a6f2..3ceda14e 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionStatusController.java @@ -67,7 +67,8 @@ private ApiCall prepareRetrySubscriptionRequ .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -115,7 +116,8 @@ private ApiCall prepareCancelSubscriptionReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -167,7 +169,8 @@ private ApiCall prepareResumeSubscriptionReq .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -215,7 +218,8 @@ private ApiCall preparePauseSubscriptionRequ .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -266,7 +270,8 @@ private ApiCall prepareUpdateAutomaticSubscr .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -381,7 +386,8 @@ private ApiCall prepareReactivateSubscriptio .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -431,7 +437,8 @@ private ApiCall prepareInitiateDelaye .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -474,7 +481,8 @@ private ApiCall prepareCancelDelayedC .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -515,7 +523,8 @@ private ApiCall prepareCancelDunningRequest( .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -579,7 +588,8 @@ private ApiCall preparePreviewRenewalReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java index 2fba0146..845c4b3f 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionsController.java @@ -438,7 +438,8 @@ private ApiCall prepareCreateSubscriptionReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -511,7 +512,8 @@ private ApiCall, ApiException> prepareListSubscriptio .queryParam(param -> param.key("include[]") .value(SubscriptionListInclude.toValue(input.getInclude())).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -595,7 +597,8 @@ private ApiCall prepareUpdateSubscriptionReq .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -643,7 +646,8 @@ private ApiCall prepareReadSubscriptionReque .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -705,7 +709,8 @@ private ApiCall prepareOverrideSubscriptionRequest( .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -743,7 +748,8 @@ private ApiCall prepareFindSubscriptionReque .queryParam(param -> param.key("reference") .value(reference).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -795,7 +801,8 @@ private ApiCall preparePurgeSubscriptionRequest( .value(SubscriptionPurgeType.toValue(cascade)).isRequired(false)) .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .nullify404(false) @@ -837,7 +844,8 @@ private ApiCall prepareUpdatePrepaid .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -897,7 +905,8 @@ private ApiCall preparePreviewSubscri .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -956,7 +965,8 @@ private ApiCall prepareApplyCouponsToSubscri .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1002,7 +1012,8 @@ private ApiCall prepareRemoveCouponFromSubscriptionRequest .value(couponCode).isRequired(false)) .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.DELETE)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -1073,7 +1084,8 @@ private ApiCall prepareActivateSubscriptionR .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java b/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java index 2be03f43..61ebedf9 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/WebhooksController.java @@ -92,7 +92,8 @@ private ApiCall, ApiException> prepareListWebhooksRequest( .queryParam(param -> param.key("subscription") .value(input.getSubscription()).isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -132,7 +133,8 @@ private ApiCall prepareEnableWebhooksReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -173,7 +175,8 @@ private ApiCall prepareReplayWebhooksReque .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -214,7 +217,8 @@ private ApiCall prepareCreateEndpointRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.POST)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -249,7 +253,8 @@ private ApiCall, ApiException> prepareListEndpointsRequest() thro .server(Server.ENUM_DEFAULT.value()) .path("/endpoints.json") .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.GET)) .responseHandler(responseHandler -> responseHandler .deserializer( @@ -302,7 +307,8 @@ private ApiCall prepareUpdateEndpointRequest( .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) .headerParam(param -> param.key("accept").value("application/json")) - .authenticationKey(BaseController.AUTHENTICATION_KEY) + .withAuth(auth -> auth + .add("BasicAuth")) .httpMethod(HttpMethod.PUT)) .responseHandler(responseHandler -> responseHandler .deserializer( diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java index bce25402..382c913b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateOrUpdateProduct.java @@ -22,6 +22,12 @@ public class CreateOrUpdateProduct { private long priceInCents; private int interval; private IntervalUnit intervalUnit; + private Long trialPriceInCents; + private Integer trialInterval; + private IntervalUnit trialIntervalUnit; + private String trialType; + private Integer expirationInterval; + private IntervalUnit expirationIntervalUnit; private Boolean autoCreateSignupPage; private String taxCode; @@ -41,6 +47,12 @@ public CreateOrUpdateProduct() { * @param handle String value for handle. * @param accountingCode String value for accountingCode. * @param requireCreditCard Boolean value for requireCreditCard. + * @param trialPriceInCents Long value for trialPriceInCents. + * @param trialInterval Integer value for trialInterval. + * @param trialIntervalUnit IntervalUnit value for trialIntervalUnit. + * @param trialType String value for trialType. + * @param expirationInterval Integer value for expirationInterval. + * @param expirationIntervalUnit IntervalUnit value for expirationIntervalUnit. * @param autoCreateSignupPage Boolean value for autoCreateSignupPage. * @param taxCode String value for taxCode. */ @@ -53,6 +65,12 @@ public CreateOrUpdateProduct( String handle, String accountingCode, Boolean requireCreditCard, + Long trialPriceInCents, + Integer trialInterval, + IntervalUnit trialIntervalUnit, + String trialType, + Integer expirationInterval, + IntervalUnit expirationIntervalUnit, Boolean autoCreateSignupPage, String taxCode) { this.name = name; @@ -63,6 +81,12 @@ public CreateOrUpdateProduct( this.priceInCents = priceInCents; this.interval = interval; this.intervalUnit = intervalUnit; + this.trialPriceInCents = trialPriceInCents; + this.trialInterval = trialInterval; + this.trialIntervalUnit = trialIntervalUnit; + this.trialType = trialType; + this.expirationInterval = expirationInterval; + this.expirationIntervalUnit = expirationIntervalUnit; this.autoCreateSignupPage = autoCreateSignupPage; this.taxCode = taxCode; } @@ -234,6 +258,134 @@ public void setIntervalUnit(IntervalUnit intervalUnit) { this.intervalUnit = intervalUnit; } + /** + * Getter for TrialPriceInCents. + * The product trial price, in integer cents + * @return Returns the Long + */ + @JsonGetter("trial_price_in_cents") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Long getTrialPriceInCents() { + return trialPriceInCents; + } + + /** + * Setter for TrialPriceInCents. + * The product trial price, in integer cents + * @param trialPriceInCents Value for Long + */ + @JsonSetter("trial_price_in_cents") + public void setTrialPriceInCents(Long trialPriceInCents) { + this.trialPriceInCents = trialPriceInCents; + } + + /** + * Getter for TrialInterval. + * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product trial would last 30 days. + * @return Returns the Integer + */ + @JsonGetter("trial_interval") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTrialInterval() { + return trialInterval; + } + + /** + * Setter for TrialInterval. + * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product trial would last 30 days. + * @param trialInterval Value for Integer + */ + @JsonSetter("trial_interval") + public void setTrialInterval(Integer trialInterval) { + this.trialInterval = trialInterval; + } + + /** + * Getter for TrialIntervalUnit. + * A string representing the trial interval unit for this product, either month or day + * @return Returns the IntervalUnit + */ + @JsonGetter("trial_interval_unit") + @JsonInclude(JsonInclude.Include.NON_NULL) + public IntervalUnit getTrialIntervalUnit() { + return trialIntervalUnit; + } + + /** + * Setter for TrialIntervalUnit. + * A string representing the trial interval unit for this product, either month or day + * @param trialIntervalUnit Value for IntervalUnit + */ + @JsonSetter("trial_interval_unit") + public void setTrialIntervalUnit(IntervalUnit trialIntervalUnit) { + this.trialIntervalUnit = trialIntervalUnit; + } + + /** + * Getter for TrialType. + * @return Returns the String + */ + @JsonGetter("trial_type") + @JsonInclude(JsonInclude.Include.NON_NULL) + public String getTrialType() { + return trialType; + } + + /** + * Setter for TrialType. + * @param trialType Value for String + */ + @JsonSetter("trial_type") + public void setTrialType(String trialType) { + this.trialType = trialType; + } + + /** + * Getter for ExpirationInterval. + * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * expiration_interval_unit of day would mean this product would expire after 30 days. + * @return Returns the Integer + */ + @JsonGetter("expiration_interval") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getExpirationInterval() { + return expirationInterval; + } + + /** + * Setter for ExpirationInterval. + * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an + * expiration_interval_unit of day would mean this product would expire after 30 days. + * @param expirationInterval Value for Integer + */ + @JsonSetter("expiration_interval") + public void setExpirationInterval(Integer expirationInterval) { + this.expirationInterval = expirationInterval; + } + + /** + * Getter for ExpirationIntervalUnit. + * A string representing the expiration interval unit for this product, either month or day + * @return Returns the IntervalUnit + */ + @JsonGetter("expiration_interval_unit") + @JsonInclude(JsonInclude.Include.NON_NULL) + public IntervalUnit getExpirationIntervalUnit() { + return expirationIntervalUnit; + } + + /** + * Setter for ExpirationIntervalUnit. + * A string representing the expiration interval unit for this product, either month or day + * @param expirationIntervalUnit Value for IntervalUnit + */ + @JsonSetter("expiration_interval_unit") + public void setExpirationIntervalUnit(IntervalUnit expirationIntervalUnit) { + this.expirationIntervalUnit = expirationIntervalUnit; + } + /** * Getter for AutoCreateSignupPage. * @return Returns the Boolean @@ -287,8 +439,11 @@ public String toString() { return "CreateOrUpdateProduct [" + "name=" + name + ", description=" + description + ", priceInCents=" + priceInCents + ", interval=" + interval + ", intervalUnit=" + intervalUnit + ", handle=" + handle + ", accountingCode=" + accountingCode - + ", requireCreditCard=" + requireCreditCard + ", autoCreateSignupPage=" - + autoCreateSignupPage + ", taxCode=" + taxCode + "]"; + + ", requireCreditCard=" + requireCreditCard + ", trialPriceInCents=" + + trialPriceInCents + ", trialInterval=" + trialInterval + ", trialIntervalUnit=" + + trialIntervalUnit + ", trialType=" + trialType + ", expirationInterval=" + + expirationInterval + ", expirationIntervalUnit=" + expirationIntervalUnit + + ", autoCreateSignupPage=" + autoCreateSignupPage + ", taxCode=" + taxCode + "]"; } /** @@ -301,6 +456,12 @@ public Builder toBuilder() { .handle(getHandle()) .accountingCode(getAccountingCode()) .requireCreditCard(getRequireCreditCard()) + .trialPriceInCents(getTrialPriceInCents()) + .trialInterval(getTrialInterval()) + .trialIntervalUnit(getTrialIntervalUnit()) + .trialType(getTrialType()) + .expirationInterval(getExpirationInterval()) + .expirationIntervalUnit(getExpirationIntervalUnit()) .autoCreateSignupPage(getAutoCreateSignupPage()) .taxCode(getTaxCode()); return builder; @@ -318,6 +479,12 @@ public static class Builder { private String handle; private String accountingCode; private Boolean requireCreditCard; + private Long trialPriceInCents; + private Integer trialInterval; + private IntervalUnit trialIntervalUnit; + private String trialType; + private Integer expirationInterval; + private IntervalUnit expirationIntervalUnit; private Boolean autoCreateSignupPage; private String taxCode; @@ -424,6 +591,66 @@ public Builder requireCreditCard(Boolean requireCreditCard) { return this; } + /** + * Setter for trialPriceInCents. + * @param trialPriceInCents Long value for trialPriceInCents. + * @return Builder + */ + public Builder trialPriceInCents(Long trialPriceInCents) { + this.trialPriceInCents = trialPriceInCents; + return this; + } + + /** + * Setter for trialInterval. + * @param trialInterval Integer value for trialInterval. + * @return Builder + */ + public Builder trialInterval(Integer trialInterval) { + this.trialInterval = trialInterval; + return this; + } + + /** + * Setter for trialIntervalUnit. + * @param trialIntervalUnit IntervalUnit value for trialIntervalUnit. + * @return Builder + */ + public Builder trialIntervalUnit(IntervalUnit trialIntervalUnit) { + this.trialIntervalUnit = trialIntervalUnit; + return this; + } + + /** + * Setter for trialType. + * @param trialType String value for trialType. + * @return Builder + */ + public Builder trialType(String trialType) { + this.trialType = trialType; + return this; + } + + /** + * Setter for expirationInterval. + * @param expirationInterval Integer value for expirationInterval. + * @return Builder + */ + public Builder expirationInterval(Integer expirationInterval) { + this.expirationInterval = expirationInterval; + return this; + } + + /** + * Setter for expirationIntervalUnit. + * @param expirationIntervalUnit IntervalUnit value for expirationIntervalUnit. + * @return Builder + */ + public Builder expirationIntervalUnit(IntervalUnit expirationIntervalUnit) { + this.expirationIntervalUnit = expirationIntervalUnit; + return this; + } + /** * Setter for autoCreateSignupPage. * @param autoCreateSignupPage Boolean value for autoCreateSignupPage. @@ -450,8 +677,9 @@ public Builder taxCode(String taxCode) { */ public CreateOrUpdateProduct build() { return new CreateOrUpdateProduct(name, description, priceInCents, interval, - intervalUnit, handle, accountingCode, requireCreditCard, autoCreateSignupPage, - taxCode); + intervalUnit, handle, accountingCode, requireCreditCard, trialPriceInCents, + trialInterval, trialIntervalUnit, trialType, expirationInterval, + expirationIntervalUnit, autoCreateSignupPage, taxCode); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePayment.java b/src/main/java/com/maxio/advancedbilling/models/CreatePayment.java index f2fb67bf..15540658 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreatePayment.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePayment.java @@ -16,7 +16,7 @@ public class CreatePayment { private String amount; private String memo; private String paymentDetails; - private String paymentMethod; + private InvoicePaymentMethodType paymentMethod; /** * Default constructor. @@ -29,13 +29,13 @@ public CreatePayment() { * @param amount String value for amount. * @param memo String value for memo. * @param paymentDetails String value for paymentDetails. - * @param paymentMethod String value for paymentMethod. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. */ public CreatePayment( String amount, String memo, String paymentDetails, - String paymentMethod) { + InvoicePaymentMethodType paymentMethod) { this.amount = amount; this.memo = memo; this.paymentDetails = paymentDetails; @@ -98,19 +98,21 @@ public void setPaymentDetails(String paymentDetails) { /** * Getter for PaymentMethod. - * @return Returns the String + * The type of payment method used. Defaults to other. + * @return Returns the InvoicePaymentMethodType */ @JsonGetter("payment_method") - public String getPaymentMethod() { + public InvoicePaymentMethodType getPaymentMethod() { return paymentMethod; } /** * Setter for PaymentMethod. - * @param paymentMethod Value for String + * The type of payment method used. Defaults to other. + * @param paymentMethod Value for InvoicePaymentMethodType */ @JsonSetter("payment_method") - public void setPaymentMethod(String paymentMethod) { + public void setPaymentMethod(InvoicePaymentMethodType paymentMethod) { this.paymentMethod = paymentMethod; } @@ -141,7 +143,7 @@ public static class Builder { private String amount; private String memo; private String paymentDetails; - private String paymentMethod; + private InvoicePaymentMethodType paymentMethod; /** * Initialization constructor. @@ -154,9 +156,10 @@ public Builder() { * @param amount String value for amount. * @param memo String value for memo. * @param paymentDetails String value for paymentDetails. - * @param paymentMethod String value for paymentMethod. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. */ - public Builder(String amount, String memo, String paymentDetails, String paymentMethod) { + public Builder(String amount, String memo, String paymentDetails, + InvoicePaymentMethodType paymentMethod) { this.amount = amount; this.memo = memo; this.paymentDetails = paymentDetails; @@ -195,10 +198,10 @@ public Builder paymentDetails(String paymentDetails) { /** * Setter for paymentMethod. - * @param paymentMethod String value for paymentMethod. + * @param paymentMethod InvoicePaymentMethodType value for paymentMethod. * @return Builder */ - public Builder paymentMethod(String paymentMethod) { + public Builder paymentMethod(InvoicePaymentMethodType paymentMethod) { this.paymentMethod = paymentMethod; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java b/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java index 60293b00..5a956b0c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePrepayment.java @@ -17,7 +17,7 @@ public class CreatePrepayment { private double amount; private String details; private String memo; - private PrepaymentMethod method; + private CreatePrepaymentMethod method; private Integer paymentProfileId; /** @@ -31,14 +31,14 @@ public CreatePrepayment() { * @param amount double value for amount. * @param details String value for details. * @param memo String value for memo. - * @param method PrepaymentMethod value for method. + * @param method CreatePrepaymentMethod value for method. * @param paymentProfileId Integer value for paymentProfileId. */ public CreatePrepayment( double amount, String details, String memo, - PrepaymentMethod method, + CreatePrepaymentMethod method, Integer paymentProfileId) { this.amount = amount; this.details = details; @@ -106,10 +106,10 @@ public void setMemo(String memo) { * :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be * collected using the default credit card payment profile and applied to the prepayment account * balance. This is especially useful for manual replenishment of prepaid subscriptions. - * @return Returns the PrepaymentMethod + * @return Returns the CreatePrepaymentMethod */ @JsonGetter("method") - public PrepaymentMethod getMethod() { + public CreatePrepaymentMethod getMethod() { return method; } @@ -118,10 +118,10 @@ public PrepaymentMethod getMethod() { * :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be * collected using the default credit card payment profile and applied to the prepayment account * balance. This is especially useful for manual replenishment of prepaid subscriptions. - * @param method Value for PrepaymentMethod + * @param method Value for CreatePrepaymentMethod */ @JsonSetter("method") - public void setMethod(PrepaymentMethod method) { + public void setMethod(CreatePrepaymentMethod method) { this.method = method; } @@ -172,7 +172,7 @@ public static class Builder { private double amount; private String details; private String memo; - private PrepaymentMethod method; + private CreatePrepaymentMethod method; private Integer paymentProfileId; /** @@ -186,9 +186,9 @@ public Builder() { * @param amount double value for amount. * @param details String value for details. * @param memo String value for memo. - * @param method PrepaymentMethod value for method. + * @param method CreatePrepaymentMethod value for method. */ - public Builder(double amount, String details, String memo, PrepaymentMethod method) { + public Builder(double amount, String details, String memo, CreatePrepaymentMethod method) { this.amount = amount; this.details = details; this.memo = memo; @@ -227,10 +227,10 @@ public Builder memo(String memo) { /** * Setter for method. - * @param method PrepaymentMethod value for method. + * @param method CreatePrepaymentMethod value for method. * @return Builder */ - public Builder method(PrepaymentMethod method) { + public Builder method(CreatePrepaymentMethod method) { this.method = method; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreatePrepaymentMethod.java b/src/main/java/com/maxio/advancedbilling/models/CreatePrepaymentMethod.java new file mode 100644 index 00000000..19533d8e --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/CreatePrepaymentMethod.java @@ -0,0 +1,117 @@ +/* + * 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; + + +/** + * CreatePrepaymentMethod to be used. + */ +public enum CreatePrepaymentMethod { + CHECK, + + CASH, + + MONEY_ORDER, + + ACH, + + PAYPAL_ACCOUNT, + + CREDIT_CARD, + + CREDIT_CARD_ON_FILE, + + OTHER; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + CHECK.value = "check"; + CASH.value = "cash"; + MONEY_ORDER.value = "money_order"; + ACH.value = "ach"; + PAYPAL_ACCOUNT.value = "paypal_account"; + CREDIT_CARD.value = "credit_card"; + CREDIT_CARD_ON_FILE.value = "credit_card_on_file"; + OTHER.value = "other"; + + valueMap.put("check", CHECK); + valueMap.put("cash", CASH); + valueMap.put("money_order", MONEY_ORDER); + valueMap.put("ach", ACH); + valueMap.put("paypal_account", PAYPAL_ACCOUNT); + valueMap.put("credit_card", CREDIT_CARD); + valueMap.put("credit_card_on_file", CREDIT_CARD_ON_FILE); + valueMap.put("other", OTHER); + } + + /** + * 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 CreatePrepaymentMethod constructFromString(String toConvert) throws IOException { + CreatePrepaymentMethod 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 CreatePrepaymentMethod 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 CreatePrepaymentMethod values to list of string values. + * @param toConvert The list of CreatePrepaymentMethod 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 (CreatePrepaymentMethod enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java index 19e40408..4b558988 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateProductPricePoint.java @@ -210,8 +210,8 @@ public void setTrialPriceInCents(Long trialPriceInCents) { /** * Getter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of - * day would mean this product price point would renew every 30 days + * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days. * @return Returns the Integer */ @JsonGetter("trial_interval") @@ -222,8 +222,8 @@ public Integer getTrialInterval() { /** * Setter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of - * day would mean this product price point would renew every 30 days + * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days. * @param trialInterval Value for Integer */ @JsonSetter("trial_interval") @@ -316,8 +316,8 @@ public void setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) { /** * Getter for ExpirationInterval. * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an - * expiration_interval_unit of day would mean this product price point would expire every 30 - * days + * expiration_interval_unit of day would mean this product price point would expire after 30 + * days. * @return Returns the Integer */ @JsonGetter("expiration_interval") @@ -329,8 +329,8 @@ public Integer getExpirationInterval() { /** * Setter for ExpirationInterval. * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an - * expiration_interval_unit of day would mean this product price point would expire every 30 - * days + * expiration_interval_unit of day would mean this product price point would expire after 30 + * days. * @param expirationInterval Value for Integer */ @JsonSetter("expiration_interval") diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoicePrePayment.java b/src/main/java/com/maxio/advancedbilling/models/InvoicePrePayment.java index e9aff002..84c1ce15 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoicePrePayment.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoicePrePayment.java @@ -14,9 +14,9 @@ * This is a model class for InvoicePrePayment type. */ public class InvoicePrePayment { - private String subscriptionId; - private String amountInCents; - private String endingBalanceInCents; + private Integer subscriptionId; + private Long amountInCents; + private Long endingBalanceInCents; /** * Default constructor. @@ -26,14 +26,14 @@ public InvoicePrePayment() { /** * Initialization constructor. - * @param subscriptionId String value for subscriptionId. - * @param amountInCents String value for amountInCents. - * @param endingBalanceInCents String value for endingBalanceInCents. + * @param subscriptionId Integer value for subscriptionId. + * @param amountInCents Long value for amountInCents. + * @param endingBalanceInCents Long value for endingBalanceInCents. */ public InvoicePrePayment( - String subscriptionId, - String amountInCents, - String endingBalanceInCents) { + Integer subscriptionId, + Long amountInCents, + Long endingBalanceInCents) { this.subscriptionId = subscriptionId; this.amountInCents = amountInCents; this.endingBalanceInCents = endingBalanceInCents; @@ -42,42 +42,42 @@ public InvoicePrePayment( /** * Getter for SubscriptionId. * The subscription id for the prepayment account - * @return Returns the String + * @return Returns the Integer */ @JsonGetter("subscription_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getSubscriptionId() { + public Integer getSubscriptionId() { return subscriptionId; } /** * Setter for SubscriptionId. * The subscription id for the prepayment account - * @param subscriptionId Value for String + * @param subscriptionId Value for Integer */ @JsonSetter("subscription_id") - public void setSubscriptionId(String subscriptionId) { + public void setSubscriptionId(Integer subscriptionId) { this.subscriptionId = subscriptionId; } /** * Getter for AmountInCents. * The amount in cents of the prepayment that was created as a result of this payment. - * @return Returns the String + * @return Returns the Long */ @JsonGetter("amount_in_cents") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getAmountInCents() { + public Long getAmountInCents() { return amountInCents; } /** * Setter for AmountInCents. * The amount in cents of the prepayment that was created as a result of this payment. - * @param amountInCents Value for String + * @param amountInCents Value for Long */ @JsonSetter("amount_in_cents") - public void setAmountInCents(String amountInCents) { + public void setAmountInCents(Long amountInCents) { this.amountInCents = amountInCents; } @@ -85,11 +85,11 @@ public void setAmountInCents(String amountInCents) { * Getter for EndingBalanceInCents. * The total balance of the prepayment account for this subscription including any prior * prepayments - * @return Returns the String + * @return Returns the Long */ @JsonGetter("ending_balance_in_cents") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getEndingBalanceInCents() { + public Long getEndingBalanceInCents() { return endingBalanceInCents; } @@ -97,10 +97,10 @@ public String getEndingBalanceInCents() { * Setter for EndingBalanceInCents. * The total balance of the prepayment account for this subscription including any prior * prepayments - * @param endingBalanceInCents Value for String + * @param endingBalanceInCents Value for Long */ @JsonSetter("ending_balance_in_cents") - public void setEndingBalanceInCents(String endingBalanceInCents) { + public void setEndingBalanceInCents(Long endingBalanceInCents) { this.endingBalanceInCents = endingBalanceInCents; } @@ -131,38 +131,38 @@ public Builder toBuilder() { * Class to build instances of {@link InvoicePrePayment}. */ public static class Builder { - private String subscriptionId; - private String amountInCents; - private String endingBalanceInCents; + private Integer subscriptionId; + private Long amountInCents; + private Long endingBalanceInCents; /** * Setter for subscriptionId. - * @param subscriptionId String value for subscriptionId. + * @param subscriptionId Integer value for subscriptionId. * @return Builder */ - public Builder subscriptionId(String subscriptionId) { + public Builder subscriptionId(Integer subscriptionId) { this.subscriptionId = subscriptionId; return this; } /** * Setter for amountInCents. - * @param amountInCents String value for amountInCents. + * @param amountInCents Long value for amountInCents. * @return Builder */ - public Builder amountInCents(String amountInCents) { + public Builder amountInCents(Long amountInCents) { this.amountInCents = amountInCents; return this; } /** * Setter for endingBalanceInCents. - * @param endingBalanceInCents String value for endingBalanceInCents. + * @param endingBalanceInCents Long value for endingBalanceInCents. * @return Builder */ - public Builder endingBalanceInCents(String endingBalanceInCents) { + public Builder endingBalanceInCents(Long endingBalanceInCents) { this.endingBalanceInCents = endingBalanceInCents; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesMeta.java b/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesMeta.java new file mode 100644 index 00000000..62cc376b --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesMeta.java @@ -0,0 +1,205 @@ +/* + * 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; + +/** + * This is a model class for ListProformaInvoicesMeta type. + */ +public class ListProformaInvoicesMeta { + private Integer totalCount; + private Integer currentPage; + private Integer totalPages; + private Integer statusCode; + + /** + * Default constructor. + */ + public ListProformaInvoicesMeta() { + } + + /** + * Initialization constructor. + * @param totalCount Integer value for totalCount. + * @param currentPage Integer value for currentPage. + * @param totalPages Integer value for totalPages. + * @param statusCode Integer value for statusCode. + */ + public ListProformaInvoicesMeta( + Integer totalCount, + Integer currentPage, + Integer totalPages, + Integer statusCode) { + this.totalCount = totalCount; + this.currentPage = currentPage; + this.totalPages = totalPages; + this.statusCode = statusCode; + } + + /** + * Getter for TotalCount. + * @return Returns the Integer + */ + @JsonGetter("total_count") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalCount() { + return totalCount; + } + + /** + * Setter for TotalCount. + * @param totalCount Value for Integer + */ + @JsonSetter("total_count") + public void setTotalCount(Integer totalCount) { + this.totalCount = totalCount; + } + + /** + * Getter for CurrentPage. + * @return Returns the Integer + */ + @JsonGetter("current_page") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getCurrentPage() { + return currentPage; + } + + /** + * Setter for CurrentPage. + * @param currentPage Value for Integer + */ + @JsonSetter("current_page") + public void setCurrentPage(Integer currentPage) { + this.currentPage = currentPage; + } + + /** + * Getter for TotalPages. + * @return Returns the Integer + */ + @JsonGetter("total_pages") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getTotalPages() { + return totalPages; + } + + /** + * Setter for TotalPages. + * @param totalPages Value for Integer + */ + @JsonSetter("total_pages") + public void setTotalPages(Integer totalPages) { + this.totalPages = totalPages; + } + + /** + * Getter for StatusCode. + * @return Returns the Integer + */ + @JsonGetter("status_code") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getStatusCode() { + return statusCode; + } + + /** + * Setter for StatusCode. + * @param statusCode Value for Integer + */ + @JsonSetter("status_code") + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + /** + * Converts this ListProformaInvoicesMeta into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ListProformaInvoicesMeta [" + "totalCount=" + totalCount + ", currentPage=" + + currentPage + ", totalPages=" + totalPages + ", statusCode=" + statusCode + "]"; + } + + /** + * Builds a new {@link ListProformaInvoicesMeta.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ListProformaInvoicesMeta.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .totalCount(getTotalCount()) + .currentPage(getCurrentPage()) + .totalPages(getTotalPages()) + .statusCode(getStatusCode()); + return builder; + } + + /** + * Class to build instances of {@link ListProformaInvoicesMeta}. + */ + public static class Builder { + private Integer totalCount; + private Integer currentPage; + private Integer totalPages; + private Integer statusCode; + + + + /** + * Setter for totalCount. + * @param totalCount Integer value for totalCount. + * @return Builder + */ + public Builder totalCount(Integer totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Setter for currentPage. + * @param currentPage Integer value for currentPage. + * @return Builder + */ + public Builder currentPage(Integer currentPage) { + this.currentPage = currentPage; + return this; + } + + /** + * Setter for totalPages. + * @param totalPages Integer value for totalPages. + * @return Builder + */ + public Builder totalPages(Integer totalPages) { + this.totalPages = totalPages; + return this; + } + + /** + * Setter for statusCode. + * @param statusCode Integer value for statusCode. + * @return Builder + */ + public Builder statusCode(Integer statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Builds a new {@link ListProformaInvoicesMeta} object using the set fields. + * @return {@link ListProformaInvoicesMeta} + */ + public ListProformaInvoicesMeta build() { + return new ListProformaInvoicesMeta(totalCount, currentPage, totalPages, statusCode); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesResponse.java b/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesResponse.java new file mode 100644 index 00000000..3aa6e107 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/ListProformaInvoicesResponse.java @@ -0,0 +1,136 @@ +/* + * 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 java.util.List; + +/** + * This is a model class for ListProformaInvoicesResponse type. + */ +public class ListProformaInvoicesResponse { + private List proformaInvoices; + private ListProformaInvoicesMeta meta; + + /** + * Default constructor. + */ + public ListProformaInvoicesResponse() { + } + + /** + * Initialization constructor. + * @param proformaInvoices List of ProformaInvoice value for proformaInvoices. + * @param meta ListProformaInvoicesMeta value for meta. + */ + public ListProformaInvoicesResponse( + List proformaInvoices, + ListProformaInvoicesMeta meta) { + this.proformaInvoices = proformaInvoices; + this.meta = meta; + } + + /** + * Getter for ProformaInvoices. + * @return Returns the List of ProformaInvoice + */ + @JsonGetter("proforma_invoices") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getProformaInvoices() { + return proformaInvoices; + } + + /** + * Setter for ProformaInvoices. + * @param proformaInvoices Value for List of ProformaInvoice + */ + @JsonSetter("proforma_invoices") + public void setProformaInvoices(List proformaInvoices) { + this.proformaInvoices = proformaInvoices; + } + + /** + * Getter for Meta. + * @return Returns the ListProformaInvoicesMeta + */ + @JsonGetter("meta") + @JsonInclude(JsonInclude.Include.NON_NULL) + public ListProformaInvoicesMeta getMeta() { + return meta; + } + + /** + * Setter for Meta. + * @param meta Value for ListProformaInvoicesMeta + */ + @JsonSetter("meta") + public void setMeta(ListProformaInvoicesMeta meta) { + this.meta = meta; + } + + /** + * Converts this ListProformaInvoicesResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "ListProformaInvoicesResponse [" + "proformaInvoices=" + proformaInvoices + ", meta=" + + meta + "]"; + } + + /** + * Builds a new {@link ListProformaInvoicesResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link ListProformaInvoicesResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .proformaInvoices(getProformaInvoices()) + .meta(getMeta()); + return builder; + } + + /** + * Class to build instances of {@link ListProformaInvoicesResponse}. + */ + public static class Builder { + private List proformaInvoices; + private ListProformaInvoicesMeta meta; + + + + /** + * Setter for proformaInvoices. + * @param proformaInvoices List of ProformaInvoice value for proformaInvoices. + * @return Builder + */ + public Builder proformaInvoices(List proformaInvoices) { + this.proformaInvoices = proformaInvoices; + return this; + } + + /** + * Setter for meta. + * @param meta ListProformaInvoicesMeta value for meta. + * @return Builder + */ + public Builder meta(ListProformaInvoicesMeta meta) { + this.meta = meta; + return this; + } + + /** + * Builds a new {@link ListProformaInvoicesResponse} object using the set fields. + * @return {@link ListProformaInvoicesResponse} + */ + public ListProformaInvoicesResponse build() { + return new ListProformaInvoicesResponse(proformaInvoices, meta); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/ListSubcriptionGroupPrepaymentItem.java b/src/main/java/com/maxio/advancedbilling/models/ListSubcriptionGroupPrepaymentItem.java index 5025a627..99e7de82 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListSubcriptionGroupPrepaymentItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListSubcriptionGroupPrepaymentItem.java @@ -198,9 +198,6 @@ public void setMemo(String memo) { /** * Getter for PaymentType. - * :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be - * collected using the default credit card payment profile and applied to the prepayment account - * balance. This is especially useful for manual replenishment of prepaid subscriptions. * @return Returns the PrepaymentMethod */ @JsonGetter("payment_type") @@ -211,9 +208,6 @@ public PrepaymentMethod getPaymentType() { /** * Setter for PaymentType. - * :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be - * collected using the default credit card payment profile and applied to the prepayment account - * balance. This is especially useful for manual replenishment of prepaid subscriptions. * @param paymentType Value for PrepaymentMethod */ @JsonSetter("payment_type") diff --git a/src/main/java/com/maxio/advancedbilling/models/Payment.java b/src/main/java/com/maxio/advancedbilling/models/PaidInvoice.java similarity index 76% rename from src/main/java/com/maxio/advancedbilling/models/Payment.java rename to src/main/java/com/maxio/advancedbilling/models/PaidInvoice.java index 879cc6b7..4f6e843c 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Payment.java +++ b/src/main/java/com/maxio/advancedbilling/models/PaidInvoice.java @@ -11,10 +11,10 @@ import com.fasterxml.jackson.annotation.JsonSetter; /** - * This is a model class for Payment type. + * This is a model class for PaidInvoice type. */ -public class Payment { - private String invoiceUid; +public class PaidInvoice { + private String invoiceId; private InvoiceStatus status; private String dueAmount; private String paidAmount; @@ -22,46 +22,46 @@ public class Payment { /** * Default constructor. */ - public Payment() { + public PaidInvoice() { } /** * Initialization constructor. - * @param invoiceUid String value for invoiceUid. + * @param invoiceId String value for invoiceId. * @param status InvoiceStatus value for status. * @param dueAmount String value for dueAmount. * @param paidAmount String value for paidAmount. */ - public Payment( - String invoiceUid, + public PaidInvoice( + String invoiceId, InvoiceStatus status, String dueAmount, String paidAmount) { - this.invoiceUid = invoiceUid; + this.invoiceId = invoiceId; this.status = status; this.dueAmount = dueAmount; this.paidAmount = paidAmount; } /** - * Getter for InvoiceUid. + * Getter for InvoiceId. * The uid of the paid invoice * @return Returns the String */ - @JsonGetter("invoice_uid") + @JsonGetter("invoice_id") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getInvoiceUid() { - return invoiceUid; + public String getInvoiceId() { + return invoiceId; } /** - * Setter for InvoiceUid. + * Setter for InvoiceId. * The uid of the paid invoice - * @param invoiceUid Value for String + * @param invoiceId Value for String */ - @JsonSetter("invoice_uid") - public void setInvoiceUid(String invoiceUid) { - this.invoiceUid = invoiceUid; + @JsonSetter("invoice_id") + public void setInvoiceId(String invoiceId) { + this.invoiceId = invoiceId; } /** @@ -132,23 +132,23 @@ public void setPaidAmount(String paidAmount) { } /** - * Converts this Payment into string format. + * Converts this PaidInvoice into string format. * @return String representation of this class */ @Override public String toString() { - return "Payment [" + "invoiceUid=" + invoiceUid + ", status=" + status + ", dueAmount=" + return "PaidInvoice [" + "invoiceId=" + invoiceId + ", status=" + status + ", dueAmount=" + dueAmount + ", paidAmount=" + paidAmount + "]"; } /** - * Builds a new {@link Payment.Builder} object. + * Builds a new {@link PaidInvoice.Builder} object. * Creates the instance with the state of the current model. - * @return a new {@link Payment.Builder} object + * @return a new {@link PaidInvoice.Builder} object */ public Builder toBuilder() { Builder builder = new Builder() - .invoiceUid(getInvoiceUid()) + .invoiceId(getInvoiceId()) .status(getStatus()) .dueAmount(getDueAmount()) .paidAmount(getPaidAmount()); @@ -156,10 +156,10 @@ public Builder toBuilder() { } /** - * Class to build instances of {@link Payment}. + * Class to build instances of {@link PaidInvoice}. */ public static class Builder { - private String invoiceUid; + private String invoiceId; private InvoiceStatus status; private String dueAmount; private String paidAmount; @@ -167,12 +167,12 @@ public static class Builder { /** - * Setter for invoiceUid. - * @param invoiceUid String value for invoiceUid. + * Setter for invoiceId. + * @param invoiceId String value for invoiceId. * @return Builder */ - public Builder invoiceUid(String invoiceUid) { - this.invoiceUid = invoiceUid; + public Builder invoiceId(String invoiceId) { + this.invoiceId = invoiceId; return this; } @@ -207,11 +207,11 @@ public Builder paidAmount(String paidAmount) { } /** - * Builds a new {@link Payment} object using the set fields. - * @return {@link Payment} + * Builds a new {@link PaidInvoice} object using the set fields. + * @return {@link PaidInvoice} */ - public Payment build() { - return new Payment(invoiceUid, status, dueAmount, paidAmount); + public PaidInvoice build() { + return new PaidInvoice(invoiceId, status, dueAmount, paidAmount); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/PaymentResponse.java b/src/main/java/com/maxio/advancedbilling/models/PaymentResponse.java deleted file mode 100644 index c96200d5..00000000 --- a/src/main/java/com/maxio/advancedbilling/models/PaymentResponse.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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 java.util.List; - -/** - * This is a model class for PaymentResponse type. - */ -public class PaymentResponse { - private List paidInvoices; - private InvoicePrePayment prepayment; - - /** - * Default constructor. - */ - public PaymentResponse() { - } - - /** - * Initialization constructor. - * @param paidInvoices List of Payment value for paidInvoices. - * @param prepayment InvoicePrePayment value for prepayment. - */ - public PaymentResponse( - List paidInvoices, - InvoicePrePayment prepayment) { - this.paidInvoices = paidInvoices; - this.prepayment = prepayment; - } - - /** - * Getter for PaidInvoices. - * @return Returns the List of Payment - */ - @JsonGetter("paid_invoices") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getPaidInvoices() { - return paidInvoices; - } - - /** - * Setter for PaidInvoices. - * @param paidInvoices Value for List of Payment - */ - @JsonSetter("paid_invoices") - public void setPaidInvoices(List paidInvoices) { - this.paidInvoices = paidInvoices; - } - - /** - * Getter for Prepayment. - * @return Returns the InvoicePrePayment - */ - @JsonGetter("prepayment") - @JsonInclude(JsonInclude.Include.NON_NULL) - public InvoicePrePayment getPrepayment() { - return prepayment; - } - - /** - * Setter for Prepayment. - * @param prepayment Value for InvoicePrePayment - */ - @JsonSetter("prepayment") - public void setPrepayment(InvoicePrePayment prepayment) { - this.prepayment = prepayment; - } - - /** - * Converts this PaymentResponse into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "PaymentResponse [" + "paidInvoices=" + paidInvoices + ", prepayment=" + prepayment - + "]"; - } - - /** - * Builds a new {@link PaymentResponse.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link PaymentResponse.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .paidInvoices(getPaidInvoices()) - .prepayment(getPrepayment()); - return builder; - } - - /** - * Class to build instances of {@link PaymentResponse}. - */ - public static class Builder { - private List paidInvoices; - private InvoicePrePayment prepayment; - - - - /** - * Setter for paidInvoices. - * @param paidInvoices List of Payment value for paidInvoices. - * @return Builder - */ - public Builder paidInvoices(List paidInvoices) { - this.paidInvoices = paidInvoices; - return this; - } - - /** - * Setter for prepayment. - * @param prepayment InvoicePrePayment value for prepayment. - * @return Builder - */ - public Builder prepayment(InvoicePrePayment prepayment) { - this.prepayment = prepayment; - return this; - } - - /** - * Builds a new {@link PaymentResponse} object using the set fields. - * @return {@link PaymentResponse} - */ - public PaymentResponse build() { - return new PaymentResponse(paidInvoices, prepayment); - } - } -} diff --git a/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java b/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java index 04c03c33..f3160906 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java +++ b/src/main/java/com/maxio/advancedbilling/models/PrepaymentMethod.java @@ -27,7 +27,7 @@ public enum PrepaymentMethod { PAYPAL_ACCOUNT, - CREDIT_CARD_ON_FILE, + CREDIT_CARD, OTHER; @@ -41,7 +41,7 @@ public enum PrepaymentMethod { MONEY_ORDER.value = "money_order"; ACH.value = "ach"; PAYPAL_ACCOUNT.value = "paypal_account"; - CREDIT_CARD_ON_FILE.value = "credit_card_on_file"; + CREDIT_CARD.value = "credit_card"; OTHER.value = "other"; valueMap.put("check", CHECK); @@ -49,7 +49,7 @@ public enum PrepaymentMethod { valueMap.put("money_order", MONEY_ORDER); valueMap.put("ach", ACH); valueMap.put("paypal_account", PAYPAL_ACCOUNT); - valueMap.put("credit_card_on_file", CREDIT_CARD_ON_FILE); + valueMap.put("credit_card", CREDIT_CARD); valueMap.put("other", OTHER); } diff --git a/src/main/java/com/maxio/advancedbilling/models/Product.java b/src/main/java/com/maxio/advancedbilling/models/Product.java index cb5840e6..d0375f2d 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Product.java +++ b/src/main/java/com/maxio/advancedbilling/models/Product.java @@ -512,7 +512,7 @@ public void unsetExpirationInterval() { /** * Internal Getter for ExpirationIntervalUnit. - * A string representing the trial interval unit for this product, either month or day + * A string representing the expiration interval unit for this product, either month or day * @return Returns the Internal ProductExpirationIntervalUnit */ @JsonGetter("expiration_interval_unit") @@ -524,7 +524,7 @@ protected OptionalNullable internalGetExpirationI /** * Getter for ExpirationIntervalUnit. - * A string representing the trial interval unit for this product, either month or day + * A string representing the expiration interval unit for this product, either month or day * @return Returns the ProductExpirationIntervalUnit */ public ProductExpirationIntervalUnit getExpirationIntervalUnit() { @@ -533,7 +533,7 @@ public ProductExpirationIntervalUnit getExpirationIntervalUnit() { /** * Setter for ExpirationIntervalUnit. - * A string representing the trial interval unit for this product, either month or day + * A string representing the expiration interval unit for this product, either month or day * @param expirationIntervalUnit Value for ProductExpirationIntervalUnit */ @JsonSetter("expiration_interval_unit") @@ -543,7 +543,7 @@ public void setExpirationIntervalUnit(ProductExpirationIntervalUnit expirationIn /** * UnSetter for ExpirationIntervalUnit. - * A string representing the trial interval unit for this product, either month or day + * A string representing the expiration interval unit for this product, either month or day */ public void unsetExpirationIntervalUnit() { expirationIntervalUnit = null; diff --git a/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java index 4d7f60e5..9ccd5b76 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java @@ -341,8 +341,8 @@ public void setTrialPriceInCents(Long trialPriceInCents) { /** * Getter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of - * day would mean this product price point would renew every 30 days + * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days * @return Returns the Integer */ @JsonGetter("trial_interval") @@ -353,8 +353,8 @@ public Integer getTrialInterval() { /** * Setter for TrialInterval. - * The numerical trial interval. i.e. an interval of ‘30’ coupled with an trial_interval_unit of - * day would mean this product price point would renew every 30 days + * The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of + * day would mean this product price point trial would last 30 days * @param trialInterval Value for Integer */ @JsonSetter("trial_interval") @@ -468,7 +468,7 @@ public void setInitialChargeAfterTrial(Boolean initialChargeAfterTrial) { /** * Getter for ExpirationInterval. * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an - * expiration_interval_unit of day would mean this product price point would expire every 30 + * expiration_interval_unit of day would mean this product price point would expire after 30 * days * @return Returns the Integer */ @@ -481,7 +481,7 @@ public Integer getExpirationInterval() { /** * Setter for ExpirationInterval. * The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an - * expiration_interval_unit of day would mean this product price point would expire every 30 + * expiration_interval_unit of day would mean this product price point would expire after 30 * days * @param expirationInterval Value for Integer */ diff --git a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java index 76677ac8..ae13cda7 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoice.java @@ -9,6 +9,8 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.apimatic.core.types.OptionalNullable; import java.util.List; /** @@ -19,8 +21,8 @@ public class ProformaInvoice { private Integer siteId; private Integer customerId; private Integer subscriptionId; - private Integer number; - private Integer sequenceNumber; + private OptionalNullable number; + private OptionalNullable sequenceNumber; private String createdAt; private String deliveryDate; private String status; @@ -50,7 +52,7 @@ public class ProformaInvoice { private List credits; private List payments; private List customFields; - private String publicUrl; + private OptionalNullable publicUrl; /** * Default constructor. @@ -138,6 +140,97 @@ public ProformaInvoice( this.siteId = siteId; this.customerId = customerId; this.subscriptionId = subscriptionId; + this.number = OptionalNullable.of(number); + this.sequenceNumber = OptionalNullable.of(sequenceNumber); + this.createdAt = createdAt; + this.deliveryDate = deliveryDate; + this.status = status; + this.collectionMethod = collectionMethod; + this.paymentInstructions = paymentInstructions; + this.currency = currency; + this.consolidationLevel = consolidationLevel; + this.productName = productName; + this.productFamilyName = productFamilyName; + this.role = role; + this.seller = seller; + this.customer = customer; + this.memo = memo; + this.billingAddress = billingAddress; + this.shippingAddress = shippingAddress; + this.subtotalAmount = subtotalAmount; + this.discountAmount = discountAmount; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + this.creditAmount = creditAmount; + this.paidAmount = paidAmount; + this.refundAmount = refundAmount; + this.dueAmount = dueAmount; + this.lineItems = lineItems; + this.discounts = discounts; + this.taxes = taxes; + this.credits = credits; + this.payments = payments; + this.customFields = customFields; + this.publicUrl = OptionalNullable.of(publicUrl); + } + + /** + * 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 createdAt String value for createdAt. + * @param deliveryDate String value for deliveryDate. + * @param status String value for status. + * @param collectionMethod String value for collectionMethod. + * @param paymentInstructions String value for paymentInstructions. + * @param currency String value for currency. + * @param consolidationLevel String value for consolidationLevel. + * @param productName String value for productName. + * @param productFamilyName String value for productFamilyName. + * @param role String value for role. + * @param seller InvoiceSeller value for seller. + * @param customer InvoiceCustomer value for customer. + * @param memo String value for memo. + * @param billingAddress InvoiceAddress value for billingAddress. + * @param shippingAddress InvoiceAddress value for shippingAddress. + * @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 creditAmount String value for creditAmount. + * @param paidAmount String value for paidAmount. + * @param refundAmount String value for refundAmount. + * @param dueAmount String value for dueAmount. + * @param lineItems List of InvoiceLineItem value for lineItems. + * @param discounts List of ProformaInvoiceDiscount value for discounts. + * @param taxes List of ProformaInvoiceTax value for taxes. + * @param credits List of ProformaInvoiceCredit value for credits. + * @param payments List of ProformaInvoicePayment value for payments. + * @param customFields List of InvoiceCustomField value for customFields. + * @param publicUrl String value for publicUrl. + */ + + protected ProformaInvoice(String uid, Integer siteId, Integer customerId, + Integer subscriptionId, OptionalNullable number, + OptionalNullable sequenceNumber, String createdAt, String deliveryDate, + String status, String collectionMethod, String paymentInstructions, String currency, + String consolidationLevel, String productName, String productFamilyName, String role, + InvoiceSeller seller, InvoiceCustomer customer, String memo, + InvoiceAddress billingAddress, InvoiceAddress shippingAddress, String subtotalAmount, + String discountAmount, String taxAmount, String totalAmount, String creditAmount, + String paidAmount, String refundAmount, String dueAmount, + List lineItems, List discounts, + List taxes, List credits, + List payments, List customFields, + OptionalNullable publicUrl) { + this.uid = uid; + this.siteId = siteId; + this.customerId = customerId; + this.subscriptionId = subscriptionId; this.number = number; this.sequenceNumber = sequenceNumber; this.createdAt = createdAt; @@ -249,13 +342,22 @@ public void setSubscriptionId(Integer subscriptionId) { } /** - * Getter for Number. - * @return Returns the Integer + * Internal Getter for Number. + * @return Returns the Internal Integer */ @JsonGetter("number") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetNumber() { + return this.number; + } + + /** + * Getter for Number. + * @return Returns the Integer + */ public Integer getNumber() { - return number; + return OptionalNullable.getFrom(number); } /** @@ -264,17 +366,33 @@ public Integer getNumber() { */ @JsonSetter("number") public void setNumber(Integer number) { - this.number = number; + this.number = OptionalNullable.of(number); } /** - * Getter for SequenceNumber. - * @return Returns the Integer + * UnSetter for Number. + */ + public void unsetNumber() { + number = null; + } + + /** + * Internal Getter for SequenceNumber. + * @return Returns the Internal Integer */ @JsonGetter("sequence_number") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetSequenceNumber() { + return this.sequenceNumber; + } + + /** + * Getter for SequenceNumber. + * @return Returns the Integer + */ public Integer getSequenceNumber() { - return sequenceNumber; + return OptionalNullable.getFrom(sequenceNumber); } /** @@ -283,7 +401,14 @@ public Integer getSequenceNumber() { */ @JsonSetter("sequence_number") public void setSequenceNumber(Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; + this.sequenceNumber = OptionalNullable.of(sequenceNumber); + } + + /** + * UnSetter for SequenceNumber. + */ + public void unsetSequenceNumber() { + sequenceNumber = null; } /** @@ -842,13 +967,22 @@ public void setCustomFields(List customFields) { } /** - * Getter for PublicUrl. - * @return Returns the String + * Internal Getter for PublicUrl. + * @return Returns the Internal String */ @JsonGetter("public_url") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetPublicUrl() { + return this.publicUrl; + } + + /** + * Getter for PublicUrl. + * @return Returns the String + */ public String getPublicUrl() { - return publicUrl; + return OptionalNullable.getFrom(publicUrl); } /** @@ -857,7 +991,14 @@ public String getPublicUrl() { */ @JsonSetter("public_url") public void setPublicUrl(String publicUrl) { - this.publicUrl = publicUrl; + this.publicUrl = OptionalNullable.of(publicUrl); + } + + /** + * UnSetter for PublicUrl. + */ + public void unsetPublicUrl() { + publicUrl = null; } /** @@ -894,8 +1035,6 @@ public Builder toBuilder() { .siteId(getSiteId()) .customerId(getCustomerId()) .subscriptionId(getSubscriptionId()) - .number(getNumber()) - .sequenceNumber(getSequenceNumber()) .createdAt(getCreatedAt()) .deliveryDate(getDeliveryDate()) .status(getStatus()) @@ -924,8 +1063,10 @@ public Builder toBuilder() { .taxes(getTaxes()) .credits(getCredits()) .payments(getPayments()) - .customFields(getCustomFields()) - .publicUrl(getPublicUrl()); + .customFields(getCustomFields()); + builder.number = internalGetNumber(); + builder.sequenceNumber = internalGetSequenceNumber(); + builder.publicUrl = internalGetPublicUrl(); return builder; } @@ -937,8 +1078,8 @@ public static class Builder { private Integer siteId; private Integer customerId; private Integer subscriptionId; - private Integer number; - private Integer sequenceNumber; + private OptionalNullable number; + private OptionalNullable sequenceNumber; private String createdAt; private String deliveryDate; private String status; @@ -968,7 +1109,7 @@ public static class Builder { private List credits; private List payments; private List customFields; - private String publicUrl; + private OptionalNullable publicUrl; @@ -1018,7 +1159,16 @@ public Builder subscriptionId(Integer subscriptionId) { * @return Builder */ public Builder number(Integer number) { - this.number = number; + this.number = OptionalNullable.of(number); + return this; + } + + /** + * UnSetter for number. + * @return Builder + */ + public Builder unsetNumber() { + number = null; return this; } @@ -1028,7 +1178,16 @@ public Builder number(Integer number) { * @return Builder */ public Builder sequenceNumber(Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; + this.sequenceNumber = OptionalNullable.of(sequenceNumber); + return this; + } + + /** + * UnSetter for sequenceNumber. + * @return Builder + */ + public Builder unsetSequenceNumber() { + sequenceNumber = null; return this; } @@ -1328,7 +1487,16 @@ public Builder customFields(List customFields) { * @return Builder */ public Builder publicUrl(String publicUrl) { - this.publicUrl = publicUrl; + this.publicUrl = OptionalNullable.of(publicUrl); + return this; + } + + /** + * UnSetter for publicUrl. + * @return Builder + */ + public Builder unsetPublicUrl() { + publicUrl = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoicePreview.java b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoicePreview.java index b6e31796..1a4f1000 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProformaInvoicePreview.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProformaInvoicePreview.java @@ -9,6 +9,8 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.apimatic.core.types.OptionalNullable; import java.util.List; /** @@ -19,8 +21,8 @@ public class ProformaInvoicePreview { private Integer siteId; private Integer customerId; private Integer subscriptionId; - private String number; - private Integer sequenceNumber; + private OptionalNullable number; + private OptionalNullable sequenceNumber; private String createdAt; private String deliveryDate; private String status; @@ -50,7 +52,7 @@ public class ProformaInvoicePreview { private List credits; private List payments; private List customFields; - private String publicUrl; + private OptionalNullable publicUrl; /** * Default constructor. @@ -138,6 +140,97 @@ public ProformaInvoicePreview( this.siteId = siteId; this.customerId = customerId; this.subscriptionId = subscriptionId; + this.number = OptionalNullable.of(number); + this.sequenceNumber = OptionalNullable.of(sequenceNumber); + this.createdAt = createdAt; + this.deliveryDate = deliveryDate; + this.status = status; + this.collectionMethod = collectionMethod; + this.paymentInstructions = paymentInstructions; + this.currency = currency; + this.consolidationLevel = consolidationLevel; + this.productName = productName; + this.productFamilyName = productFamilyName; + this.role = role; + this.seller = seller; + this.customer = customer; + this.memo = memo; + this.billingAddress = billingAddress; + this.shippingAddress = shippingAddress; + this.subtotalAmount = subtotalAmount; + this.discountAmount = discountAmount; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + this.creditAmount = creditAmount; + this.paidAmount = paidAmount; + this.refundAmount = refundAmount; + this.dueAmount = dueAmount; + this.lineItems = lineItems; + this.discounts = discounts; + this.taxes = taxes; + this.credits = credits; + this.payments = payments; + this.customFields = customFields; + this.publicUrl = OptionalNullable.of(publicUrl); + } + + /** + * 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 String value for number. + * @param sequenceNumber Integer value for sequenceNumber. + * @param createdAt String value for createdAt. + * @param deliveryDate String value for deliveryDate. + * @param status String value for status. + * @param collectionMethod String value for collectionMethod. + * @param paymentInstructions String value for paymentInstructions. + * @param currency String value for currency. + * @param consolidationLevel String value for consolidationLevel. + * @param productName String value for productName. + * @param productFamilyName String value for productFamilyName. + * @param role String value for role. + * @param seller InvoiceSeller value for seller. + * @param customer InvoiceCustomer value for customer. + * @param memo String value for memo. + * @param billingAddress InvoiceAddress value for billingAddress. + * @param shippingAddress InvoiceAddress value for shippingAddress. + * @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 creditAmount String value for creditAmount. + * @param paidAmount String value for paidAmount. + * @param refundAmount String value for refundAmount. + * @param dueAmount String value for dueAmount. + * @param lineItems List of InvoiceLineItem value for lineItems. + * @param discounts List of ProformaInvoiceDiscount value for discounts. + * @param taxes List of ProformaInvoiceTax value for taxes. + * @param credits List of ProformaInvoiceCredit value for credits. + * @param payments List of ProformaInvoicePayment value for payments. + * @param customFields List of InvoiceCustomField value for customFields. + * @param publicUrl String value for publicUrl. + */ + + protected ProformaInvoicePreview(String uid, Integer siteId, Integer customerId, + Integer subscriptionId, OptionalNullable number, + OptionalNullable sequenceNumber, String createdAt, String deliveryDate, + String status, String collectionMethod, String paymentInstructions, String currency, + String consolidationLevel, String productName, String productFamilyName, String role, + InvoiceSeller seller, InvoiceCustomer customer, String memo, + InvoiceAddress billingAddress, InvoiceAddress shippingAddress, String subtotalAmount, + String discountAmount, String taxAmount, String totalAmount, String creditAmount, + String paidAmount, String refundAmount, String dueAmount, + List lineItems, List discounts, + List taxes, List credits, + List payments, List customFields, + OptionalNullable publicUrl) { + this.uid = uid; + this.siteId = siteId; + this.customerId = customerId; + this.subscriptionId = subscriptionId; this.number = number; this.sequenceNumber = sequenceNumber; this.createdAt = createdAt; @@ -249,13 +342,22 @@ public void setSubscriptionId(Integer subscriptionId) { } /** - * Getter for Number. - * @return Returns the String + * Internal Getter for Number. + * @return Returns the Internal String */ @JsonGetter("number") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetNumber() { + return this.number; + } + + /** + * Getter for Number. + * @return Returns the String + */ public String getNumber() { - return number; + return OptionalNullable.getFrom(number); } /** @@ -264,17 +366,33 @@ public String getNumber() { */ @JsonSetter("number") public void setNumber(String number) { - this.number = number; + this.number = OptionalNullable.of(number); } /** - * Getter for SequenceNumber. - * @return Returns the Integer + * UnSetter for Number. + */ + public void unsetNumber() { + number = null; + } + + /** + * Internal Getter for SequenceNumber. + * @return Returns the Internal Integer */ @JsonGetter("sequence_number") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetSequenceNumber() { + return this.sequenceNumber; + } + + /** + * Getter for SequenceNumber. + * @return Returns the Integer + */ public Integer getSequenceNumber() { - return sequenceNumber; + return OptionalNullable.getFrom(sequenceNumber); } /** @@ -283,7 +401,14 @@ public Integer getSequenceNumber() { */ @JsonSetter("sequence_number") public void setSequenceNumber(Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; + this.sequenceNumber = OptionalNullable.of(sequenceNumber); + } + + /** + * UnSetter for SequenceNumber. + */ + public void unsetSequenceNumber() { + sequenceNumber = null; } /** @@ -842,13 +967,22 @@ public void setCustomFields(List customFields) { } /** - * Getter for PublicUrl. - * @return Returns the String + * Internal Getter for PublicUrl. + * @return Returns the Internal String */ @JsonGetter("public_url") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetPublicUrl() { + return this.publicUrl; + } + + /** + * Getter for PublicUrl. + * @return Returns the String + */ public String getPublicUrl() { - return publicUrl; + return OptionalNullable.getFrom(publicUrl); } /** @@ -857,7 +991,14 @@ public String getPublicUrl() { */ @JsonSetter("public_url") public void setPublicUrl(String publicUrl) { - this.publicUrl = publicUrl; + this.publicUrl = OptionalNullable.of(publicUrl); + } + + /** + * UnSetter for PublicUrl. + */ + public void unsetPublicUrl() { + publicUrl = null; } /** @@ -894,8 +1035,6 @@ public Builder toBuilder() { .siteId(getSiteId()) .customerId(getCustomerId()) .subscriptionId(getSubscriptionId()) - .number(getNumber()) - .sequenceNumber(getSequenceNumber()) .createdAt(getCreatedAt()) .deliveryDate(getDeliveryDate()) .status(getStatus()) @@ -924,8 +1063,10 @@ public Builder toBuilder() { .taxes(getTaxes()) .credits(getCredits()) .payments(getPayments()) - .customFields(getCustomFields()) - .publicUrl(getPublicUrl()); + .customFields(getCustomFields()); + builder.number = internalGetNumber(); + builder.sequenceNumber = internalGetSequenceNumber(); + builder.publicUrl = internalGetPublicUrl(); return builder; } @@ -937,8 +1078,8 @@ public static class Builder { private Integer siteId; private Integer customerId; private Integer subscriptionId; - private String number; - private Integer sequenceNumber; + private OptionalNullable number; + private OptionalNullable sequenceNumber; private String createdAt; private String deliveryDate; private String status; @@ -968,7 +1109,7 @@ public static class Builder { private List credits; private List payments; private List customFields; - private String publicUrl; + private OptionalNullable publicUrl; @@ -1018,7 +1159,16 @@ public Builder subscriptionId(Integer subscriptionId) { * @return Builder */ public Builder number(String number) { - this.number = number; + this.number = OptionalNullable.of(number); + return this; + } + + /** + * UnSetter for number. + * @return Builder + */ + public Builder unsetNumber() { + number = null; return this; } @@ -1028,7 +1178,16 @@ public Builder number(String number) { * @return Builder */ public Builder sequenceNumber(Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; + this.sequenceNumber = OptionalNullable.of(sequenceNumber); + return this; + } + + /** + * UnSetter for sequenceNumber. + * @return Builder + */ + public Builder unsetSequenceNumber() { + sequenceNumber = null; return this; } @@ -1328,7 +1487,16 @@ public Builder customFields(List customFields) { * @return Builder */ public Builder publicUrl(String publicUrl) { - this.publicUrl = publicUrl; + this.publicUrl = OptionalNullable.of(publicUrl); + return this; + } + + /** + * UnSetter for publicUrl. + * @return Builder + */ + public Builder unsetPublicUrl() { + publicUrl = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/RecordPaymentResponse.java b/src/main/java/com/maxio/advancedbilling/models/RecordPaymentResponse.java new file mode 100644 index 00000000..5c70683b --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/RecordPaymentResponse.java @@ -0,0 +1,176 @@ +/* + * 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.JsonSerialize; +import com.maxio.advancedbilling.models.containers.RecordPaymentResponsePrepayment; +import io.apimatic.core.types.OptionalNullable; +import java.util.List; + +/** + * This is a model class for RecordPaymentResponse type. + */ +public class RecordPaymentResponse { + private List paidInvoices; + private OptionalNullable prepayment; + + /** + * Default constructor. + */ + public RecordPaymentResponse() { + } + + /** + * Initialization constructor. + * @param paidInvoices List of PaidInvoice value for paidInvoices. + * @param prepayment RecordPaymentResponsePrepayment value for prepayment. + */ + public RecordPaymentResponse( + List paidInvoices, + RecordPaymentResponsePrepayment prepayment) { + this.paidInvoices = paidInvoices; + this.prepayment = OptionalNullable.of(prepayment); + } + + /** + * Initialization constructor. + * @param paidInvoices List of PaidInvoice value for paidInvoices. + * @param prepayment RecordPaymentResponsePrepayment value for prepayment. + */ + + protected RecordPaymentResponse(List paidInvoices, + OptionalNullable prepayment) { + this.paidInvoices = paidInvoices; + this.prepayment = prepayment; + } + + /** + * Getter for PaidInvoices. + * @return Returns the List of PaidInvoice + */ + @JsonGetter("paid_invoices") + @JsonInclude(JsonInclude.Include.NON_NULL) + public List getPaidInvoices() { + return paidInvoices; + } + + /** + * Setter for PaidInvoices. + * @param paidInvoices Value for List of PaidInvoice + */ + @JsonSetter("paid_invoices") + public void setPaidInvoices(List paidInvoices) { + this.paidInvoices = paidInvoices; + } + + /** + * Internal Getter for Prepayment. + * @return Returns the Internal RecordPaymentResponsePrepayment + */ + @JsonGetter("prepayment") + @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetPrepayment() { + return this.prepayment; + } + + /** + * Getter for Prepayment. + * @return Returns the RecordPaymentResponsePrepayment + */ + public RecordPaymentResponsePrepayment getPrepayment() { + return OptionalNullable.getFrom(prepayment); + } + + /** + * Setter for Prepayment. + * @param prepayment Value for RecordPaymentResponsePrepayment + */ + @JsonSetter("prepayment") + public void setPrepayment(RecordPaymentResponsePrepayment prepayment) { + this.prepayment = OptionalNullable.of(prepayment); + } + + /** + * UnSetter for Prepayment. + */ + public void unsetPrepayment() { + prepayment = null; + } + + /** + * Converts this RecordPaymentResponse into string format. + * @return String representation of this class + */ + @Override + public String toString() { + return "RecordPaymentResponse [" + "paidInvoices=" + paidInvoices + ", prepayment=" + + prepayment + "]"; + } + + /** + * Builds a new {@link RecordPaymentResponse.Builder} object. + * Creates the instance with the state of the current model. + * @return a new {@link RecordPaymentResponse.Builder} object + */ + public Builder toBuilder() { + Builder builder = new Builder() + .paidInvoices(getPaidInvoices()); + builder.prepayment = internalGetPrepayment(); + return builder; + } + + /** + * Class to build instances of {@link RecordPaymentResponse}. + */ + public static class Builder { + private List paidInvoices; + private OptionalNullable prepayment; + + + + /** + * Setter for paidInvoices. + * @param paidInvoices List of PaidInvoice value for paidInvoices. + * @return Builder + */ + public Builder paidInvoices(List paidInvoices) { + this.paidInvoices = paidInvoices; + return this; + } + + /** + * Setter for prepayment. + * @param prepayment RecordPaymentResponsePrepayment value for prepayment. + * @return Builder + */ + public Builder prepayment(RecordPaymentResponsePrepayment prepayment) { + this.prepayment = OptionalNullable.of(prepayment); + return this; + } + + /** + * UnSetter for prepayment. + * @return Builder + */ + public Builder unsetPrepayment() { + prepayment = null; + return this; + } + + /** + * Builds a new {@link RecordPaymentResponse} object using the set fields. + * @return {@link RecordPaymentResponse} + */ + public RecordPaymentResponse build() { + return new RecordPaymentResponse(paidInvoices, prepayment); + } + } +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/RecordPaymentResponsePrepayment.java b/src/main/java/com/maxio/advancedbilling/models/containers/RecordPaymentResponsePrepayment.java new file mode 100644 index 00000000..4c96586a --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/RecordPaymentResponsePrepayment.java @@ -0,0 +1,102 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import com.maxio.advancedbilling.models.InvoicePrePayment; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = RecordPaymentResponsePrepayment.RecordPaymentResponsePrepaymentDeserializer.class) +public abstract class RecordPaymentResponsePrepayment { + + /** + * This is Invoice PrePayment case. + * @param invoicePrePayment InvoicePrePayment value for invoicePrePayment. + * @return The InvoicePrePaymentCase object. + */ + public static RecordPaymentResponsePrepayment fromInvoicePrePayment( + InvoicePrePayment invoicePrePayment) { + return invoicePrePayment == null ? null : new InvoicePrePaymentCase(invoicePrePayment); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R invoicePrePayment(InvoicePrePayment invoicePrePayment); + } + + /** + * This is a implementation class for InvoicePrePaymentCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "InvoicePrePayment") + private static class InvoicePrePaymentCase extends RecordPaymentResponsePrepayment { + + @JsonValue + private InvoicePrePayment invoicePrePayment; + + InvoicePrePaymentCase(InvoicePrePayment invoicePrePayment) { + this.invoicePrePayment = invoicePrePayment; + } + + @Override + public R match(Cases cases) { + return cases.invoicePrePayment(this.invoicePrePayment); + } + + @JsonCreator + private InvoicePrePaymentCase(JsonNode jsonNode) throws IOException { + this.invoicePrePayment = ApiHelper.deserialize(jsonNode, + InvoicePrePayment.class); + } + + @Override + public String toString() { + return invoicePrePayment.toString(); + } + } + + /** + * This is a custom deserializer class for RecordPaymentResponsePrepayment. + */ + protected static class RecordPaymentResponsePrepaymentDeserializer + extends JsonDeserializer { + + @Override + public RecordPaymentResponsePrepayment deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(InvoicePrePaymentCase.class), true); + } + } + +}