diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 98ccaefd..700af552 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -605,6 +605,9 @@ Exposed event types are: + change_invoice_status + change_invoice_collection_method + remove_payment ++ failed_payment ++ apply_debit_note ++ create_debit_note Invoice events are returned in ascending order. diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 48f0f8b9..2ef1874d 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -29,7 +29,7 @@ ProductPricePointsController productPricePointsController = client.getProductPri ```java ProductPricePointResponse createProductPricePoint( - final int productId, + final CreateProductPricePointProductId productId, final CreateProductPricePointRequest body) ``` @@ -37,7 +37,7 @@ ProductPricePointResponse createProductPricePoint( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | +| `productId` | [`CreateProductPricePointProductId`](../../doc/models/containers/create-product-price-point-product-id.md) | Template, Required | This is a container for one-of cases. | | `body` | [`CreateProductPricePointRequest`](../../doc/models/create-product-price-point-request.md) | Body, Optional | - | ## Response Type @@ -47,7 +47,9 @@ ProductPricePointResponse createProductPricePoint( ## Example Usage ```java -int productId = 202; +CreateProductPricePointProductId productId = CreateProductPricePointProductId.fromNumber( + 124 +); CreateProductPricePointRequest body = new CreateProductPricePointRequest.Builder( new CreateProductPricePoint.Builder( "Educational", @@ -125,7 +127,7 @@ ListProductPricePointsResponse listProductPricePoints( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | +| `productId` | [`ListProductPricePointsInputProductId`](../../doc/models/containers/list-product-price-points-input-product-id.md) | Template, Required | This is a container for one-of cases. | | `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | | `perPage` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
**Default**: `10`
**Constraints**: `<= 200` | | `currencyPrices` | `Boolean` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | @@ -139,7 +141,9 @@ ListProductPricePointsResponse listProductPricePoints( ```java ListProductPricePointsInput listProductPricePointsInput = new ListProductPricePointsInput.Builder( - 202 + ListProductPricePointsInputProductId.fromNumber( + 124 + ) ) .page(2) .perPage(10) @@ -193,8 +197,8 @@ Note: Custom product price points are not able to be updated. ```java ProductPricePointResponse updateProductPricePoint( - final int productId, - final int pricePointId, + final UpdateProductPricePointProductId productId, + final UpdateProductPricePointPricePointId pricePointId, final UpdateProductPricePointRequest body) ``` @@ -202,8 +206,8 @@ ProductPricePointResponse updateProductPricePoint( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `pricePointId` | `int` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | +| `productId` | [`UpdateProductPricePointProductId`](../../doc/models/containers/update-product-price-point-product-id.md) | Template, Required | This is a container for one-of cases. | +| `pricePointId` | [`UpdateProductPricePointPricePointId`](../../doc/models/containers/update-product-price-point-price-point-id.md) | Template, Required | This is a container for one-of cases. | | `body` | [`UpdateProductPricePointRequest`](../../doc/models/update-product-price-point-request.md) | Body, Optional | - | ## Response Type @@ -213,8 +217,12 @@ ProductPricePointResponse updateProductPricePoint( ## Example Usage ```java -int productId = 202; -int pricePointId = 10; +UpdateProductPricePointProductId productId = UpdateProductPricePointProductId.fromNumber( + 124 +); +UpdateProductPricePointPricePointId pricePointId = UpdateProductPricePointPricePointId.fromNumber( + 188 +); UpdateProductPricePointRequest body = new UpdateProductPricePointRequest.Builder( new UpdateProductPricePoint.Builder() .handle("educational") @@ -267,8 +275,8 @@ Use this endpoint to retrieve details for a specific product price point. ```java ProductPricePointResponse readProductPricePoint( - final int productId, - final int pricePointId, + final ReadProductPricePointProductId productId, + final ReadProductPricePointPricePointId pricePointId, final Boolean currencyPrices) ``` @@ -276,8 +284,8 @@ ProductPricePointResponse readProductPricePoint( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `pricePointId` | `int` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | +| `productId` | [`ReadProductPricePointProductId`](../../doc/models/containers/read-product-price-point-product-id.md) | Template, Required | This is a container for one-of cases. | +| `pricePointId` | [`ReadProductPricePointPricePointId`](../../doc/models/containers/read-product-price-point-price-point-id.md) | Template, Required | This is a container for one-of cases. | | `currencyPrices` | `Boolean` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | ## Response Type @@ -287,8 +295,12 @@ ProductPricePointResponse readProductPricePoint( ## Example Usage ```java -int productId = 202; -int pricePointId = 10; +ReadProductPricePointProductId productId = ReadProductPricePointProductId.fromNumber( + 124 +); +ReadProductPricePointPricePointId pricePointId = ReadProductPricePointPricePointId.fromNumber( + 188 +); try { ProductPricePointResponse result = productPricePointsController.readProductPricePoint(productId, pricePointId, null); @@ -334,16 +346,16 @@ Use this endpoint to archive a product price point. ```java ProductPricePointResponse archiveProductPricePoint( - final int productId, - final int pricePointId) + final ArchiveProductPricePointProductId productId, + final ArchiveProductPricePointPricePointId pricePointId) ``` ## Parameters | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `productId` | `int` | Template, Required | The id or handle of the product. When using the handle, it must be prefixed with `handle:` | -| `pricePointId` | `int` | Template, Required | The id or handle of the price point. When using the handle, it must be prefixed with `handle:` | +| `productId` | [`ArchiveProductPricePointProductId`](../../doc/models/containers/archive-product-price-point-product-id.md) | Template, Required | This is a container for one-of cases. | +| `pricePointId` | [`ArchiveProductPricePointPricePointId`](../../doc/models/containers/archive-product-price-point-price-point-id.md) | Template, Required | This is a container for one-of cases. | ## Response Type @@ -352,8 +364,12 @@ ProductPricePointResponse archiveProductPricePoint( ## Example Usage ```java -int productId = 202; -int pricePointId = 10; +ArchiveProductPricePointProductId productId = ArchiveProductPricePointProductId.fromNumber( + 124 +); +ArchiveProductPricePointPricePointId pricePointId = ArchiveProductPricePointPricePointId.fromNumber( + 188 +); try { ProductPricePointResponse result = productPricePointsController.archiveProductPricePoint(productId, pricePointId); diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index 9f25d44f..288b7cbf 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -13,8 +13,8 @@ | `ProrationDowngradeScheme` | `String` | Optional | **Default**: `"no-prorate"` | String getProrationDowngradeScheme() | setProrationDowngradeScheme(String prorationDowngradeScheme) | | `Allocations` | [`List`](../../doc/models/create-allocation-request.md) | Optional | - | List getAllocations() | setAllocations(List allocations) | | `AccrueCharge` | `Boolean` | Optional | - | Boolean getAccrueCharge() | setAccrueCharge(Boolean accrueCharge) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PaymentCollectionMethod` | [`PaymentCollectionMethod1`](../../doc/models/payment-collection-method-1.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription
**Default**: `PaymentCollectionMethod1.AUTOMATIC` | PaymentCollectionMethod1 getPaymentCollectionMethod() | setPaymentCollectionMethod(PaymentCollectionMethod1 paymentCollectionMethod) | ## Example (as JSON) @@ -47,7 +47,7 @@ } ], "accrue_charge": false, - "upgrade_charge": "upgrade_charge4" + "upgrade_charge": "full" } ``` diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 04cbce8f..72a32e2e 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -18,8 +18,8 @@ | `ProrationUpgradeScheme` | `String` | Optional | - | String getProrationUpgradeScheme() | setProrationUpgradeScheme(String prorationUpgradeScheme) | | `ProrationDowngradeScheme` | `String` | Optional | - | String getProrationDowngradeScheme() | setProrationDowngradeScheme(String prorationDowngradeScheme) | | `AccrueCharge` | `Boolean` | Optional | - | Boolean getAccrueCharge() | setAccrueCharge(Boolean accrueCharge) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PricePointId` | `Integer` | Optional | - | Integer getPricePointId() | setPricePointId(Integer pricePointId) | | `PreviousPricePointId` | `Integer` | Optional | - | Integer getPreviousPricePointId() | setPreviousPricePointId(Integer previousPricePointId) | | `ComponentHandle` | `String` | Optional | - | String getComponentHandle() | setComponentHandle(String componentHandle) | diff --git a/doc/models/allocation-settings.md b/doc/models/allocation-settings.md index 8c501f81..f8895e33 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -9,16 +9,16 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `AccrueCharge` | `Boolean` | Optional | - | Boolean getAccrueCharge() | setAccrueCharge(Boolean accrueCharge) | ## Example (as JSON) ```json { - "upgrade_charge": "upgrade_charge6", - "downgrade_credit": "downgrade_credit4", + "upgrade_charge": "none", + "downgrade_credit": "prorated", "accrue_charge": false } ``` diff --git a/doc/models/allocation.md b/doc/models/allocation.md index 3ecb4259..934ee060 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -22,8 +22,8 @@ | `PricePointHandle` | `String` | Optional | - | String getPricePointHandle() | setPricePointHandle(String pricePointHandle) | | `PreviousPricePointId` | `Integer` | Optional | - | Integer getPreviousPricePointId() | setPreviousPricePointId(Integer previousPricePointId) | | `AccrueCharge` | `Boolean` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. | Boolean getAccrueCharge() | setAccrueCharge(Boolean accrueCharge) | -| `UpgradeCharge` | `String` | Optional | The type of charge to be created if the change in cost is an upgrade. | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | The type of credit to be created if the change in cost is a downgrade. | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `Payment` | [`AllocationPayment2`](../../doc/models/containers/allocation-payment-2.md) | Optional | This is a container for one-of cases. | AllocationPayment2 getPayment() | setPayment(AllocationPayment2 payment) | ## Example (as JSON) diff --git a/doc/models/component.md b/doc/models/component.md index 74e4cd0f..896adee5 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -29,8 +29,8 @@ | `DefaultPricePointName` | `String` | Optional | - | String getDefaultPricePointName() | setDefaultPricePointName(String defaultPricePointName) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | String getTaxCode() | setTaxCode(String taxCode) | | `Recurring` | `Boolean` | Optional | - | Boolean getRecurring() | setRecurring(Boolean recurring) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `CreatedAt` | `String` | Optional | Timestamp indicating when this component was created | String getCreatedAt() | setCreatedAt(String createdAt) | | `UpdatedAt` | `String` | Optional | Timestamp indicating when this component was updated | String getUpdatedAt() | setUpdatedAt(String updatedAt) | | `ArchivedAt` | `String` | Optional | Timestamp indicating when this component was archived | String getArchivedAt() | setArchivedAt(String archivedAt) | diff --git a/doc/models/containers/archive-product-price-point-price-point-id.md b/doc/models/containers/archive-product-price-point-price-point-id.md new file mode 100644 index 00000000..2673308c --- /dev/null +++ b/doc/models/containers/archive-product-price-point-price-point-id.md @@ -0,0 +1,14 @@ + +# Archive Product Price Point Price Point Id + +## Class Name + +`ArchiveProductPricePointPricePointId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | ArchiveProductPricePointPricePointId.fromNumber(int number) | +| `String` | ArchiveProductPricePointPricePointId.fromString(String string) | + diff --git a/doc/models/containers/archive-product-price-point-product-id.md b/doc/models/containers/archive-product-price-point-product-id.md new file mode 100644 index 00000000..4d6c4535 --- /dev/null +++ b/doc/models/containers/archive-product-price-point-product-id.md @@ -0,0 +1,14 @@ + +# Archive Product Price Point Product Id + +## Class Name + +`ArchiveProductPricePointProductId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | ArchiveProductPricePointProductId.fromNumber(int number) | +| `String` | ArchiveProductPricePointProductId.fromString(String string) | + diff --git a/doc/models/containers/create-product-price-point-product-id.md b/doc/models/containers/create-product-price-point-product-id.md new file mode 100644 index 00000000..4f70d943 --- /dev/null +++ b/doc/models/containers/create-product-price-point-product-id.md @@ -0,0 +1,14 @@ + +# Create Product Price Point Product Id + +## Class Name + +`CreateProductPricePointProductId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | CreateProductPricePointProductId.fromNumber(int number) | +| `String` | CreateProductPricePointProductId.fromString(String string) | + diff --git a/doc/models/containers/list-product-price-points-input-product-id.md b/doc/models/containers/list-product-price-points-input-product-id.md new file mode 100644 index 00000000..ff2be98a --- /dev/null +++ b/doc/models/containers/list-product-price-points-input-product-id.md @@ -0,0 +1,14 @@ + +# List Product Price Points Input Product Id + +## Class Name + +`ListProductPricePointsInputProductId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | ListProductPricePointsInputProductId.fromNumber(int number) | +| `String` | ListProductPricePointsInputProductId.fromString(String string) | + diff --git a/doc/models/containers/read-product-price-point-price-point-id.md b/doc/models/containers/read-product-price-point-price-point-id.md new file mode 100644 index 00000000..8b57dac4 --- /dev/null +++ b/doc/models/containers/read-product-price-point-price-point-id.md @@ -0,0 +1,14 @@ + +# Read Product Price Point Price Point Id + +## Class Name + +`ReadProductPricePointPricePointId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | ReadProductPricePointPricePointId.fromNumber(int number) | +| `String` | ReadProductPricePointPricePointId.fromString(String string) | + diff --git a/doc/models/containers/read-product-price-point-product-id.md b/doc/models/containers/read-product-price-point-product-id.md new file mode 100644 index 00000000..14182fb1 --- /dev/null +++ b/doc/models/containers/read-product-price-point-product-id.md @@ -0,0 +1,14 @@ + +# Read Product Price Point Product Id + +## Class Name + +`ReadProductPricePointProductId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | ReadProductPricePointProductId.fromNumber(int number) | +| `String` | ReadProductPricePointProductId.fromString(String string) | + diff --git a/doc/models/containers/subscription-group-2.md b/doc/models/containers/subscription-group-2.md new file mode 100644 index 00000000..c5e078d0 --- /dev/null +++ b/doc/models/containers/subscription-group-2.md @@ -0,0 +1,13 @@ + +# Subscription Group 2 + +## Class Name + +`SubscriptionGroup2` + +## Cases + +| Type | Factory Method | +| --- | --- | +| [`SubscriptionGroupInlined`](../../../doc/models/subscription-group-inlined.md) | SubscriptionGroup2.fromSubscriptionGroupInlined(SubscriptionGroupInlined subscriptionGroupInlined) | + diff --git a/doc/models/containers/update-product-price-point-price-point-id.md b/doc/models/containers/update-product-price-point-price-point-id.md new file mode 100644 index 00000000..bffaa8ee --- /dev/null +++ b/doc/models/containers/update-product-price-point-price-point-id.md @@ -0,0 +1,14 @@ + +# Update Product Price Point Price Point Id + +## Class Name + +`UpdateProductPricePointPricePointId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | UpdateProductPricePointPricePointId.fromNumber(int number) | +| `String` | UpdateProductPricePointPricePointId.fromString(String string) | + diff --git a/doc/models/containers/update-product-price-point-product-id.md b/doc/models/containers/update-product-price-point-product-id.md new file mode 100644 index 00000000..65f8c882 --- /dev/null +++ b/doc/models/containers/update-product-price-point-product-id.md @@ -0,0 +1,14 @@ + +# Update Product Price Point Product Id + +## Class Name + +`UpdateProductPricePointProductId` + +## Cases + +| Type | Factory Method | +| --- | --- | +| `int` | UpdateProductPricePointProductId.fromNumber(int number) | +| `String` | UpdateProductPricePointProductId.fromString(String string) | + diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index fb7f7dce..758d193e 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -15,8 +15,8 @@ | `ProrationDowngradeScheme` | `String` | Optional | The scheme used if the proration is a downgrade. Defaults to the site setting if one is not provided. | String getProrationDowngradeScheme() | setProrationDowngradeScheme(String prorationDowngradeScheme) | | `ProrationUpgradeScheme` | `String` | Optional | The scheme used if the proration is an upgrade. Defaults to the site setting if one is not provided. | String getProrationUpgradeScheme() | setProrationUpgradeScheme(String prorationUpgradeScheme) | | `AccrueCharge` | `Boolean` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. Defaults to the site setting if one is not provided. | Boolean getAccrueCharge() | setAccrueCharge(Boolean accrueCharge) | -| `DowngradeCredit` | [`CreditType1`](../../doc/models/credit-type-1.md) | Optional | The type of credit to be created if the change in cost is a downgrade. Defaults to the component and then site setting if one is not provided. | CreditType1 getDowngradeCredit() | setDowngradeCredit(CreditType1 downgradeCredit) | -| `UpgradeCharge` | [`CreditType1`](../../doc/models/credit-type-1.md) | Optional | The type of charge to be created if the change in cost is an upgrade. Defaults to the component and then site setting if one is not provided. | CreditType1 getUpgradeCharge() | setUpgradeCharge(CreditType1 upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | | `PricePointId` | [`CreateAllocationPricePointId`](../../doc/models/containers/create-allocation-price-point-id.md) | Optional | This is a container for one-of cases. | CreateAllocationPricePointId getPricePointId() | setPricePointId(CreateAllocationPricePointId pricePointId) | | `BillingSchedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | BillingSchedule getBillingSchedule() | setBillingSchedule(BillingSchedule billingSchedule) | diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index 7d2cf40c..2368c9e5 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -29,7 +29,7 @@ "unit_price": 23.26 } ], - "upgrade_charge": "upgrade_charge0", + "upgrade_charge": "full", "event_based_billing_metric_id": 68 } } diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index fcb70f89..51f61ed7 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -39,7 +39,7 @@ "unit_price": 23.26 } ], - "upgrade_charge": "upgrade_charge2" + "upgrade_charge": "none" } } ``` diff --git a/doc/models/create-quantity-based-component.md b/doc/models/create-quantity-based-component.md index 2d3e84dd..7f768358 100644 --- a/doc/models/create-quantity-based-component.md +++ b/doc/models/create-quantity-based-component.md @@ -34,7 +34,7 @@ "unit_price": 23.26 } ], - "upgrade_charge": "upgrade_charge8" + "upgrade_charge": "prorated" } } ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index d1997e67..d3f79b9e 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -18,7 +18,10 @@ "usage": { "quantity": 162.34, "price_point_id": "price_point_id0", - "memo": "memo2" + "memo": "memo2", + "billing_schedule": { + "initial_billing_at": "2016-03-13" + } } } ``` diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 349a0668..1a5775de 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -12,6 +12,7 @@ | `Quantity` | `Double` | Optional | integer by default or decimal number if fractional quantities are enabled for the component | Double getQuantity() | setQuantity(Double quantity) | | `PricePointId` | `String` | Optional | - | String getPricePointId() | setPricePointId(String pricePointId) | | `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | +| `BillingSchedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | This attribute is particularly useful when you need to align billing events for different components on distinct schedules within a subscription. Please note this only works for site with Multifrequency enabled | BillingSchedule getBillingSchedule() | setBillingSchedule(BillingSchedule billingSchedule) | ## Example (as JSON) @@ -19,7 +20,10 @@ { "quantity": 23.44, "price_point_id": "price_point_id0", - "memo": "memo2" + "memo": "memo2", + "billing_schedule": { + "initial_billing_at": "2016-03-13" + } } ``` diff --git a/doc/models/credit-type-1.md b/doc/models/credit-type-1.md deleted file mode 100644 index 6df8a1a3..00000000 --- a/doc/models/credit-type-1.md +++ /dev/null @@ -1,18 +0,0 @@ - -# Credit Type 1 - -The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. -Available values: `full`, `prorated`, `none`. - -## Enumeration - -`CreditType1` - -## Fields - -| Name | -| --- | -| `Full` | -| `Prorated` | -| `None` | - diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index 70f50fe4..130b05f6 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -1,7 +1,8 @@ # Credit Type -The type of charge to be applied when a component is upgraded. Valid values are: `prorated`, `full`, `none`. +The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. +Available values: `full`, `prorated`, `none`. ## Enumeration diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index 22780259..0a4483a9 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -16,8 +16,8 @@ | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://help.chargify.com/products/product-components.html#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PricePoints` | [`List`](../../doc/models/component-price-point-item.md) | Optional | - | List getPricePoints() | setPricePoints(List pricePoints) | | `UnitPrice` | [`EBBComponentUnitPrice`](../../doc/models/containers/ebb-component-unit-price.md) | Optional | This is a container for one-of cases. | EBBComponentUnitPrice getUnitPrice() | setUnitPrice(EBBComponentUnitPrice unitPrice) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | String getTaxCode() | setTaxCode(String taxCode) | @@ -42,7 +42,7 @@ "unit_price": 23.26 } ], - "upgrade_charge": "upgrade_charge2", + "upgrade_charge": "full", "event_based_billing_metric_id": 190 } ``` diff --git a/doc/models/invoice-event-type.md b/doc/models/invoice-event-type.md index 0963ae0e..b6396855 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -13,6 +13,7 @@ Invoice Event Type | --- | | `IssueInvoice` | | `ApplyCreditNote` | +| `CreateCreditNote` | | `ApplyPayment` | | `ApplyDebitNote` | | `RefundInvoice` | @@ -22,4 +23,5 @@ Invoice Event Type | `ChangeInvoiceStatus` | | `ChangeInvoiceCollectionMethod` | | `RemovePayment` | +| `FailedPayment` | diff --git a/doc/models/invoice-event.md b/doc/models/invoice-event.md index 86b26dde..043a6d26 100644 --- a/doc/models/invoice-event.md +++ b/doc/models/invoice-event.md @@ -20,7 +20,7 @@ ```json { "id": 78, - "event_type": "remove_payment", + "event_type": "apply_payment", "event_data": { "uid": "uid2", "credit_note_number": "credit_note_number4", diff --git a/doc/models/list-invoice-events-response.md b/doc/models/list-invoice-events-response.md index 3ef32a8f..f3bd69ce 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -21,7 +21,7 @@ "events": [ { "id": 68, - "event_type": "issue_invoice", + "event_type": "void_remainder", "event_data": { "uid": "uid2", "credit_note_number": "credit_note_number4", diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index 72f01f4e..2d184f37 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -16,8 +16,8 @@ | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405020625677#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PricePoints` | [`List`](../../doc/models/component-price-point-item.md) | Optional | - | List getPricePoints() | setPricePoints(List pricePoints) | | `UnitPrice` | [`MeteredComponentUnitPrice`](../../doc/models/containers/metered-component-unit-price.md) | Optional | This is a container for one-of cases. | MeteredComponentUnitPrice getUnitPrice() | setUnitPrice(MeteredComponentUnitPrice unitPrice) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | String getTaxCode() | setTaxCode(String taxCode) | @@ -44,7 +44,7 @@ "unit_price": 23.26 } ], - "upgrade_charge": "upgrade_charge4" + "upgrade_charge": "full" } ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index 88219f48..c754fc54 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -16,8 +16,8 @@ | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PricePoints` | [`List`](../../doc/models/component-price-point-item.md) | Optional | - | List getPricePoints() | setPricePoints(List pricePoints) | | `UnitPrice` | [`OnOffComponentUnitPrice`](../../doc/models/containers/on-off-component-unit-price.md) | Optional | This is a container for one-of cases. | OnOffComponentUnitPrice getUnitPrice() | setUnitPrice(OnOffComponentUnitPrice unitPrice) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | String getTaxCode() | setTaxCode(String taxCode) | diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 361ff4d5..f392ef72 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -16,8 +16,8 @@ | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#general-price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PricePoints` | [`List`](../../doc/models/prepaid-component-price-point.md) | Optional | - | List getPricePoints() | setPricePoints(List pricePoints) | | `UnitPrice` | [`PrepaidUsageComponentUnitPrice`](../../doc/models/containers/prepaid-usage-component-unit-price.md) | Optional | This is a container for one-of cases. | PrepaidUsageComponentUnitPrice getUnitPrice() | setUnitPrice(PrepaidUsageComponentUnitPrice unitPrice) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | String getTaxCode() | setTaxCode(String taxCode) | diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index 65aa3498..bf710139 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -16,8 +16,8 @@ | `Taxable` | `Boolean` | Optional | Boolean flag describing whether a component is taxable or not. | Boolean getTaxable() | setTaxable(Boolean taxable) | | `PricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | PricingScheme getPricingScheme() | setPricingScheme(PricingScheme pricingScheme) | | `Prices` | [`List`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://chargify.zendesk.com/hc/en-us/articles/4407755865883#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | List getPrices() | setPrices(List prices) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `PricePoints` | [`List`](../../doc/models/component-price-point-item.md) | Optional | - | List getPricePoints() | setPricePoints(List pricePoints) | | `UnitPrice` | [`QuantityBasedComponentUnitPrice`](../../doc/models/containers/quantity-based-component-unit-price.md) | Optional | This is a container for one-of cases. | QuantityBasedComponentUnitPrice getUnitPrice() | setUnitPrice(QuantityBasedComponentUnitPrice unitPrice) | | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | String getTaxCode() | setTaxCode(String taxCode) | @@ -45,7 +45,7 @@ "unit_price": 23.26 } ], - "upgrade_charge": "upgrade_charge0" + "upgrade_charge": "full" } ``` diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 4f18da4b..ba7430c5 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -22,8 +22,8 @@ | `ComponentHandle` | `String` | Optional | - | String getComponentHandle() | setComponentHandle(String componentHandle) | | `SubscriptionId` | `Integer` | Optional | - | Integer getSubscriptionId() | setSubscriptionId(Integer subscriptionId) | | `Recurring` | `Boolean` | Optional | - | Boolean getRecurring() | setRecurring(Boolean recurring) | -| `UpgradeCharge` | `String` | Optional | - | String getUpgradeCharge() | setUpgradeCharge(String upgradeCharge) | -| `DowngradeCredit` | `String` | Optional | - | String getDowngradeCredit() | setDowngradeCredit(String downgradeCredit) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `DowngradeCredit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getDowngradeCredit() | setDowngradeCredit(CreditType downgradeCredit) | | `ArchivedAt` | `String` | Optional | - | String getArchivedAt() | setArchivedAt(String archivedAt) | | `PricePointId` | `Integer` | Optional | - | Integer getPricePointId() | setPricePointId(Integer pricePointId) | | `PricePointHandle` | `String` | Optional | - | String getPricePointHandle() | setPricePointHandle(String pricePointHandle) | diff --git a/doc/models/subscription.md b/doc/models/subscription.md index 19b3bed3..f894de1c 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -38,7 +38,7 @@ | `Customer` | [`Customer`](../../doc/models/customer.md) | Optional | - | Customer getCustomer() | setCustomer(Customer customer) | | `Product` | [`Product`](../../doc/models/product.md) | Optional | - | Product getProduct() | setProduct(Product product) | | `CreditCard` | [`PaymentProfile`](../../doc/models/payment-profile.md) | Optional | - | PaymentProfile getCreditCard() | setCreditCard(PaymentProfile creditCard) | -| `Group` | [`SubscriptionGroupInlined`](../../doc/models/subscription-group-inlined.md) | Optional | - | SubscriptionGroupInlined getGroup() | setGroup(SubscriptionGroupInlined group) | +| `Group` | [`SubscriptionGroup2`](../../doc/models/containers/subscription-group-2.md) | Optional | This is a container for one-of cases. | SubscriptionGroup2 getGroup() | setGroup(SubscriptionGroup2 group) | | `BankAccount` | [`SubscriptionBankAccount`](../../doc/models/subscription-bank-account.md) | Optional | - | SubscriptionBankAccount getBankAccount() | setBankAccount(SubscriptionBankAccount bankAccount) | | `PaymentType` | `String` | Optional | The payment profile type for the active profile on file. | String getPaymentType() | setPaymentType(String paymentType) | | `ReferralCode` | `String` | Optional | The subscription's unique code that can be given to referrals. | String getReferralCode() | setReferralCode(String referralCode) | diff --git a/doc/models/update-component.md b/doc/models/update-component.md index f783c114..dfad42ec 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -17,7 +17,7 @@ | `TaxCode` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters. | String getTaxCode() | setTaxCode(String taxCode) | | `ItemCategory` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | ItemCategory getItemCategory() | setItemCategory(ItemCategory itemCategory) | | `DisplayOnHostedPage` | `Boolean` | Optional | - | Boolean getDisplayOnHostedPage() | setDisplayOnHostedPage(Boolean displayOnHostedPage) | -| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of charge to be applied when a component is upgraded. Valid values are: `prorated`, `full`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | +| `UpgradeCharge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | CreditType getUpgradeCharge() | setUpgradeCharge(CreditType upgradeCharge) | ## Example (as JSON) diff --git a/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java b/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java index 49ac6851..ab7d6ebf 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/InvoicesController.java @@ -228,10 +228,10 @@ private ApiCall prepareReadInvoiceRequest( * applied payment) as well as a snapshot of the `invoice` at the time of event completion. * Exposed event types are: + issue_invoice + apply_credit_note + apply_payment + refund_invoice * + void_invoice + void_remainder + backport_invoice + change_invoice_status + - * change_invoice_collection_method + remove_payment Invoice events are returned in ascending - * order. If both a `since_date` and `since_id` are provided in request parameters, the - * `since_date` will be used. Note - invoice events that occurred prior to 09/05/2018 __will - * not__ contain an `invoice` snapshot. + * change_invoice_collection_method + remove_payment + failed_payment + apply_debit_note + + * create_debit_note Invoice events are returned in ascending order. If both a `since_date` and + * `since_id` are provided in request parameters, the `since_date` will be used. Note - invoice + * events that occurred prior to 09/05/2018 __will not__ contain an `invoice` snapshot. * @param input ListInvoiceEventsInput object containing request parameters * @return Returns the ListInvoiceEventsResponse response from the API call * @throws ApiException Represents error response from the server. diff --git a/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java b/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java index d26b5ab8..324cecf1 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/ProductPricePointsController.java @@ -28,6 +28,13 @@ import com.maxio.advancedbilling.models.ProductResponse; import com.maxio.advancedbilling.models.UpdateCurrencyPricesRequest; import com.maxio.advancedbilling.models.UpdateProductPricePointRequest; +import com.maxio.advancedbilling.models.containers.ArchiveProductPricePointPricePointId; +import com.maxio.advancedbilling.models.containers.ArchiveProductPricePointProductId; +import com.maxio.advancedbilling.models.containers.CreateProductPricePointProductId; +import com.maxio.advancedbilling.models.containers.ReadProductPricePointPricePointId; +import com.maxio.advancedbilling.models.containers.ReadProductPricePointProductId; +import com.maxio.advancedbilling.models.containers.UpdateProductPricePointPricePointId; +import com.maxio.advancedbilling.models.containers.UpdateProductPricePointProductId; import io.apimatic.core.ApiCall; import io.apimatic.core.ErrorCase; import io.apimatic.core.GlobalConfiguration; @@ -58,7 +65,7 @@ public ProductPricePointsController(GlobalConfiguration globalConfig) { * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ProductPricePointResponse createProductPricePoint( - final int productId, + final CreateProductPricePointProductId productId, final CreateProductPricePointRequest body) throws ApiException, IOException { return prepareCreateProductPricePointRequest(productId, body).execute(); } @@ -67,7 +74,7 @@ public ProductPricePointResponse createProductPricePoint( * Builds the ApiCall object for createProductPricePoint. */ private ApiCall prepareCreateProductPricePointRequest( - final int productId, + final CreateProductPricePointProductId productId, final CreateProductPricePointRequest body) throws JsonProcessingException, IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) @@ -76,7 +83,7 @@ private ApiCall prepareCreateProductPri .path("/products/{product_id}/price_points.json") .bodyParam(param -> param.value(body).isRequired(false)) .bodySerializer(() -> ApiHelper.serialize(body)) - .templateParam(param -> param.key("product_id").value(productId).isRequired(false) + .templateParam(param -> param.key("product_id").value(productId) .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) @@ -126,7 +133,7 @@ private ApiCall prepareListProduct .value(input.getCurrencyPrices()).isRequired(false)) .queryParam(param -> param.key("filter[type]") .value(PricePointType.toValue(input.getFilterType())).isRequired(false)) - .templateParam(param -> param.key("product_id").value(input.getProductId()).isRequired(false) + .templateParam(param -> param.key("product_id").value(input.getProductId()) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) .authenticationKey(BaseController.AUTHENTICATION_KEY) @@ -154,8 +161,8 @@ private ApiCall prepareListProduct * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ProductPricePointResponse updateProductPricePoint( - final int productId, - final int pricePointId, + final UpdateProductPricePointProductId productId, + final UpdateProductPricePointPricePointId pricePointId, final UpdateProductPricePointRequest body) throws ApiException, IOException { return prepareUpdateProductPricePointRequest(productId, pricePointId, body).execute(); } @@ -164,8 +171,8 @@ public ProductPricePointResponse updateProductPricePoint( * Builds the ApiCall object for updateProductPricePoint. */ private ApiCall prepareUpdateProductPricePointRequest( - final int productId, - final int pricePointId, + final UpdateProductPricePointProductId productId, + final UpdateProductPricePointPricePointId pricePointId, final UpdateProductPricePointRequest body) throws JsonProcessingException, IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) @@ -174,9 +181,9 @@ private ApiCall prepareUpdateProductPri .path("/products/{product_id}/price_points/{price_point_id}.json") .bodyParam(param -> param.value(body).isRequired(false)) .bodySerializer(() -> ApiHelper.serialize(body)) - .templateParam(param -> param.key("product_id").value(productId).isRequired(false) + .templateParam(param -> param.key("product_id").value(productId) .shouldEncode(true)) - .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) + .templateParam(param -> param.key("price_point_id").value(pricePointId) .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) @@ -210,8 +217,8 @@ private ApiCall prepareUpdateProductPri * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ProductPricePointResponse readProductPricePoint( - final int productId, - final int pricePointId, + final ReadProductPricePointProductId productId, + final ReadProductPricePointPricePointId pricePointId, final Boolean currencyPrices) throws ApiException, IOException { return prepareReadProductPricePointRequest(productId, pricePointId, currencyPrices).execute(); @@ -221,8 +228,8 @@ public ProductPricePointResponse readProductPricePoint( * Builds the ApiCall object for readProductPricePoint. */ private ApiCall prepareReadProductPricePointRequest( - final int productId, - final int pricePointId, + final ReadProductPricePointProductId productId, + final ReadProductPricePointPricePointId pricePointId, final Boolean currencyPrices) throws IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) @@ -231,9 +238,9 @@ private ApiCall prepareReadProductPrice .path("/products/{product_id}/price_points/{price_point_id}.json") .queryParam(param -> param.key("currency_prices") .value(currencyPrices).isRequired(false)) - .templateParam(param -> param.key("product_id").value(productId).isRequired(false) + .templateParam(param -> param.key("product_id").value(productId) .shouldEncode(true)) - .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) + .templateParam(param -> param.key("price_point_id").value(pricePointId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) .authenticationKey(BaseController.AUTHENTICATION_KEY) @@ -259,8 +266,8 @@ private ApiCall prepareReadProductPrice * @throws IOException Signals that an I/O exception of some sort has occurred. */ public ProductPricePointResponse archiveProductPricePoint( - final int productId, - final int pricePointId) throws ApiException, IOException { + final ArchiveProductPricePointProductId productId, + final ArchiveProductPricePointPricePointId pricePointId) throws ApiException, IOException { return prepareArchiveProductPricePointRequest(productId, pricePointId).execute(); } @@ -268,16 +275,16 @@ public ProductPricePointResponse archiveProductPricePoint( * Builds the ApiCall object for archiveProductPricePoint. */ private ApiCall prepareArchiveProductPricePointRequest( - final int productId, - final int pricePointId) throws IOException { + final ArchiveProductPricePointProductId productId, + final ArchiveProductPricePointPricePointId pricePointId) throws IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) .requestBuilder(requestBuilder -> requestBuilder .server(Server.ENUM_DEFAULT.value()) .path("/products/{product_id}/price_points/{price_point_id}.json") - .templateParam(param -> param.key("product_id").value(productId).isRequired(false) + .templateParam(param -> param.key("product_id").value(productId) .shouldEncode(true)) - .templateParam(param -> param.key("price_point_id").value(pricePointId).isRequired(false) + .templateParam(param -> param.key("price_point_id").value(pricePointId) .shouldEncode(true)) .headerParam(param -> param.key("accept").value("application/json")) .authenticationKey(BaseController.AUTHENTICATION_KEY) diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.java b/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.java index 1ee30a23..ef947b94 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocateComponents.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 AllocateComponents { private String prorationDowngradeScheme; private List allocations; private Boolean accrueCharge; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private PaymentCollectionMethod1 paymentCollectionMethod; /** @@ -38,8 +40,8 @@ public AllocateComponents() { * @param prorationDowngradeScheme String value for prorationDowngradeScheme. * @param allocations List of CreateAllocationRequest value for allocations. * @param accrueCharge Boolean value for accrueCharge. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param paymentCollectionMethod PaymentCollectionMethod1 value for paymentCollectionMethod. */ public AllocateComponents( @@ -47,8 +49,33 @@ public AllocateComponents( String prorationDowngradeScheme, List allocations, Boolean accrueCharge, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, + PaymentCollectionMethod1 paymentCollectionMethod) { + this.prorationUpgradeScheme = prorationUpgradeScheme; + this.prorationDowngradeScheme = prorationDowngradeScheme; + this.allocations = allocations; + this.accrueCharge = accrueCharge; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + this.paymentCollectionMethod = paymentCollectionMethod; + } + + /** + * Initialization constructor. + * @param prorationUpgradeScheme String value for prorationUpgradeScheme. + * @param prorationDowngradeScheme String value for prorationDowngradeScheme. + * @param allocations List of CreateAllocationRequest value for allocations. + * @param accrueCharge Boolean value for accrueCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param paymentCollectionMethod PaymentCollectionMethod1 value for paymentCollectionMethod. + */ + + protected AllocateComponents(String prorationUpgradeScheme, String prorationDowngradeScheme, + List allocations, Boolean accrueCharge, + OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, PaymentCollectionMethod1 paymentCollectionMethod) { this.prorationUpgradeScheme = prorationUpgradeScheme; this.prorationDowngradeScheme = prorationDowngradeScheme; @@ -136,41 +163,89 @@ public void setAccrueCharge(Boolean accrueCharge) { } /** - * Getter for UpgradeCharge. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -220,9 +295,9 @@ public Builder toBuilder() { .prorationDowngradeScheme(getProrationDowngradeScheme()) .allocations(getAllocations()) .accrueCharge(getAccrueCharge()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()) .paymentCollectionMethod(getPaymentCollectionMethod()); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); return builder; } @@ -234,8 +309,8 @@ public static class Builder { private String prorationDowngradeScheme = "no-prorate"; private List allocations; private Boolean accrueCharge; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private PaymentCollectionMethod1 paymentCollectionMethod = PaymentCollectionMethod1.AUTOMATIC; @@ -283,21 +358,39 @@ public Builder accrueCharge(Boolean accrueCharge) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/Allocation.java b/src/main/java/com/maxio/advancedbilling/models/Allocation.java index aacedaea..43dde2a6 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Allocation.java +++ b/src/main/java/com/maxio/advancedbilling/models/Allocation.java @@ -30,8 +30,8 @@ public class Allocation { private String pricePointHandle; private Integer previousPricePointId; private Boolean accrueCharge; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private OptionalNullable payment; /** @@ -55,8 +55,8 @@ public Allocation() { * @param pricePointHandle String value for pricePointHandle. * @param previousPricePointId Integer value for previousPricePointId. * @param accrueCharge Boolean value for accrueCharge. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param payment AllocationPayment2 value for payment. */ public Allocation( @@ -73,8 +73,8 @@ public Allocation( String pricePointHandle, Integer previousPricePointId, Boolean accrueCharge, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, AllocationPayment2 payment) { this.componentId = componentId; this.subscriptionId = subscriptionId; @@ -89,8 +89,8 @@ public Allocation( this.pricePointHandle = pricePointHandle; this.previousPricePointId = previousPricePointId; this.accrueCharge = accrueCharge; - this.upgradeCharge = upgradeCharge; - this.downgradeCredit = downgradeCredit; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); this.payment = OptionalNullable.of(payment); } @@ -109,8 +109,8 @@ public Allocation( * @param pricePointHandle String value for pricePointHandle. * @param previousPricePointId Integer value for previousPricePointId. * @param accrueCharge Boolean value for accrueCharge. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param payment AllocationPayment2 value for payment. */ @@ -118,7 +118,8 @@ protected Allocation(Integer componentId, Integer subscriptionId, Integer quanti Integer previousQuantity, OptionalNullable memo, String timestamp, String prorationUpgradeScheme, String prorationDowngradeScheme, Integer pricePointId, String pricePointName, String pricePointHandle, Integer previousPricePointId, - Boolean accrueCharge, String upgradeCharge, String downgradeCredit, + Boolean accrueCharge, OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, OptionalNullable payment) { this.componentId = componentId; this.subscriptionId = subscriptionId; @@ -434,45 +435,89 @@ public void setAccrueCharge(Boolean accrueCharge) { } /** - * Getter for UpgradeCharge. - * The type of charge to be created if the change in cost is an upgrade. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * The type of charge to be created if the change in cost is an upgrade. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * The type of credit to be created if the change in cost is a downgrade. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * The type of credit to be created if the change in cost is a downgrade. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -545,10 +590,10 @@ public Builder toBuilder() { .pricePointName(getPricePointName()) .pricePointHandle(getPricePointHandle()) .previousPricePointId(getPreviousPricePointId()) - .accrueCharge(getAccrueCharge()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()); + .accrueCharge(getAccrueCharge()); builder.memo = internalGetMemo(); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); builder.payment = internalGetPayment(); return builder; } @@ -570,8 +615,8 @@ public static class Builder { private String pricePointHandle; private Integer previousPricePointId; private Boolean accrueCharge; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private OptionalNullable payment; @@ -717,21 +762,39 @@ public Builder accrueCharge(Boolean accrueCharge) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java index 586cee95..61eaf3e8 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocationPreviewItem.java @@ -25,8 +25,8 @@ public class AllocationPreviewItem { private String prorationUpgradeScheme; private String prorationDowngradeScheme; private Boolean accrueCharge; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private Integer pricePointId; private Integer previousPricePointId; private String componentHandle; @@ -48,8 +48,8 @@ public AllocationPreviewItem() { * @param prorationUpgradeScheme String value for prorationUpgradeScheme. * @param prorationDowngradeScheme String value for prorationDowngradeScheme. * @param accrueCharge Boolean value for accrueCharge. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param pricePointId Integer value for pricePointId. * @param previousPricePointId Integer value for previousPricePointId. * @param componentHandle String value for componentHandle. @@ -64,8 +64,8 @@ public AllocationPreviewItem( String prorationUpgradeScheme, String prorationDowngradeScheme, Boolean accrueCharge, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, Integer pricePointId, Integer previousPricePointId, String componentHandle) { @@ -78,8 +78,8 @@ public AllocationPreviewItem( this.prorationUpgradeScheme = prorationUpgradeScheme; this.prorationDowngradeScheme = prorationDowngradeScheme; this.accrueCharge = accrueCharge; - this.upgradeCharge = upgradeCharge; - this.downgradeCredit = downgradeCredit; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); this.pricePointId = pricePointId; this.previousPricePointId = previousPricePointId; this.componentHandle = componentHandle; @@ -96,8 +96,8 @@ public AllocationPreviewItem( * @param prorationUpgradeScheme String value for prorationUpgradeScheme. * @param prorationDowngradeScheme String value for prorationDowngradeScheme. * @param accrueCharge Boolean value for accrueCharge. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param pricePointId Integer value for pricePointId. * @param previousPricePointId Integer value for previousPricePointId. * @param componentHandle String value for componentHandle. @@ -106,7 +106,8 @@ public AllocationPreviewItem( protected AllocationPreviewItem(Integer componentId, Integer subscriptionId, Double quantity, Integer previousQuantity, String memo, OptionalNullable timestamp, String prorationUpgradeScheme, String prorationDowngradeScheme, Boolean accrueCharge, - String upgradeCharge, String downgradeCredit, Integer pricePointId, + OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, Integer pricePointId, Integer previousPricePointId, String componentHandle) { this.componentId = componentId; this.subscriptionId = subscriptionId; @@ -312,41 +313,89 @@ public void setAccrueCharge(Boolean accrueCharge) { } /** - * Getter for UpgradeCharge. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -437,12 +486,12 @@ public Builder toBuilder() { .prorationUpgradeScheme(getProrationUpgradeScheme()) .prorationDowngradeScheme(getProrationDowngradeScheme()) .accrueCharge(getAccrueCharge()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()) .pricePointId(getPricePointId()) .previousPricePointId(getPreviousPricePointId()) .componentHandle(getComponentHandle()); builder.timestamp = internalGetTimestamp(); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); return builder; } @@ -459,8 +508,8 @@ public static class Builder { private String prorationUpgradeScheme; private String prorationDowngradeScheme; private Boolean accrueCharge; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private Integer pricePointId; private Integer previousPricePointId; private String componentHandle; @@ -568,21 +617,39 @@ public Builder accrueCharge(Boolean accrueCharge) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/AllocationSettings.java b/src/main/java/com/maxio/advancedbilling/models/AllocationSettings.java index 22257598..38d31004 100644 --- a/src/main/java/com/maxio/advancedbilling/models/AllocationSettings.java +++ b/src/main/java/com/maxio/advancedbilling/models/AllocationSettings.java @@ -16,8 +16,8 @@ * This is a model class for AllocationSettings type. */ public class AllocationSettings { - private OptionalNullable upgradeCharge; - private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private Boolean accrueCharge; /** @@ -28,13 +28,13 @@ public AllocationSettings() { /** * Initialization constructor. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param accrueCharge Boolean value for accrueCharge. */ public AllocationSettings( - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, Boolean accrueCharge) { this.upgradeCharge = OptionalNullable.of(upgradeCharge); this.downgradeCredit = OptionalNullable.of(downgradeCredit); @@ -43,13 +43,13 @@ public AllocationSettings( /** * Initialization constructor. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param accrueCharge Boolean value for accrueCharge. */ - protected AllocationSettings(OptionalNullable upgradeCharge, - OptionalNullable downgradeCredit, Boolean accrueCharge) { + protected AllocationSettings(OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, Boolean accrueCharge) { this.upgradeCharge = upgradeCharge; this.downgradeCredit = downgradeCredit; this.accrueCharge = accrueCharge; @@ -57,34 +57,42 @@ protected AllocationSettings(OptionalNullable upgradeCharge, /** * Internal Getter for UpgradeCharge. - * @return Returns the Internal String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetUpgradeCharge() { + protected OptionalNullable internalGetUpgradeCharge() { return this.upgradeCharge; } /** * Getter for UpgradeCharge. - * @return Returns the String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType */ - public String getUpgradeCharge() { + public CreditType getUpgradeCharge() { return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { + public void setUpgradeCharge(CreditType upgradeCharge) { this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. */ public void unsetUpgradeCharge() { upgradeCharge = null; @@ -92,34 +100,42 @@ public void unsetUpgradeCharge() { /** * Internal Getter for DowngradeCredit. - * @return Returns the Internal String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetDowngradeCredit() { + protected OptionalNullable internalGetDowngradeCredit() { return this.downgradeCredit; } /** * Getter for DowngradeCredit. - * @return Returns the String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType */ - public String getDowngradeCredit() { + public CreditType getDowngradeCredit() { return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { + public void setDowngradeCredit(CreditType downgradeCredit) { this.downgradeCredit = OptionalNullable.of(downgradeCredit); } /** * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. */ public void unsetDowngradeCredit() { downgradeCredit = null; @@ -171,18 +187,18 @@ public Builder toBuilder() { * Class to build instances of {@link AllocationSettings}. */ public static class Builder { - private OptionalNullable upgradeCharge; - private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private Boolean accrueCharge; /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { + public Builder upgradeCharge(CreditType upgradeCharge) { this.upgradeCharge = OptionalNullable.of(upgradeCharge); return this; } @@ -198,10 +214,10 @@ public Builder unsetUpgradeCharge() { /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { + public Builder downgradeCredit(CreditType downgradeCredit) { this.downgradeCredit = OptionalNullable.of(downgradeCredit); return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/Component.java b/src/main/java/com/maxio/advancedbilling/models/Component.java index ebc0b318..95344344 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Component.java +++ b/src/main/java/com/maxio/advancedbilling/models/Component.java @@ -37,8 +37,8 @@ public class Component { private String defaultPricePointName; private OptionalNullable taxCode; private Boolean recurring; - private OptionalNullable upgradeCharge; - private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private String createdAt; private String updatedAt; private OptionalNullable archivedAt; @@ -77,8 +77,8 @@ public Component() { * @param defaultPricePointName String value for defaultPricePointName. * @param taxCode String value for taxCode. * @param recurring Boolean value for recurring. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param createdAt String value for createdAt. * @param updatedAt String value for updatedAt. * @param archivedAt String value for archivedAt. @@ -110,8 +110,8 @@ public Component( String defaultPricePointName, String taxCode, Boolean recurring, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, String createdAt, String updatedAt, String archivedAt, @@ -176,8 +176,8 @@ public Component( * @param defaultPricePointName String value for defaultPricePointName. * @param taxCode String value for taxCode. * @param recurring Boolean value for recurring. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param createdAt String value for createdAt. * @param updatedAt String value for updatedAt. * @param archivedAt String value for archivedAt. @@ -196,8 +196,8 @@ protected Component(Integer id, String name, OptionalNullable handle, Boolean taxable, OptionalNullable description, Integer defaultPricePointId, OptionalNullable> prices, Integer pricePointCount, String pricePointsUrl, String defaultPricePointName, OptionalNullable taxCode, - Boolean recurring, OptionalNullable upgradeCharge, - OptionalNullable downgradeCredit, String createdAt, String updatedAt, + Boolean recurring, OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, String createdAt, String updatedAt, OptionalNullable archivedAt, Boolean hideDateRangeOnInvoice, Boolean allowFractionalQuantities, OptionalNullable itemCategory, OptionalNullable useSiteExchangeRate, OptionalNullable accountingCode, @@ -807,34 +807,42 @@ public void setRecurring(Boolean recurring) { /** * Internal Getter for UpgradeCharge. - * @return Returns the Internal String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetUpgradeCharge() { + protected OptionalNullable internalGetUpgradeCharge() { return this.upgradeCharge; } /** * Getter for UpgradeCharge. - * @return Returns the String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType */ - public String getUpgradeCharge() { + public CreditType getUpgradeCharge() { return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { + public void setUpgradeCharge(CreditType upgradeCharge) { this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. */ public void unsetUpgradeCharge() { upgradeCharge = null; @@ -842,34 +850,42 @@ public void unsetUpgradeCharge() { /** * Internal Getter for DowngradeCredit. - * @return Returns the Internal String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetDowngradeCredit() { + protected OptionalNullable internalGetDowngradeCredit() { return this.downgradeCredit; } /** * Getter for DowngradeCredit. - * @return Returns the String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType */ - public String getDowngradeCredit() { + public CreditType getDowngradeCredit() { return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { + public void setDowngradeCredit(CreditType downgradeCredit) { this.downgradeCredit = OptionalNullable.of(downgradeCredit); } /** * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. */ public void unsetDowngradeCredit() { downgradeCredit = null; @@ -1227,8 +1243,8 @@ public static class Builder { private String defaultPricePointName; private OptionalNullable taxCode; private Boolean recurring; - private OptionalNullable upgradeCharge; - private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private String createdAt; private String updatedAt; private OptionalNullable archivedAt; @@ -1506,10 +1522,10 @@ public Builder recurring(Boolean recurring) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { + public Builder upgradeCharge(CreditType upgradeCharge) { this.upgradeCharge = OptionalNullable.of(upgradeCharge); return this; } @@ -1525,10 +1541,10 @@ public Builder unsetUpgradeCharge() { /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { + public Builder downgradeCredit(CreditType downgradeCredit) { this.downgradeCredit = OptionalNullable.of(downgradeCredit); return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java b/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java index 98d260fc..15f9c859 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateAllocation.java @@ -23,8 +23,8 @@ public class CreateAllocation { private String prorationDowngradeScheme; private String prorationUpgradeScheme; private Boolean accrueCharge; - private CreditType1 downgradeCredit; - private CreditType1 upgradeCharge; + private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; private OptionalNullable pricePointId; private BillingSchedule billingSchedule; @@ -42,8 +42,8 @@ public CreateAllocation() { * @param prorationDowngradeScheme String value for prorationDowngradeScheme. * @param prorationUpgradeScheme String value for prorationUpgradeScheme. * @param accrueCharge Boolean value for accrueCharge. - * @param downgradeCredit CreditType1 value for downgradeCredit. - * @param upgradeCharge CreditType1 value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. * @param pricePointId CreateAllocationPricePointId value for pricePointId. * @param billingSchedule BillingSchedule value for billingSchedule. */ @@ -54,8 +54,8 @@ public CreateAllocation( String prorationDowngradeScheme, String prorationUpgradeScheme, Boolean accrueCharge, - CreditType1 downgradeCredit, - CreditType1 upgradeCharge, + CreditType downgradeCredit, + CreditType upgradeCharge, CreateAllocationPricePointId pricePointId, BillingSchedule billingSchedule) { this.quantity = quantity; @@ -64,8 +64,8 @@ public CreateAllocation( this.prorationDowngradeScheme = prorationDowngradeScheme; this.prorationUpgradeScheme = prorationUpgradeScheme; this.accrueCharge = accrueCharge; - this.downgradeCredit = downgradeCredit; - this.upgradeCharge = upgradeCharge; + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + this.upgradeCharge = OptionalNullable.of(upgradeCharge); this.pricePointId = OptionalNullable.of(pricePointId); this.billingSchedule = billingSchedule; } @@ -78,15 +78,16 @@ public CreateAllocation( * @param prorationDowngradeScheme String value for prorationDowngradeScheme. * @param prorationUpgradeScheme String value for prorationUpgradeScheme. * @param accrueCharge Boolean value for accrueCharge. - * @param downgradeCredit CreditType1 value for downgradeCredit. - * @param upgradeCharge CreditType1 value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. * @param pricePointId CreateAllocationPricePointId value for pricePointId. * @param billingSchedule BillingSchedule value for billingSchedule. */ protected CreateAllocation(double quantity, Integer componentId, String memo, String prorationDowngradeScheme, String prorationUpgradeScheme, Boolean accrueCharge, - CreditType1 downgradeCredit, CreditType1 upgradeCharge, + OptionalNullable downgradeCredit, + OptionalNullable upgradeCharge, OptionalNullable pricePointId, BillingSchedule billingSchedule) { this.quantity = quantity; @@ -241,49 +242,89 @@ public void setAccrueCharge(Boolean accrueCharge) { } /** - * Getter for DowngradeCredit. - * The type of credit to be created if the change in cost is a downgrade. Defaults to the - * component and then site setting if one is not provided. - * @return Returns the CreditType1 + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public CreditType1 getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * The type of credit to be created if the change in cost is a downgrade. Defaults to the - * component and then site setting if one is not provided. - * @param downgradeCredit Value for CreditType1 + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(CreditType1 downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); } /** - * Getter for UpgradeCharge. - * The type of charge to be created if the change in cost is an upgrade. Defaults to the - * component and then site setting if one is not provided. - * @return Returns the CreditType1 + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; + } + + /** + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public CreditType1 getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * The type of charge to be created if the change in cost is an upgrade. Defaults to the - * component and then site setting if one is not provided. - * @param upgradeCharge Value for CreditType1 + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(CreditType1 upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + } + + /** + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; } /** @@ -380,9 +421,9 @@ public Builder toBuilder() { .prorationDowngradeScheme(getProrationDowngradeScheme()) .prorationUpgradeScheme(getProrationUpgradeScheme()) .accrueCharge(getAccrueCharge()) - .downgradeCredit(getDowngradeCredit()) - .upgradeCharge(getUpgradeCharge()) .billingSchedule(getBillingSchedule()); + builder.downgradeCredit = internalGetDowngradeCredit(); + builder.upgradeCharge = internalGetUpgradeCharge(); builder.pricePointId = internalGetPricePointId(); return builder; } @@ -397,8 +438,8 @@ public static class Builder { private String prorationDowngradeScheme; private String prorationUpgradeScheme; private Boolean accrueCharge; - private CreditType1 downgradeCredit; - private CreditType1 upgradeCharge; + private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; private OptionalNullable pricePointId; private BillingSchedule billingSchedule; @@ -478,21 +519,39 @@ public Builder accrueCharge(Boolean accrueCharge) { /** * Setter for downgradeCredit. - * @param downgradeCredit CreditType1 value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(CreditType1 downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. + * @return Builder + */ + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } /** * Setter for upgradeCharge. - * @param upgradeCharge CreditType1 value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(CreditType1 upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateUsage.java b/src/main/java/com/maxio/advancedbilling/models/CreateUsage.java index 74614723..7e28b582 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateUsage.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateUsage.java @@ -17,6 +17,7 @@ public class CreateUsage { private Double quantity; private String pricePointId; private String memo; + private BillingSchedule billingSchedule; /** * Default constructor. @@ -29,14 +30,17 @@ public CreateUsage() { * @param quantity Double value for quantity. * @param pricePointId String value for pricePointId. * @param memo String value for memo. + * @param billingSchedule BillingSchedule value for billingSchedule. */ public CreateUsage( Double quantity, String pricePointId, - String memo) { + String memo, + BillingSchedule billingSchedule) { this.quantity = quantity; this.pricePointId = pricePointId; this.memo = memo; + this.billingSchedule = billingSchedule; } /** @@ -98,6 +102,31 @@ public void setMemo(String memo) { this.memo = memo; } + /** + * Getter for BillingSchedule. + * This attribute is particularly useful when you need to align billing events for different + * components on distinct schedules within a subscription. Please note this only works for site + * with Multifrequency enabled + * @return Returns the BillingSchedule + */ + @JsonGetter("billing_schedule") + @JsonInclude(JsonInclude.Include.NON_NULL) + public BillingSchedule getBillingSchedule() { + return billingSchedule; + } + + /** + * Setter for BillingSchedule. + * This attribute is particularly useful when you need to align billing events for different + * components on distinct schedules within a subscription. Please note this only works for site + * with Multifrequency enabled + * @param billingSchedule Value for BillingSchedule + */ + @JsonSetter("billing_schedule") + public void setBillingSchedule(BillingSchedule billingSchedule) { + this.billingSchedule = billingSchedule; + } + /** * Converts this CreateUsage into string format. * @return String representation of this class @@ -105,7 +134,7 @@ public void setMemo(String memo) { @Override public String toString() { return "CreateUsage [" + "quantity=" + quantity + ", pricePointId=" + pricePointId - + ", memo=" + memo + "]"; + + ", memo=" + memo + ", billingSchedule=" + billingSchedule + "]"; } /** @@ -117,7 +146,8 @@ public Builder toBuilder() { Builder builder = new Builder() .quantity(getQuantity()) .pricePointId(getPricePointId()) - .memo(getMemo()); + .memo(getMemo()) + .billingSchedule(getBillingSchedule()); return builder; } @@ -128,6 +158,7 @@ public static class Builder { private Double quantity; private String pricePointId; private String memo; + private BillingSchedule billingSchedule; @@ -161,12 +192,22 @@ public Builder memo(String memo) { return this; } + /** + * Setter for billingSchedule. + * @param billingSchedule BillingSchedule value for billingSchedule. + * @return Builder + */ + public Builder billingSchedule(BillingSchedule billingSchedule) { + this.billingSchedule = billingSchedule; + return this; + } + /** * Builds a new {@link CreateUsage} object using the set fields. * @return {@link CreateUsage} */ public CreateUsage build() { - return new CreateUsage(quantity, pricePointId, memo); + return new CreateUsage(quantity, pricePointId, memo, billingSchedule); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/CreditType1.java b/src/main/java/com/maxio/advancedbilling/models/CreditType1.java deleted file mode 100644 index b578f41c..00000000 --- a/src/main/java/com/maxio/advancedbilling/models/CreditType1.java +++ /dev/null @@ -1,97 +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.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.TreeMap; - - -/** - * CreditType1 to be used. - */ -public enum CreditType1 { - FULL, - - PRORATED, - - NONE; - - - private static TreeMap valueMap = new TreeMap<>(); - private String value; - - static { - FULL.value = "full"; - PRORATED.value = "prorated"; - NONE.value = "none"; - - valueMap.put("full", FULL); - valueMap.put("prorated", PRORATED); - valueMap.put("none", NONE); - } - - /** - * 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 CreditType1 constructFromString(String toConvert) throws IOException { - CreditType1 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 CreditType1 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 CreditType1 values to list of string values. - * @param toConvert The list of CreditType1 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 (CreditType1 enumValue : toConvert) { - convertedValues.add(enumValue.value); - } - return convertedValues; - } -} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java b/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java index 59ef6791..fcb750a8 100644 --- a/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/EBBComponent.java @@ -9,7 +9,9 @@ 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.EBBComponentUnitPrice; +import io.apimatic.core.types.OptionalNullable; import java.util.List; /** @@ -23,8 +25,8 @@ public class EBBComponent { private Boolean taxable; private PricingScheme pricingScheme; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private EBBComponentUnitPrice unitPrice; private String taxCode; @@ -48,8 +50,8 @@ public EBBComponent() { * @param handle String value for handle. * @param taxable Boolean value for taxable. * @param prices List of Price value for prices. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param pricePoints List of ComponentPricePointItem value for pricePoints. * @param unitPrice EBBComponentUnitPrice value for unitPrice. * @param taxCode String value for taxCode. @@ -65,8 +67,8 @@ public EBBComponent( String handle, Boolean taxable, List prices, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, List pricePoints, EBBComponentUnitPrice unitPrice, String taxCode, @@ -79,6 +81,48 @@ public EBBComponent( this.taxable = taxable; this.pricingScheme = pricingScheme; this.prices = prices; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + this.pricePoints = pricePoints; + this.unitPrice = unitPrice; + this.taxCode = taxCode; + this.hideDateRangeOnInvoice = hideDateRangeOnInvoice; + this.priceInCents = priceInCents; + this.eventBasedBillingMetricId = eventBasedBillingMetricId; + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param unitName String value for unitName. + * @param pricingScheme PricingScheme value for pricingScheme. + * @param eventBasedBillingMetricId int value for eventBasedBillingMetricId. + * @param description String value for description. + * @param handle String value for handle. + * @param taxable Boolean value for taxable. + * @param prices List of Price value for prices. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param pricePoints List of ComponentPricePointItem value for pricePoints. + * @param unitPrice EBBComponentUnitPrice value for unitPrice. + * @param taxCode String value for taxCode. + * @param hideDateRangeOnInvoice Boolean value for hideDateRangeOnInvoice. + * @param priceInCents String value for priceInCents. + */ + + protected EBBComponent(String name, String unitName, PricingScheme pricingScheme, + int eventBasedBillingMetricId, String description, String handle, Boolean taxable, + List prices, OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, List pricePoints, + EBBComponentUnitPrice unitPrice, String taxCode, Boolean hideDateRangeOnInvoice, + String priceInCents) { + this.name = name; + this.unitName = unitName; + this.description = description; + this.handle = handle; + this.taxable = taxable; + this.pricingScheme = pricingScheme; + this.prices = prices; this.upgradeCharge = upgradeCharge; this.downgradeCredit = downgradeCredit; this.pricePoints = pricePoints; @@ -252,41 +296,89 @@ public void setPrices(List prices) { } /** - * Getter for UpgradeCharge. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -446,13 +538,13 @@ public Builder toBuilder() { .handle(getHandle()) .taxable(getTaxable()) .prices(getPrices()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()) .pricePoints(getPricePoints()) .unitPrice(getUnitPrice()) .taxCode(getTaxCode()) .hideDateRangeOnInvoice(getHideDateRangeOnInvoice()) .priceInCents(getPriceInCents()); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); return builder; } @@ -468,8 +560,8 @@ public static class Builder { private String handle; private Boolean taxable; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private EBBComponentUnitPrice unitPrice; private String taxCode; @@ -579,21 +671,39 @@ public Builder prices(List prices) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. + * @return Builder + */ + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java index 5f920773..cff5eb6b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java +++ b/src/main/java/com/maxio/advancedbilling/models/InvoiceEventType.java @@ -21,6 +21,8 @@ public enum InvoiceEventType { APPLY_CREDIT_NOTE, + CREATE_CREDIT_NOTE, + APPLY_PAYMENT, APPLY_DEBIT_NOTE, @@ -37,7 +39,9 @@ public enum InvoiceEventType { CHANGE_INVOICE_COLLECTION_METHOD, - REMOVE_PAYMENT; + REMOVE_PAYMENT, + + FAILED_PAYMENT; private static TreeMap valueMap = new TreeMap<>(); @@ -46,6 +50,7 @@ public enum InvoiceEventType { static { ISSUE_INVOICE.value = "issue_invoice"; APPLY_CREDIT_NOTE.value = "apply_credit_note"; + CREATE_CREDIT_NOTE.value = "create_credit_note"; APPLY_PAYMENT.value = "apply_payment"; APPLY_DEBIT_NOTE.value = "apply_debit_note"; REFUND_INVOICE.value = "refund_invoice"; @@ -55,9 +60,11 @@ public enum InvoiceEventType { CHANGE_INVOICE_STATUS.value = "change_invoice_status"; CHANGE_INVOICE_COLLECTION_METHOD.value = "change_invoice_collection_method"; REMOVE_PAYMENT.value = "remove_payment"; + FAILED_PAYMENT.value = "failed_payment"; valueMap.put("issue_invoice", ISSUE_INVOICE); valueMap.put("apply_credit_note", APPLY_CREDIT_NOTE); + valueMap.put("create_credit_note", CREATE_CREDIT_NOTE); valueMap.put("apply_payment", APPLY_PAYMENT); valueMap.put("apply_debit_note", APPLY_DEBIT_NOTE); valueMap.put("refund_invoice", REFUND_INVOICE); @@ -67,6 +74,7 @@ public enum InvoiceEventType { valueMap.put("change_invoice_status", CHANGE_INVOICE_STATUS); valueMap.put("change_invoice_collection_method", CHANGE_INVOICE_COLLECTION_METHOD); valueMap.put("remove_payment", REMOVE_PAYMENT); + valueMap.put("failed_payment", FAILED_PAYMENT); } /** diff --git a/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java b/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java index e6c68ec5..e8b5db29 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListProductPricePointsInput.java @@ -9,13 +9,14 @@ import com.fasterxml.jackson.annotation.JsonGetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; +import com.maxio.advancedbilling.models.containers.ListProductPricePointsInputProductId; import java.util.List; /** * This is a model class for ListProductPricePointsInput type. */ public class ListProductPricePointsInput { - private int productId; + private ListProductPricePointsInputProductId productId; private Integer page; private Integer perPage; private Boolean currencyPrices; @@ -31,14 +32,14 @@ public ListProductPricePointsInput() { /** * Initialization constructor. - * @param productId int value for productId. + * @param productId ListProductPricePointsInputProductId value for productId. * @param page Integer value for page. * @param perPage Integer value for perPage. * @param currencyPrices Boolean value for currencyPrices. * @param filterType List of PricePointType value for filterType. */ public ListProductPricePointsInput( - int productId, + ListProductPricePointsInputProductId productId, Integer page, Integer perPage, Boolean currencyPrices, @@ -53,20 +54,20 @@ public ListProductPricePointsInput( /** * Getter for ProductId. * The id or handle of the product. When using the handle, it must be prefixed with `handle:` - * @return Returns the int + * @return Returns the ListProductPricePointsInputProductId */ @JsonGetter("product_id") - public int getProductId() { + public ListProductPricePointsInputProductId getProductId() { return productId; } /** * Setter for ProductId. * The id or handle of the product. When using the handle, it must be prefixed with `handle:` - * @param productId Value for int + * @param productId Value for ListProductPricePointsInputProductId */ @JsonSetter("product_id") - public void setProductId(int productId) { + public void setProductId(ListProductPricePointsInputProductId productId) { this.productId = productId; } @@ -201,7 +202,7 @@ public Builder toBuilder() { * Class to build instances of {@link ListProductPricePointsInput}. */ public static class Builder { - private int productId; + private ListProductPricePointsInputProductId productId; private Integer page = 1; private Integer perPage = 10; private Boolean currencyPrices; @@ -215,18 +216,18 @@ public Builder() { /** * Initialization constructor. - * @param productId int value for productId. + * @param productId ListProductPricePointsInputProductId value for productId. */ - public Builder(int productId) { + public Builder(ListProductPricePointsInputProductId productId) { this.productId = productId; } /** * Setter for productId. - * @param productId int value for productId. + * @param productId ListProductPricePointsInputProductId value for productId. * @return Builder */ - public Builder productId(int productId) { + public Builder productId(ListProductPricePointsInputProductId productId) { this.productId = productId; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java b/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java index 70d9fc9d..5de8c34e 100644 --- a/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/MeteredComponent.java @@ -9,7 +9,9 @@ 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.MeteredComponentUnitPrice; +import io.apimatic.core.types.OptionalNullable; import java.util.List; /** @@ -23,8 +25,8 @@ public class MeteredComponent { private Boolean taxable; private PricingScheme pricingScheme; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private MeteredComponentUnitPrice unitPrice; private String taxCode; @@ -49,8 +51,8 @@ public MeteredComponent() { * @param handle String value for handle. * @param taxable Boolean value for taxable. * @param prices List of Price value for prices. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param pricePoints List of ComponentPricePointItem value for pricePoints. * @param unitPrice MeteredComponentUnitPrice value for unitPrice. * @param taxCode String value for taxCode. @@ -68,8 +70,8 @@ public MeteredComponent( String handle, Boolean taxable, List prices, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, List pricePoints, MeteredComponentUnitPrice unitPrice, String taxCode, @@ -85,6 +87,53 @@ public MeteredComponent( this.taxable = taxable; this.pricingScheme = pricingScheme; this.prices = prices; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + this.pricePoints = pricePoints; + this.unitPrice = unitPrice; + this.taxCode = taxCode; + this.hideDateRangeOnInvoice = hideDateRangeOnInvoice; + this.priceInCents = priceInCents; + this.displayOnHostedPage = displayOnHostedPage; + this.allowFractionalQuantities = allowFractionalQuantities; + this.publicSignupPageIds = publicSignupPageIds; + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param unitName String value for unitName. + * @param pricingScheme PricingScheme value for pricingScheme. + * @param description String value for description. + * @param handle String value for handle. + * @param taxable Boolean value for taxable. + * @param prices List of Price value for prices. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param pricePoints List of ComponentPricePointItem value for pricePoints. + * @param unitPrice MeteredComponentUnitPrice value for unitPrice. + * @param taxCode String value for taxCode. + * @param hideDateRangeOnInvoice Boolean value for hideDateRangeOnInvoice. + * @param priceInCents String value for priceInCents. + * @param displayOnHostedPage Boolean value for displayOnHostedPage. + * @param allowFractionalQuantities Boolean value for allowFractionalQuantities. + * @param publicSignupPageIds List of Integer value for publicSignupPageIds. + */ + + protected MeteredComponent(String name, String unitName, PricingScheme pricingScheme, + String description, String handle, Boolean taxable, List prices, + OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, List pricePoints, + MeteredComponentUnitPrice unitPrice, String taxCode, Boolean hideDateRangeOnInvoice, + String priceInCents, Boolean displayOnHostedPage, Boolean allowFractionalQuantities, + List publicSignupPageIds) { + this.name = name; + this.unitName = unitName; + this.description = description; + this.handle = handle; + this.taxable = taxable; + this.pricingScheme = pricingScheme; + this.prices = prices; this.upgradeCharge = upgradeCharge; this.downgradeCredit = downgradeCredit; this.pricePoints = pricePoints; @@ -260,41 +309,89 @@ public void setPrices(List prices) { } /** - * Getter for UpgradeCharge. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -496,8 +593,6 @@ public Builder toBuilder() { .handle(getHandle()) .taxable(getTaxable()) .prices(getPrices()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()) .pricePoints(getPricePoints()) .unitPrice(getUnitPrice()) .taxCode(getTaxCode()) @@ -506,6 +601,8 @@ public Builder toBuilder() { .displayOnHostedPage(getDisplayOnHostedPage()) .allowFractionalQuantities(getAllowFractionalQuantities()) .publicSignupPageIds(getPublicSignupPageIds()); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); return builder; } @@ -520,8 +617,8 @@ public static class Builder { private String handle; private Boolean taxable; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private MeteredComponentUnitPrice unitPrice; private String taxCode; @@ -621,21 +718,39 @@ public Builder prices(List prices) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java b/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java index d4562292..df92eaff 100644 --- a/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/OnOffComponent.java @@ -9,7 +9,9 @@ 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.OnOffComponentUnitPrice; +import io.apimatic.core.types.OptionalNullable; import java.util.List; /** @@ -23,8 +25,8 @@ public class OnOffComponent { private Boolean taxable; private PricingScheme pricingScheme; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private OnOffComponentUnitPrice unitPrice; private String taxCode; @@ -49,8 +51,8 @@ public OnOffComponent() { * @param handle String value for handle. * @param taxable Boolean value for taxable. * @param prices List of Price value for prices. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param pricePoints List of ComponentPricePointItem value for pricePoints. * @param unitPrice OnOffComponentUnitPrice value for unitPrice. * @param taxCode String value for taxCode. @@ -68,8 +70,8 @@ public OnOffComponent( String handle, Boolean taxable, List prices, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, List pricePoints, OnOffComponentUnitPrice unitPrice, String taxCode, @@ -85,6 +87,53 @@ public OnOffComponent( this.taxable = taxable; this.pricingScheme = pricingScheme; this.prices = prices; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + this.pricePoints = pricePoints; + this.unitPrice = unitPrice; + this.taxCode = taxCode; + this.hideDateRangeOnInvoice = hideDateRangeOnInvoice; + this.priceInCents = priceInCents; + this.displayOnHostedPage = displayOnHostedPage; + this.allowFractionalQuantities = allowFractionalQuantities; + this.publicSignupPageIds = publicSignupPageIds; + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param pricingScheme PricingScheme value for pricingScheme. + * @param unitName String value for unitName. + * @param description String value for description. + * @param handle String value for handle. + * @param taxable Boolean value for taxable. + * @param prices List of Price value for prices. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param pricePoints List of ComponentPricePointItem value for pricePoints. + * @param unitPrice OnOffComponentUnitPrice value for unitPrice. + * @param taxCode String value for taxCode. + * @param hideDateRangeOnInvoice Boolean value for hideDateRangeOnInvoice. + * @param priceInCents String value for priceInCents. + * @param displayOnHostedPage Boolean value for displayOnHostedPage. + * @param allowFractionalQuantities Boolean value for allowFractionalQuantities. + * @param publicSignupPageIds List of Integer value for publicSignupPageIds. + */ + + protected OnOffComponent(String name, PricingScheme pricingScheme, String unitName, + String description, String handle, Boolean taxable, List prices, + OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, List pricePoints, + OnOffComponentUnitPrice unitPrice, String taxCode, Boolean hideDateRangeOnInvoice, + String priceInCents, Boolean displayOnHostedPage, Boolean allowFractionalQuantities, + List publicSignupPageIds) { + this.name = name; + this.unitName = unitName; + this.description = description; + this.handle = handle; + this.taxable = taxable; + this.pricingScheme = pricingScheme; + this.prices = prices; this.upgradeCharge = upgradeCharge; this.downgradeCredit = downgradeCredit; this.pricePoints = pricePoints; @@ -261,41 +310,89 @@ public void setPrices(List prices) { } /** - * Getter for UpgradeCharge. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -498,8 +595,6 @@ public Builder toBuilder() { .handle(getHandle()) .taxable(getTaxable()) .prices(getPrices()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()) .pricePoints(getPricePoints()) .unitPrice(getUnitPrice()) .taxCode(getTaxCode()) @@ -508,6 +603,8 @@ public Builder toBuilder() { .displayOnHostedPage(getDisplayOnHostedPage()) .allowFractionalQuantities(getAllowFractionalQuantities()) .publicSignupPageIds(getPublicSignupPageIds()); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); return builder; } @@ -522,8 +619,8 @@ public static class Builder { private String handle; private Boolean taxable; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private OnOffComponentUnitPrice unitPrice; private String taxCode; @@ -621,21 +718,39 @@ public Builder prices(List prices) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java b/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java index 9017044f..4a5764dc 100644 --- a/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/PrepaidUsageComponent.java @@ -9,7 +9,9 @@ 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.PrepaidUsageComponentUnitPrice; +import io.apimatic.core.types.OptionalNullable; import java.util.List; /** @@ -23,8 +25,8 @@ public class PrepaidUsageComponent { private Boolean taxable; private PricingScheme pricingScheme; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private PrepaidUsageComponentUnitPrice unitPrice; private String taxCode; @@ -54,8 +56,8 @@ public PrepaidUsageComponent() { * @param taxable Boolean value for taxable. * @param pricingScheme PricingScheme value for pricingScheme. * @param prices List of Price value for prices. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param pricePoints List of PrepaidComponentPricePoint value for pricePoints. * @param unitPrice PrepaidUsageComponentUnitPrice value for unitPrice. * @param taxCode String value for taxCode. @@ -78,8 +80,8 @@ public PrepaidUsageComponent( Boolean taxable, PricingScheme pricingScheme, List prices, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, List pricePoints, PrepaidUsageComponentUnitPrice unitPrice, String taxCode, @@ -100,6 +102,66 @@ public PrepaidUsageComponent( this.taxable = taxable; this.pricingScheme = pricingScheme; this.prices = prices; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + this.pricePoints = pricePoints; + this.unitPrice = unitPrice; + this.taxCode = taxCode; + this.hideDateRangeOnInvoice = hideDateRangeOnInvoice; + this.priceInCents = priceInCents; + this.overagePricing = overagePricing; + this.rolloverPrepaidRemainder = rolloverPrepaidRemainder; + this.renewPrepaidAllocation = renewPrepaidAllocation; + this.expirationInterval = expirationInterval; + this.expirationIntervalUnit = expirationIntervalUnit; + this.displayOnHostedPage = displayOnHostedPage; + this.allowFractionalQuantities = allowFractionalQuantities; + this.publicSignupPageIds = publicSignupPageIds; + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param unitName String value for unitName. + * @param description String value for description. + * @param handle String value for handle. + * @param taxable Boolean value for taxable. + * @param pricingScheme PricingScheme value for pricingScheme. + * @param prices List of Price value for prices. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param pricePoints List of PrepaidComponentPricePoint value for pricePoints. + * @param unitPrice PrepaidUsageComponentUnitPrice value for unitPrice. + * @param taxCode String value for taxCode. + * @param hideDateRangeOnInvoice Boolean value for hideDateRangeOnInvoice. + * @param priceInCents String value for priceInCents. + * @param overagePricing OveragePricing value for overagePricing. + * @param rolloverPrepaidRemainder Boolean value for rolloverPrepaidRemainder. + * @param renewPrepaidAllocation Boolean value for renewPrepaidAllocation. + * @param expirationInterval Double value for expirationInterval. + * @param expirationIntervalUnit IntervalUnit value for expirationIntervalUnit. + * @param displayOnHostedPage Boolean value for displayOnHostedPage. + * @param allowFractionalQuantities Boolean value for allowFractionalQuantities. + * @param publicSignupPageIds List of Integer value for publicSignupPageIds. + */ + + protected PrepaidUsageComponent(String name, String unitName, String description, String handle, + Boolean taxable, PricingScheme pricingScheme, List prices, + OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, + List pricePoints, PrepaidUsageComponentUnitPrice unitPrice, + String taxCode, Boolean hideDateRangeOnInvoice, String priceInCents, + OveragePricing overagePricing, Boolean rolloverPrepaidRemainder, + Boolean renewPrepaidAllocation, Double expirationInterval, + IntervalUnit expirationIntervalUnit, Boolean displayOnHostedPage, + Boolean allowFractionalQuantities, List publicSignupPageIds) { + this.name = name; + this.unitName = unitName; + this.description = description; + this.handle = handle; + this.taxable = taxable; + this.pricingScheme = pricingScheme; + this.prices = prices; this.upgradeCharge = upgradeCharge; this.downgradeCredit = downgradeCredit; this.pricePoints = pricePoints; @@ -283,41 +345,89 @@ public void setPrices(List prices) { } /** - * Getter for UpgradeCharge. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -633,8 +743,6 @@ public Builder toBuilder() { .taxable(getTaxable()) .pricingScheme(getPricingScheme()) .prices(getPrices()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()) .pricePoints(getPricePoints()) .unitPrice(getUnitPrice()) .taxCode(getTaxCode()) @@ -648,6 +756,8 @@ public Builder toBuilder() { .displayOnHostedPage(getDisplayOnHostedPage()) .allowFractionalQuantities(getAllowFractionalQuantities()) .publicSignupPageIds(getPublicSignupPageIds()); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); return builder; } @@ -662,8 +772,8 @@ public static class Builder { private Boolean taxable; private PricingScheme pricingScheme; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private PrepaidUsageComponentUnitPrice unitPrice; private String taxCode; @@ -752,21 +862,39 @@ public Builder prices(List prices) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/Product.java b/src/main/java/com/maxio/advancedbilling/models/Product.java index 0b3adcd3..cb5840e6 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Product.java +++ b/src/main/java/com/maxio/advancedbilling/models/Product.java @@ -831,7 +831,7 @@ public void unsetTrialIntervalUnit() { */ @JsonGetter("archived_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetArchivedAt() { return this.archivedAt; } diff --git a/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java b/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java index 9494850d..a54d1931 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java +++ b/src/main/java/com/maxio/advancedbilling/models/ProductPricePoint.java @@ -533,7 +533,7 @@ public void setProductId(Integer productId) { */ @JsonGetter("archived_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetArchivedAt() { return this.archivedAt; } diff --git a/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java b/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java index db44f57c..3ef31b9b 100644 --- a/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/QuantityBasedComponent.java @@ -9,7 +9,9 @@ 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.QuantityBasedComponentUnitPrice; +import io.apimatic.core.types.OptionalNullable; import java.util.List; /** @@ -23,8 +25,8 @@ public class QuantityBasedComponent { private Boolean taxable; private PricingScheme pricingScheme; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private QuantityBasedComponentUnitPrice unitPrice; private String taxCode; @@ -50,8 +52,8 @@ public QuantityBasedComponent() { * @param handle String value for handle. * @param taxable Boolean value for taxable. * @param prices List of Price value for prices. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param pricePoints List of ComponentPricePointItem value for pricePoints. * @param unitPrice QuantityBasedComponentUnitPrice value for unitPrice. * @param taxCode String value for taxCode. @@ -70,8 +72,8 @@ public QuantityBasedComponent( String handle, Boolean taxable, List prices, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, List pricePoints, QuantityBasedComponentUnitPrice unitPrice, String taxCode, @@ -88,6 +90,56 @@ public QuantityBasedComponent( this.taxable = taxable; this.pricingScheme = pricingScheme; this.prices = prices; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + this.pricePoints = pricePoints; + this.unitPrice = unitPrice; + this.taxCode = taxCode; + this.hideDateRangeOnInvoice = hideDateRangeOnInvoice; + this.priceInCents = priceInCents; + this.recurring = recurring; + this.displayOnHostedPage = displayOnHostedPage; + this.allowFractionalQuantities = allowFractionalQuantities; + this.publicSignupPageIds = publicSignupPageIds; + } + + /** + * Initialization constructor. + * @param name String value for name. + * @param unitName String value for unitName. + * @param pricingScheme PricingScheme value for pricingScheme. + * @param description String value for description. + * @param handle String value for handle. + * @param taxable Boolean value for taxable. + * @param prices List of Price value for prices. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. + * @param pricePoints List of ComponentPricePointItem value for pricePoints. + * @param unitPrice QuantityBasedComponentUnitPrice value for unitPrice. + * @param taxCode String value for taxCode. + * @param hideDateRangeOnInvoice Boolean value for hideDateRangeOnInvoice. + * @param priceInCents String value for priceInCents. + * @param recurring Boolean value for recurring. + * @param displayOnHostedPage Boolean value for displayOnHostedPage. + * @param allowFractionalQuantities Boolean value for allowFractionalQuantities. + * @param publicSignupPageIds List of Integer value for publicSignupPageIds. + */ + + protected QuantityBasedComponent(String name, String unitName, PricingScheme pricingScheme, + String description, String handle, Boolean taxable, List prices, + OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, List pricePoints, + QuantityBasedComponentUnitPrice unitPrice, String taxCode, + Boolean hideDateRangeOnInvoice, String priceInCents, Boolean recurring, + Boolean displayOnHostedPage, Boolean allowFractionalQuantities, + List publicSignupPageIds) { + this.name = name; + this.unitName = unitName; + this.description = description; + this.handle = handle; + this.taxable = taxable; + this.pricingScheme = pricingScheme; + this.prices = prices; this.upgradeCharge = upgradeCharge; this.downgradeCredit = downgradeCredit; this.pricePoints = pricePoints; @@ -264,41 +316,89 @@ public void setPrices(List prices) { } /** - * Getter for UpgradeCharge. - * @return Returns the String + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getUpgradeCharge() { - return upgradeCharge; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getUpgradeCharge() { + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public void setUpgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** - * Getter for DowngradeCredit. - * @return Returns the String + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; + } + + /** + * Internal Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) - public String getDowngradeCredit() { - return downgradeCredit; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetDowngradeCredit() { + return this.downgradeCredit; + } + + /** + * Getter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ + public CreditType getDowngradeCredit() { + return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public void setDowngradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + } + + /** + * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetDowngradeCredit() { + downgradeCredit = null; } /** @@ -520,8 +620,6 @@ public Builder toBuilder() { .handle(getHandle()) .taxable(getTaxable()) .prices(getPrices()) - .upgradeCharge(getUpgradeCharge()) - .downgradeCredit(getDowngradeCredit()) .pricePoints(getPricePoints()) .unitPrice(getUnitPrice()) .taxCode(getTaxCode()) @@ -531,6 +629,8 @@ public Builder toBuilder() { .displayOnHostedPage(getDisplayOnHostedPage()) .allowFractionalQuantities(getAllowFractionalQuantities()) .publicSignupPageIds(getPublicSignupPageIds()); + builder.upgradeCharge = internalGetUpgradeCharge(); + builder.downgradeCredit = internalGetDowngradeCredit(); return builder; } @@ -545,8 +645,8 @@ public static class Builder { private String handle; private Boolean taxable; private List prices; - private String upgradeCharge; - private String downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private List pricePoints; private QuantityBasedComponentUnitPrice unitPrice; private String taxCode; @@ -647,21 +747,39 @@ public Builder prices(List prices) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. + * @return Builder + */ + public Builder upgradeCharge(CreditType upgradeCharge) { + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { - this.upgradeCharge = upgradeCharge; + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. + * @return Builder + */ + public Builder downgradeCredit(CreditType downgradeCredit) { + this.downgradeCredit = OptionalNullable.of(downgradeCredit); + return this; + } + + /** + * UnSetter for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { - this.downgradeCredit = downgradeCredit; + public Builder unsetDowngradeCredit() { + downgradeCredit = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/Subscription.java b/src/main/java/com/maxio/advancedbilling/models/Subscription.java index 8287269a..15c2ed83 100644 --- a/src/main/java/com/maxio/advancedbilling/models/Subscription.java +++ b/src/main/java/com/maxio/advancedbilling/models/Subscription.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.maxio.advancedbilling.DateTimeHelper; +import com.maxio.advancedbilling.models.containers.SubscriptionGroup2; import io.apimatic.core.types.OptionalNullable; import java.time.ZonedDateTime; import java.util.List; @@ -49,7 +50,7 @@ public class Subscription { private Customer customer; private Product product; private PaymentProfile creditCard; - private SubscriptionGroupInlined group; + private OptionalNullable group; private SubscriptionBankAccount bankAccount; private OptionalNullable paymentType; private OptionalNullable referralCode; @@ -120,7 +121,7 @@ public Subscription() { * @param customer Customer value for customer. * @param product Product value for product. * @param creditCard PaymentProfile value for creditCard. - * @param group SubscriptionGroupInlined value for group. + * @param group SubscriptionGroup2 value for group. * @param bankAccount SubscriptionBankAccount value for bankAccount. * @param paymentType String value for paymentType. * @param referralCode String value for referralCode. @@ -183,7 +184,7 @@ public Subscription( Customer customer, Product product, PaymentProfile creditCard, - SubscriptionGroupInlined group, + SubscriptionGroup2 group, SubscriptionBankAccount bankAccount, String paymentType, String referralCode, @@ -243,7 +244,7 @@ public Subscription( this.customer = customer; this.product = product; this.creditCard = creditCard; - this.group = group; + this.group = OptionalNullable.of(group); this.bankAccount = bankAccount; this.paymentType = OptionalNullable.of(paymentType); this.referralCode = OptionalNullable.of(referralCode); @@ -308,7 +309,7 @@ public Subscription( * @param customer Customer value for customer. * @param product Product value for product. * @param creditCard PaymentProfile value for creditCard. - * @param group SubscriptionGroupInlined value for group. + * @param group SubscriptionGroup2 value for group. * @param bankAccount SubscriptionBankAccount value for bankAccount. * @param paymentType String value for paymentType. * @param referralCode String value for referralCode. @@ -356,7 +357,7 @@ protected Subscription(Integer id, SubscriptionState state, Long balanceInCents, OptionalNullable delayedCancelAt, OptionalNullable couponCode, OptionalNullable snapDay, PaymentCollectionMethod paymentCollectionMethod, Customer customer, Product product, PaymentProfile creditCard, - SubscriptionGroupInlined group, SubscriptionBankAccount bankAccount, + OptionalNullable group, SubscriptionBankAccount bankAccount, OptionalNullable paymentType, OptionalNullable referralCode, OptionalNullable nextProductId, OptionalNullable nextProductHandle, OptionalNullable couponUseCount, OptionalNullable couponUsesAllowed, @@ -719,7 +720,7 @@ public void setNextAssessmentAt(ZonedDateTime nextAssessmentAt) { */ @JsonGetter("trial_started_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetTrialStartedAt() { return this.trialStartedAt; } @@ -759,7 +760,7 @@ public void unsetTrialStartedAt() { */ @JsonGetter("trial_ended_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetTrialEndedAt() { return this.trialEndedAt; } @@ -824,7 +825,7 @@ public void setActivatedAt(ZonedDateTime activatedAt) { */ @JsonGetter("expires_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetExpiresAt() { return this.expiresAt; } @@ -1031,7 +1032,7 @@ public void unsetCancelAtEndOfPeriod() { */ @JsonGetter("canceled_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetCanceledAt() { return this.canceledAt; } @@ -1161,7 +1162,7 @@ public void setSignupRevenue(String signupRevenue) { */ @JsonGetter("delayed_cancel_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetDelayedCancelAt() { return this.delayedCancelAt; } @@ -1363,22 +1364,38 @@ public void setCreditCard(PaymentProfile creditCard) { } /** - * Getter for Group. - * @return Returns the SubscriptionGroupInlined + * Internal Getter for Group. + * @return Returns the Internal SubscriptionGroup2 */ @JsonGetter("group") @JsonInclude(JsonInclude.Include.NON_NULL) - public SubscriptionGroupInlined getGroup() { - return group; + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetGroup() { + return this.group; + } + + /** + * Getter for Group. + * @return Returns the SubscriptionGroup2 + */ + public SubscriptionGroup2 getGroup() { + return OptionalNullable.getFrom(group); } /** * Setter for Group. - * @param group Value for SubscriptionGroupInlined + * @param group Value for SubscriptionGroup2 */ @JsonSetter("group") - public void setGroup(SubscriptionGroupInlined group) { - this.group = group; + public void setGroup(SubscriptionGroup2 group) { + this.group = OptionalNullable.of(group); + } + + /** + * UnSetter for Group. + */ + public void unsetGroup() { + group = null; } /** @@ -1696,7 +1713,7 @@ public void unsetReasonCode() { */ @JsonGetter("automatically_resume_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetAutomaticallyResumeAt() { return this.automaticallyResumeAt; } @@ -2076,7 +2093,7 @@ public void unsetReference() { */ @JsonGetter("on_hold_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetOnHoldAt() { return this.onHoldAt; } @@ -2314,7 +2331,7 @@ public void setCurrency(String currency) { */ @JsonGetter("scheduled_cancellation_at") @JsonInclude(JsonInclude.Include.NON_NULL) - @JsonSerialize(using = OptionalNullable.Rfc8601DateTimeSerializer.class) + @JsonSerialize(using = OptionalNullable.ZonedRfc8601DateTimeSerializer.class) protected OptionalNullable internalGetScheduledCancellationAt() { return this.scheduledCancellationAt; } @@ -2449,7 +2466,6 @@ public Builder toBuilder() { .customer(getCustomer()) .product(getProduct()) .creditCard(getCreditCard()) - .group(getGroup()) .bankAccount(getBankAccount()) .couponCodes(getCouponCodes()) .currentBillingAmountInCents(getCurrentBillingAmountInCents()) @@ -2471,6 +2487,7 @@ public Builder toBuilder() { builder.delayedCancelAt = internalGetDelayedCancelAt(); builder.couponCode = internalGetCouponCode(); builder.snapDay = internalGetSnapDay(); + builder.group = internalGetGroup(); builder.paymentType = internalGetPaymentType(); builder.referralCode = internalGetReferralCode(); builder.nextProductId = internalGetNextProductId(); @@ -2526,7 +2543,7 @@ public static class Builder { private Customer customer; private Product product; private PaymentProfile creditCard; - private SubscriptionGroupInlined group; + private OptionalNullable group; private SubscriptionBankAccount bankAccount; private OptionalNullable paymentType; private OptionalNullable referralCode; @@ -2943,11 +2960,20 @@ public Builder creditCard(PaymentProfile creditCard) { /** * Setter for group. - * @param group SubscriptionGroupInlined value for group. + * @param group SubscriptionGroup2 value for group. + * @return Builder + */ + public Builder group(SubscriptionGroup2 group) { + this.group = OptionalNullable.of(group); + return this; + } + + /** + * UnSetter for group. * @return Builder */ - public Builder group(SubscriptionGroupInlined group) { - this.group = group; + public Builder unsetGroup() { + group = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java b/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java index f41efde7..253af0bb 100644 --- a/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/SubscriptionComponent.java @@ -30,8 +30,8 @@ public class SubscriptionComponent { private OptionalNullable componentHandle; private Integer subscriptionId; private Boolean recurring; - private OptionalNullable upgradeCharge; - private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private OptionalNullable archivedAt; private OptionalNullable pricePointId; private OptionalNullable pricePointHandle; @@ -68,8 +68,8 @@ public SubscriptionComponent() { * @param componentHandle String value for componentHandle. * @param subscriptionId Integer value for subscriptionId. * @param recurring Boolean value for recurring. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param archivedAt String value for archivedAt. * @param pricePointId Integer value for pricePointId. * @param pricePointHandle String value for pricePointHandle. @@ -99,8 +99,8 @@ public SubscriptionComponent( String componentHandle, Integer subscriptionId, Boolean recurring, - String upgradeCharge, - String downgradeCredit, + CreditType upgradeCharge, + CreditType downgradeCredit, String archivedAt, Integer pricePointId, String pricePointHandle, @@ -161,8 +161,8 @@ public SubscriptionComponent( * @param componentHandle String value for componentHandle. * @param subscriptionId Integer value for subscriptionId. * @param recurring Boolean value for recurring. - * @param upgradeCharge String value for upgradeCharge. - * @param downgradeCredit String value for downgradeCredit. + * @param upgradeCharge CreditType value for upgradeCharge. + * @param downgradeCredit CreditType value for downgradeCredit. * @param archivedAt String value for archivedAt. * @param pricePointId Integer value for pricePointId. * @param pricePointHandle String value for pricePointHandle. @@ -183,9 +183,9 @@ protected SubscriptionComponent(Integer id, String name, String kind, String uni Boolean enabled, Integer unitBalance, String currency, Integer allocatedQuantity, OptionalNullable pricingScheme, Integer componentId, OptionalNullable componentHandle, Integer subscriptionId, Boolean recurring, - OptionalNullable upgradeCharge, OptionalNullable downgradeCredit, - OptionalNullable archivedAt, OptionalNullable pricePointId, - OptionalNullable pricePointHandle, + OptionalNullable upgradeCharge, + OptionalNullable downgradeCredit, OptionalNullable archivedAt, + OptionalNullable pricePointId, OptionalNullable pricePointHandle, SubscriptionComponentPricePointType pricePointType, OptionalNullable pricePointName, Integer productFamilyId, String productFamilyHandle, String createdAt, String updatedAt, @@ -510,34 +510,42 @@ public void setRecurring(Boolean recurring) { /** * Internal Getter for UpgradeCharge. - * @return Returns the Internal String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetUpgradeCharge() { + protected OptionalNullable internalGetUpgradeCharge() { return this.upgradeCharge; } /** * Getter for UpgradeCharge. - * @return Returns the String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType */ - public String getUpgradeCharge() { + public CreditType getUpgradeCharge() { return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * @param upgradeCharge Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") - public void setUpgradeCharge(String upgradeCharge) { + public void setUpgradeCharge(CreditType upgradeCharge) { this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. */ public void unsetUpgradeCharge() { upgradeCharge = null; @@ -545,34 +553,42 @@ public void unsetUpgradeCharge() { /** * Internal Getter for DowngradeCredit. - * @return Returns the Internal String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("downgrade_credit") @JsonInclude(JsonInclude.Include.NON_NULL) @JsonSerialize(using = OptionalNullable.Serializer.class) - protected OptionalNullable internalGetDowngradeCredit() { + protected OptionalNullable internalGetDowngradeCredit() { return this.downgradeCredit; } /** * Getter for DowngradeCredit. - * @return Returns the String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType */ - public String getDowngradeCredit() { + public CreditType getDowngradeCredit() { return OptionalNullable.getFrom(downgradeCredit); } /** * Setter for DowngradeCredit. - * @param downgradeCredit Value for String + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @param downgradeCredit Value for CreditType */ @JsonSetter("downgrade_credit") - public void setDowngradeCredit(String downgradeCredit) { + public void setDowngradeCredit(CreditType downgradeCredit) { this.downgradeCredit = OptionalNullable.of(downgradeCredit); } /** * UnSetter for DowngradeCredit. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. */ public void unsetDowngradeCredit() { downgradeCredit = null; @@ -1020,8 +1036,8 @@ public static class Builder { private OptionalNullable componentHandle; private Integer subscriptionId; private Boolean recurring; - private OptionalNullable upgradeCharge; - private OptionalNullable downgradeCredit; + private OptionalNullable upgradeCharge; + private OptionalNullable downgradeCredit; private OptionalNullable archivedAt; private OptionalNullable pricePointId; private OptionalNullable pricePointHandle; @@ -1189,10 +1205,10 @@ public Builder recurring(Boolean recurring) { /** * Setter for upgradeCharge. - * @param upgradeCharge String value for upgradeCharge. + * @param upgradeCharge CreditType value for upgradeCharge. * @return Builder */ - public Builder upgradeCharge(String upgradeCharge) { + public Builder upgradeCharge(CreditType upgradeCharge) { this.upgradeCharge = OptionalNullable.of(upgradeCharge); return this; } @@ -1208,10 +1224,10 @@ public Builder unsetUpgradeCharge() { /** * Setter for downgradeCredit. - * @param downgradeCredit String value for downgradeCredit. + * @param downgradeCredit CreditType value for downgradeCredit. * @return Builder */ - public Builder downgradeCredit(String downgradeCredit) { + public Builder downgradeCredit(CreditType downgradeCredit) { this.downgradeCredit = OptionalNullable.of(downgradeCredit); return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java b/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java index d1fdf80c..535a0242 100644 --- a/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/UpdateComponent.java @@ -24,7 +24,7 @@ public class UpdateComponent { private OptionalNullable taxCode; private OptionalNullable itemCategory; private Boolean displayOnHostedPage; - private CreditType upgradeCharge; + private OptionalNullable upgradeCharge; /** * Default constructor. @@ -62,7 +62,7 @@ public UpdateComponent( this.taxCode = OptionalNullable.of(taxCode); this.itemCategory = OptionalNullable.of(itemCategory); this.displayOnHostedPage = displayOnHostedPage; - this.upgradeCharge = upgradeCharge; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); } /** @@ -81,7 +81,7 @@ public UpdateComponent( protected UpdateComponent(String handle, String name, OptionalNullable description, String accountingCode, Boolean taxable, OptionalNullable taxCode, OptionalNullable itemCategory, Boolean displayOnHostedPage, - CreditType upgradeCharge) { + OptionalNullable upgradeCharge) { this.handle = handle; this.name = name; this.description = description; @@ -322,26 +322,46 @@ public void setDisplayOnHostedPage(Boolean displayOnHostedPage) { } /** - * Getter for UpgradeCharge. - * The type of charge to be applied when a component is upgraded. Valid values are: `prorated`, - * `full`, `none`. - * @return Returns the CreditType + * Internal Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the Internal CreditType */ @JsonGetter("upgrade_charge") @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonSerialize(using = OptionalNullable.Serializer.class) + protected OptionalNullable internalGetUpgradeCharge() { + return this.upgradeCharge; + } + + /** + * Getter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + * @return Returns the CreditType + */ public CreditType getUpgradeCharge() { - return upgradeCharge; + return OptionalNullable.getFrom(upgradeCharge); } /** * Setter for UpgradeCharge. - * The type of charge to be applied when a component is upgraded. Valid values are: `prorated`, - * `full`, `none`. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. * @param upgradeCharge Value for CreditType */ @JsonSetter("upgrade_charge") public void setUpgradeCharge(CreditType upgradeCharge) { - this.upgradeCharge = upgradeCharge; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + } + + /** + * UnSetter for UpgradeCharge. + * The type of credit to be created when upgrading/downgrading. Defaults to the component and + * then site setting if one is not provided. Available values: `full`, `prorated`, `none`. + */ + public void unsetUpgradeCharge() { + upgradeCharge = null; } /** @@ -368,11 +388,11 @@ public Builder toBuilder() { .name(getName()) .accountingCode(getAccountingCode()) .taxable(getTaxable()) - .displayOnHostedPage(getDisplayOnHostedPage()) - .upgradeCharge(getUpgradeCharge()); + .displayOnHostedPage(getDisplayOnHostedPage()); builder.description = internalGetDescription(); builder.taxCode = internalGetTaxCode(); builder.itemCategory = internalGetItemCategory(); + builder.upgradeCharge = internalGetUpgradeCharge(); return builder; } @@ -388,7 +408,7 @@ public static class Builder { private OptionalNullable taxCode; private OptionalNullable itemCategory; private Boolean displayOnHostedPage; - private CreditType upgradeCharge; + private OptionalNullable upgradeCharge; @@ -505,7 +525,16 @@ public Builder displayOnHostedPage(Boolean displayOnHostedPage) { * @return Builder */ public Builder upgradeCharge(CreditType upgradeCharge) { - this.upgradeCharge = upgradeCharge; + this.upgradeCharge = OptionalNullable.of(upgradeCharge); + return this; + } + + /** + * UnSetter for upgradeCharge. + * @return Builder + */ + public Builder unsetUpgradeCharge() { + upgradeCharge = null; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/ArchiveProductPricePointPricePointId.java b/src/main/java/com/maxio/advancedbilling/models/containers/ArchiveProductPricePointPricePointId.java new file mode 100644 index 00000000..f90309f4 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/ArchiveProductPricePointPricePointId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = ArchiveProductPricePointPricePointId.ArchiveProductPricePointPricePointIdDeserializer.class) +public abstract class ArchiveProductPricePointPricePointId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static ArchiveProductPricePointPricePointId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static ArchiveProductPricePointPricePointId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends ArchiveProductPricePointPricePointId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends ArchiveProductPricePointPricePointId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for ArchiveProductPricePointPricePointId. + */ + protected static class ArchiveProductPricePointPricePointIdDeserializer + extends JsonDeserializer { + + @Override + public ArchiveProductPricePointPricePointId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/ArchiveProductPricePointProductId.java b/src/main/java/com/maxio/advancedbilling/models/containers/ArchiveProductPricePointProductId.java new file mode 100644 index 00000000..1a505824 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/ArchiveProductPricePointProductId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = ArchiveProductPricePointProductId.ArchiveProductPricePointProductIdDeserializer.class) +public abstract class ArchiveProductPricePointProductId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static ArchiveProductPricePointProductId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static ArchiveProductPricePointProductId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends ArchiveProductPricePointProductId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends ArchiveProductPricePointProductId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for ArchiveProductPricePointProductId. + */ + protected static class ArchiveProductPricePointProductIdDeserializer + extends JsonDeserializer { + + @Override + public ArchiveProductPricePointProductId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/CreateProductPricePointProductId.java b/src/main/java/com/maxio/advancedbilling/models/containers/CreateProductPricePointProductId.java new file mode 100644 index 00000000..a3240ebd --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/CreateProductPricePointProductId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = CreateProductPricePointProductId.CreateProductPricePointProductIdDeserializer.class) +public abstract class CreateProductPricePointProductId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static CreateProductPricePointProductId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static CreateProductPricePointProductId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends CreateProductPricePointProductId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends CreateProductPricePointProductId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for CreateProductPricePointProductId. + */ + protected static class CreateProductPricePointProductIdDeserializer + extends JsonDeserializer { + + @Override + public CreateProductPricePointProductId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/ListProductPricePointsInputProductId.java b/src/main/java/com/maxio/advancedbilling/models/containers/ListProductPricePointsInputProductId.java new file mode 100644 index 00000000..ab10de3a --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/ListProductPricePointsInputProductId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = ListProductPricePointsInputProductId.ListProductPricePointsInputProductIdDeserializer.class) +public abstract class ListProductPricePointsInputProductId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static ListProductPricePointsInputProductId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static ListProductPricePointsInputProductId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends ListProductPricePointsInputProductId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends ListProductPricePointsInputProductId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for ListProductPricePointsInputProductId. + */ + protected static class ListProductPricePointsInputProductIdDeserializer + extends JsonDeserializer { + + @Override + public ListProductPricePointsInputProductId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/ReadProductPricePointPricePointId.java b/src/main/java/com/maxio/advancedbilling/models/containers/ReadProductPricePointPricePointId.java new file mode 100644 index 00000000..78d339f4 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/ReadProductPricePointPricePointId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = ReadProductPricePointPricePointId.ReadProductPricePointPricePointIdDeserializer.class) +public abstract class ReadProductPricePointPricePointId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static ReadProductPricePointPricePointId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static ReadProductPricePointPricePointId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends ReadProductPricePointPricePointId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends ReadProductPricePointPricePointId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for ReadProductPricePointPricePointId. + */ + protected static class ReadProductPricePointPricePointIdDeserializer + extends JsonDeserializer { + + @Override + public ReadProductPricePointPricePointId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/ReadProductPricePointProductId.java b/src/main/java/com/maxio/advancedbilling/models/containers/ReadProductPricePointProductId.java new file mode 100644 index 00000000..dd4e90f4 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/ReadProductPricePointProductId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = ReadProductPricePointProductId.ReadProductPricePointProductIdDeserializer.class) +public abstract class ReadProductPricePointProductId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static ReadProductPricePointProductId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static ReadProductPricePointProductId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends ReadProductPricePointProductId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends ReadProductPricePointProductId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for ReadProductPricePointProductId. + */ + protected static class ReadProductPricePointProductIdDeserializer + extends JsonDeserializer { + + @Override + public ReadProductPricePointProductId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/SubscriptionGroup2.java b/src/main/java/com/maxio/advancedbilling/models/containers/SubscriptionGroup2.java new file mode 100644 index 00000000..2a1ba232 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/SubscriptionGroup2.java @@ -0,0 +1,103 @@ +/* + * 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.SubscriptionGroupInlined; +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 = SubscriptionGroup2.SubscriptionGroup2Deserializer.class) +public abstract class SubscriptionGroup2 { + + /** + * This is Subscription Group Inlined case. + * @param subscriptionGroupInlined SubscriptionGroupInlined value for subscriptionGroupInlined. + * @return The SubscriptionGroupInlinedCase object. + */ + public static SubscriptionGroup2 fromSubscriptionGroupInlined( + SubscriptionGroupInlined subscriptionGroupInlined) { + return subscriptionGroupInlined == null ? null : new SubscriptionGroupInlinedCase(subscriptionGroupInlined); + } + + /** + * 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 subscriptionGroupInlined(SubscriptionGroupInlined subscriptionGroupInlined); + } + + /** + * This is a implementation class for SubscriptionGroupInlinedCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "SubscriptionGroupInlined") + private static class SubscriptionGroupInlinedCase extends SubscriptionGroup2 { + + @JsonValue + private SubscriptionGroupInlined subscriptionGroupInlined; + + SubscriptionGroupInlinedCase(SubscriptionGroupInlined subscriptionGroupInlined) { + this.subscriptionGroupInlined = subscriptionGroupInlined; + } + + @Override + public R match(Cases cases) { + return cases.subscriptionGroupInlined(this.subscriptionGroupInlined); + } + + @JsonCreator + private SubscriptionGroupInlinedCase(JsonNode jsonNode) throws IOException { + this.subscriptionGroupInlined = ApiHelper.deserialize(jsonNode, + SubscriptionGroupInlined.class); + } + + @Override + public String toString() { + return subscriptionGroupInlined.toString(); + } + } + + /** + * This is a custom deserializer class for SubscriptionGroup2. + */ + protected static class SubscriptionGroup2Deserializer + extends JsonDeserializer { + + @Override + public SubscriptionGroup2 deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList( + SubscriptionGroupInlinedCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateProductPricePointPricePointId.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateProductPricePointPricePointId.java new file mode 100644 index 00000000..c24963fa --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateProductPricePointPricePointId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateProductPricePointPricePointId.UpdateProductPricePointPricePointIdDeserializer.class) +public abstract class UpdateProductPricePointPricePointId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static UpdateProductPricePointPricePointId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateProductPricePointPricePointId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends UpdateProductPricePointPricePointId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateProductPricePointPricePointId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for UpdateProductPricePointPricePointId. + */ + protected static class UpdateProductPricePointPricePointIdDeserializer + extends JsonDeserializer { + + @Override + public UpdateProductPricePointPricePointId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/src/main/java/com/maxio/advancedbilling/models/containers/UpdateProductPricePointProductId.java b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateProductPricePointProductId.java new file mode 100644 index 00000000..b3293876 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/containers/UpdateProductPricePointProductId.java @@ -0,0 +1,151 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models.containers; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.ObjectCodec; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.maxio.advancedbilling.ApiHelper; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorCase; +import io.apimatic.core.annotations.TypeCombinator.TypeCombinatorStringCase; +import java.io.IOException; +import java.util.Arrays; + +/** + * This is a container class for one-of types. + */ +@JsonDeserialize(using = UpdateProductPricePointProductId.UpdateProductPricePointProductIdDeserializer.class) +public abstract class UpdateProductPricePointProductId { + + /** + * This is Number case. + * @param number int value for number. + * @return The NumberCase object. + */ + public static UpdateProductPricePointProductId fromNumber(int number) { + return new NumberCase(number); + } + + /** + * This is String case. + * @param string String value for string. + * @return The StringCase object. + */ + public static UpdateProductPricePointProductId fromString(String string) { + return string == null ? null : new StringCase(string); + } + + /** + * Method to match from the provided one-of cases. + * @param The type to return after applying callback. + * @param cases The one-of type cases callback. + * @return The one-of matched case. + */ + public abstract R match(Cases cases); + + /** + * This is interface for one-of cases. + * @param The type to return after applying callback. + */ + public interface Cases { + R number(int number); + + R string(String string); + } + + /** + * This is a implementation class for NumberCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorCase(type = "int") + private static class NumberCase extends UpdateProductPricePointProductId { + + @JsonValue + private int number; + + NumberCase(int number) { + this.number = number; + } + + @Override + public R match(Cases cases) { + return cases.number(this.number); + } + + @JsonCreator + private NumberCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isInt()) { + this.number = ApiHelper.deserialize(jsonNode, Integer.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return String.valueOf(number); + } + } + + /** + * This is a implementation class for StringCase. + */ + @JsonDeserialize(using = JsonDeserializer.None.class) + @TypeCombinatorStringCase + @TypeCombinatorCase(type = "String") + private static class StringCase extends UpdateProductPricePointProductId { + + @JsonValue + private String string; + + StringCase(String string) { + this.string = string; + } + + @Override + public R match(Cases cases) { + return cases.string(this.string); + } + + @JsonCreator + private StringCase(JsonNode jsonNode) throws IOException { + if (jsonNode.isTextual()) { + this.string = ApiHelper.deserialize(jsonNode, String.class); + } else { + throw new IllegalArgumentException(); + } + } + + @Override + public String toString() { + return string.toString(); + } + } + + /** + * This is a custom deserializer class for UpdateProductPricePointProductId. + */ + protected static class UpdateProductPricePointProductIdDeserializer + extends JsonDeserializer { + + @Override + public UpdateProductPricePointProductId deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + ObjectCodec oc = jp.getCodec(); + JsonNode node = oc.readTree(jp); + return ApiHelper.deserialize(node, Arrays.asList(NumberCase.class, + StringCase.class), true); + } + } + +} diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsBaseTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsBaseTest.java index 37eb1ec6..991b36a1 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsBaseTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsBaseTest.java @@ -20,6 +20,9 @@ import com.maxio.advancedbilling.models.ProductPricePoint; import com.maxio.advancedbilling.models.ProductPricePointResponse; import com.maxio.advancedbilling.models.ProductResponse; +import com.maxio.advancedbilling.models.containers.ArchiveProductPricePointPricePointId; +import com.maxio.advancedbilling.models.containers.ArchiveProductPricePointProductId; +import com.maxio.advancedbilling.models.containers.CreateProductPricePointProductId; import org.junit.jupiter.api.BeforeAll; import java.io.IOException; @@ -81,7 +84,7 @@ protected static ProductPricePointResponse createProductPricePointWithDelay(long } return PRODUCT_PRICE_POINTS_CONTROLLER - .createProductPricePoint(productId, new CreateProductPricePointRequest(createProductPricePoint)); + .createProductPricePoint(CreateProductPricePointProductId.fromNumber(productId), new CreateProductPricePointRequest(createProductPricePoint)); } protected static CreateProductPricePoint.Builder defaultBuilder() { @@ -105,8 +108,8 @@ protected static void archiveAllSitePricePointsExcludingDefault() throws IOExcep while (!sitePricePointsExcludingDefault.isEmpty()) { for (ProductPricePoint pricePoint : sitePricePointsExcludingDefault) { PRODUCT_PRICE_POINTS_CONTROLLER.archiveProductPricePoint( - pricePoint.getProductId(), - pricePoint.getId() + ArchiveProductPricePointProductId.fromNumber(pricePoint.getProductId()), + ArchiveProductPricePointPricePointId.fromNumber(pricePoint.getId()) ); } sitePricePointsExcludingDefault = listAllSitePricePointsPerPage200ExcludingDefault(); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerCreateTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerCreateTest.java index aa8ff607..b0d618b7 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerCreateTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerCreateTest.java @@ -9,6 +9,7 @@ import com.maxio.advancedbilling.models.Product; import com.maxio.advancedbilling.models.ProductPricePoint; import com.maxio.advancedbilling.models.ProductPricePointErrors; +import com.maxio.advancedbilling.models.containers.CreateProductPricePointProductId; import com.maxio.advancedbilling.utils.CommonAssertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -112,7 +113,8 @@ void shouldReturn422WhenPricePointRequestIsEmpty() { void shouldReturn422WhenRequiredParametersAreMissing(CreateProductPricePointRequest request, ProductPricePointErrors expectedErrors) { // when - then assertThatExceptionOfType(ProductPricePointErrorResponseException.class) - .isThrownBy(() -> PRODUCT_PRICE_POINTS_CONTROLLER.createProductPricePoint(product.getId(), request)) + .isThrownBy(() -> PRODUCT_PRICE_POINTS_CONTROLLER + .createProductPricePoint(CreateProductPricePointProductId.fromNumber(product.getId()), request)) .withMessage("Unprocessable Entity (WebDAV)") .satisfies(e -> { assertThat(e.getResponseCode()).isEqualTo(422); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListAllTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListAllTest.java index f85799de..a8e2d5de 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListAllTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListAllTest.java @@ -9,6 +9,8 @@ import com.maxio.advancedbilling.models.Product; import com.maxio.advancedbilling.models.ProductPricePoint; import com.maxio.advancedbilling.models.SortingDirection; +import com.maxio.advancedbilling.models.containers.ArchiveProductPricePointPricePointId; +import com.maxio.advancedbilling.models.containers.ArchiveProductPricePointProductId; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -46,8 +48,13 @@ static void beforeAll() throws IOException, ApiException { } archivedProductPricePoint = PRODUCT_PRICE_POINTS_CONTROLLER.archiveProductPricePoint( - product.getId(), - createProductPricePoint(product.getId(), defaultBuilder().name("archived-test-price-point-%s".formatted(randomAlphabetic(5))).build()).getPricePoint().getId() + ArchiveProductPricePointProductId.fromNumber(product.getId()), + ArchiveProductPricePointPricePointId.fromNumber( + createProductPricePoint(product.getId(), + defaultBuilder() + .name("archived-test-price-point-%s".formatted(randomAlphabetic(5))) + .build()).getPricePoint().getId() + ) ) .getPricePoint(); } diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListTest.java index 6d6fc2b5..cadab8a4 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/productpricepoints/ProductPricePointsControllerListTest.java @@ -6,6 +6,7 @@ import com.maxio.advancedbilling.models.PricePointType; import com.maxio.advancedbilling.models.Product; import com.maxio.advancedbilling.models.ProductPricePoint; +import com.maxio.advancedbilling.models.containers.ListProductPricePointsInputProductId; import com.maxio.advancedbilling.utils.CommonAssertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -31,7 +32,8 @@ void beforeEach() throws IOException, ApiException { void shouldReturn404WhenProductNotExists() { // when - then CommonAssertions.assertNotFound(() -> PRODUCT_PRICE_POINTS_CONTROLLER - .listProductPricePoints(new ListProductPricePointsInput.Builder(12345).build()) + .listProductPricePoints(new ListProductPricePointsInput + .Builder(ListProductPricePointsInputProductId.fromNumber(12345)).build()) ); } @@ -39,7 +41,8 @@ void shouldReturn404WhenProductNotExists() { void shouldReturnListWithOriginalPricePointOnly() throws IOException, ApiException { // when List productPricePoints = PRODUCT_PRICE_POINTS_CONTROLLER - .listProductPricePoints(new ListProductPricePointsInput.Builder(product.getId()).build()) + .listProductPricePoints(new ListProductPricePointsInput + .Builder(ListProductPricePointsInputProductId.fromNumber(product.getId())).build()) .getPricePoints(); // then @@ -83,7 +86,8 @@ void shouldReturnListWithAllPricePoints() throws IOException, ApiException { // when List productPricePoints = PRODUCT_PRICE_POINTS_CONTROLLER - .listProductPricePoints(new ListProductPricePointsInput.Builder(product.getId()).build()) + .listProductPricePoints(new ListProductPricePointsInput + .Builder(ListProductPricePointsInputProductId.fromNumber(product.getId())).build()) .getPricePoints(); // then @@ -106,7 +110,7 @@ void shouldReturnListWithPagedPricePoints() throws IOException, ApiException { // when List productPricePointsPage1 = PRODUCT_PRICE_POINTS_CONTROLLER .listProductPricePoints(new ListProductPricePointsInput.Builder() - .productId(product.getId()) + .productId(ListProductPricePointsInputProductId.fromNumber(product.getId())) .page(1) .perPage(2) .build() @@ -114,7 +118,7 @@ void shouldReturnListWithPagedPricePoints() throws IOException, ApiException { .getPricePoints(); List productPricePointsPage2 = PRODUCT_PRICE_POINTS_CONTROLLER .listProductPricePoints(new ListProductPricePointsInput.Builder() - .productId(product.getId()) + .productId(ListProductPricePointsInputProductId.fromNumber(product.getId())) .page(2) .perPage(2) .build() @@ -122,7 +126,7 @@ void shouldReturnListWithPagedPricePoints() throws IOException, ApiException { .getPricePoints(); List productPricePointsPage3 = PRODUCT_PRICE_POINTS_CONTROLLER .listProductPricePoints(new ListProductPricePointsInput.Builder() - .productId(product.getId()) + .productId(ListProductPricePointsInputProductId.fromNumber(product.getId())) .page(3) .perPage(2) .build() @@ -146,7 +150,7 @@ void shouldReturnListUsingTypeFilter() throws IOException, ApiException { // when - then List pricePointsOfDefaultType = PRODUCT_PRICE_POINTS_CONTROLLER .listProductPricePoints(new ListProductPricePointsInput.Builder() - .productId(product.getId()) + .productId(ListProductPricePointsInputProductId.fromNumber(product.getId())) .filterType(Collections.singletonList(PricePointType.ENUM_DEFAULT)) .build() ) @@ -158,7 +162,7 @@ void shouldReturnListUsingTypeFilter() throws IOException, ApiException { List pricePointsOfCatalogType = PRODUCT_PRICE_POINTS_CONTROLLER .listProductPricePoints(new ListProductPricePointsInput.Builder() - .productId(product.getId()) + .productId(ListProductPricePointsInputProductId.fromNumber(product.getId())) .filterType(Collections.singletonList(PricePointType.CATALOG)) .build() ) diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerListProductsTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerListProductsTest.java index 8b43d927..bb108ea1 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerListProductsTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerListProductsTest.java @@ -10,6 +10,7 @@ import com.maxio.advancedbilling.models.Product; import com.maxio.advancedbilling.models.ProductPricePoint; import com.maxio.advancedbilling.models.ProductResponse; +import com.maxio.advancedbilling.models.containers.CreateProductPricePointProductId; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -42,7 +43,8 @@ static void setupProducts() throws IOException, ApiException { .priceInCents(22).name("Price point to promote").build() ); ProductPricePoint pricePoint = productPricePointsController - .createProductPricePoint(productWithChangedPricePoint.getId(), createProductPricePointRequest) + .createProductPricePoint(CreateProductPricePointProductId.fromNumber(productWithChangedPricePoint.getId()), + createProductPricePointRequest) .getPricePoint(); productPricePointsController.promoteProductPricePointToDefault(productWithChangedPricePoint.getId(), pricePoint.getId()); productWithChangedPricePoint = productsController.readProduct(productWithChangedPricePoint.getId()).getProduct(); diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerUpdateProductTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerUpdateProductTest.java index d30f4ceb..6fc2c5db 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerUpdateProductTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/products/ProductsControllerUpdateProductTest.java @@ -12,7 +12,6 @@ import org.junit.jupiter.params.provider.MethodSource; import java.io.IOException; -import java.time.Instant; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; import java.util.Collections; diff --git a/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java b/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java index affae00b..f3e35dee 100644 --- a/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java +++ b/tests/src/test/java/com/maxio/advancedbilling/controllers/sites/SitesControllerTest.java @@ -3,6 +3,7 @@ import com.maxio.advancedbilling.TestClient; import com.maxio.advancedbilling.controllers.SitesController; import com.maxio.advancedbilling.models.AllocationSettings; +import com.maxio.advancedbilling.models.CreditType; import com.maxio.advancedbilling.models.NetTerms; import com.maxio.advancedbilling.models.OrganizationAddress; import com.maxio.advancedbilling.models.Site; @@ -34,9 +35,9 @@ void shouldReadSite() throws Exception { assertThat(site.getWhopaysDefaultPayer()).isEqualTo("self-ungrouped"); AllocationSettings allocationSettings = site.getAllocationSettings(); - assertThat(allocationSettings.getUpgradeCharge()).isEqualTo("prorated"); + assertThat(allocationSettings.getUpgradeCharge()).isEqualTo(CreditType.PRORATED); assertThat(allocationSettings.getAccrueCharge()).isTrue(); - assertThat(allocationSettings.getDowngradeCredit()).isEqualTo("none"); + assertThat(allocationSettings.getDowngradeCredit()).isEqualTo(CreditType.NONE); OrganizationAddress organizationAddress = site.getOrganizationAddress(); assertThat(organizationAddress.getStreet()).isEqualTo("Asdf Street");