diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index 9d9d788f..33fd486c 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -175,9 +175,9 @@ IssueServiceCreditRequest body = new IssueServiceCreditRequest.Builder( new IssueServiceCredit.Builder( IssueServiceCreditAmount.fromPrecision( 10D - ), - "Credit the group account" + ) ) + .memo("Credit the group account") .build() ) .build(); @@ -242,9 +242,9 @@ DeductServiceCreditRequest body = new DeductServiceCreditRequest.Builder( new DeductServiceCredit.Builder( DeductServiceCreditAmount.fromPrecision( 10D - ), - "Deduct from group account" + ) ) + .memo("Deduct from group account") .build() ) .build(); diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index e9543089..abacf064 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -232,8 +232,7 @@ IssueServiceCreditRequest body = new IssueServiceCreditRequest.Builder( new IssueServiceCredit.Builder( IssueServiceCreditAmount.fromString( "1" - ), - "Courtesy credit" + ) ) .build() ) @@ -261,6 +260,12 @@ try { } ``` +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 422 | Unprocessable Entity (WebDAV) | `ApiException` | + # Deduct Service Credit @@ -291,9 +296,9 @@ DeductServiceCreditRequest body = new DeductServiceCreditRequest.Builder( new DeductServiceCredit.Builder( DeductServiceCreditAmount.fromString( "1" - ), - "Deduction" + ) ) + .memo("Deduction") .build() ) .build(); @@ -311,7 +316,7 @@ try { | HTTP Status Code | Error Description | Exception Class | | --- | --- | --- | -| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | `ApiException` | # Refund Prepayment @@ -323,7 +328,7 @@ The amount may be passed either as a decimal, with `amount`, or an integer in ce ```java PrepaymentResponse refundPrepayment( final int subscriptionId, - final String prepaymentId, + final long prepaymentId, final RefundPrepaymentRequest body) ``` @@ -332,7 +337,7 @@ PrepaymentResponse refundPrepayment( | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `int` | Template, Required | The Chargify id of the subscription | -| `prepaymentId` | `String` | Template, Required | id of prepayment | +| `prepaymentId` | `long` | Template, Required | id of prepayment | | `body` | [`RefundPrepaymentRequest`](../../doc/models/refund-prepayment-request.md) | Body, Optional | - | ## Response Type @@ -343,7 +348,7 @@ PrepaymentResponse refundPrepayment( ```java int subscriptionId = 222; -String prepaymentId = "prepayment_id8"; +long prepaymentId = 228L; try { PrepaymentResponse result = subscriptionInvoiceAccountController.refundPrepayment(subscriptionId, prepaymentId, null); System.out.println(result); @@ -360,5 +365,5 @@ try { | --- | --- | --- | | 400 | Bad Request | [`RefundPrepaymentBaseErrorsResponseException`](../../doc/models/refund-prepayment-base-errors-response-exception.md) | | 404 | Not Found | `ApiException` | -| 422 | Unprocessable Entity | [`RefundPrepaymentAggregatedErrorsResponseException`](../../doc/models/refund-prepayment-aggregated-errors-response-exception.md) | +| 422 | Unprocessable Entity | `ApiException` | diff --git a/doc/models/create-offer-component.md b/doc/models/create-offer-component.md index 679ef996..d72b27f0 100644 --- a/doc/models/create-offer-component.md +++ b/doc/models/create-offer-component.md @@ -10,6 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `ComponentId` | `Integer` | Optional | - | Integer getComponentId() | setComponentId(Integer componentId) | +| `PricePointId` | `Integer` | Optional | - | Integer getPricePointId() | setPricePointId(Integer pricePointId) | | `StartingQuantity` | `Integer` | Optional | - | Integer getStartingQuantity() | setStartingQuantity(Integer startingQuantity) | ## Example (as JSON) @@ -17,6 +18,7 @@ ```json { "component_id": 242, + "price_point_id": 10, "starting_quantity": 50 } ``` diff --git a/doc/models/create-offer-request.md b/doc/models/create-offer-request.md index a622e6ce..0510d2f1 100644 --- a/doc/models/create-offer-request.md +++ b/doc/models/create-offer-request.md @@ -24,10 +24,12 @@ "components": [ { "component_id": 108, + "price_point_id": 124, "starting_quantity": 84 }, { "component_id": 108, + "price_point_id": 124, "starting_quantity": 84 } ], diff --git a/doc/models/create-offer.md b/doc/models/create-offer.md index 6bb695f9..c4232341 100644 --- a/doc/models/create-offer.md +++ b/doc/models/create-offer.md @@ -29,10 +29,12 @@ "components": [ { "component_id": 108, + "price_point_id": 124, "starting_quantity": 84 }, { "component_id": 108, + "price_point_id": 124, "starting_quantity": 84 } ], diff --git a/doc/models/deduct-service-credit.md b/doc/models/deduct-service-credit.md index e987f2ab..a5c0b087 100644 --- a/doc/models/deduct-service-credit.md +++ b/doc/models/deduct-service-credit.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Amount` | [`DeductServiceCreditAmount`](../../doc/models/containers/deduct-service-credit-amount.md) | Required | This is a container for one-of cases. | DeductServiceCreditAmount getAmount() | setAmount(DeductServiceCreditAmount amount) | -| `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | +| `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | ## Example (as JSON) diff --git a/doc/models/include-null-or-not-null.md b/doc/models/include-null-or-not-null.md new file mode 100644 index 00000000..c9209811 --- /dev/null +++ b/doc/models/include-null-or-not-null.md @@ -0,0 +1,22 @@ + +# Include Null or Not Null + +Allows to filter by `not_null` or `null`. + +## Enumeration + +`IncludeNullOrNotNull` + +## Fields + +| Name | +| --- | +| `NotNull` | +| `Null` | + +## Example + +``` +not_null +``` + diff --git a/doc/models/issue-service-credit.md b/doc/models/issue-service-credit.md index d1ffec1a..b8d7da70 100644 --- a/doc/models/issue-service-credit.md +++ b/doc/models/issue-service-credit.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | | `Amount` | [`IssueServiceCreditAmount`](../../doc/models/containers/issue-service-credit-amount.md) | Required | This is a container for one-of cases. | IssueServiceCreditAmount getAmount() | setAmount(IssueServiceCreditAmount amount) | -| `Memo` | `String` | Required | - | String getMemo() | setMemo(String memo) | +| `Memo` | `String` | Optional | - | String getMemo() | setMemo(String memo) | ## Example (as JSON) diff --git a/doc/models/list-price-points-filter.md b/doc/models/list-price-points-filter.md index cd8b0b5b..b41ec00f 100644 --- a/doc/models/list-price-points-filter.md +++ b/doc/models/list-price-points-filter.md @@ -16,7 +16,7 @@ | `EndDatetime` | `ZonedDateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns price points with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | ZonedDateTime getEndDatetime() | setEndDatetime(ZonedDateTime endDatetime) | | `Type` | [`List`](../../doc/models/price-point-type.md) | Optional | Allows fetching price points with matching type. Use in query: `filter[type]=custom,catalog`. | List getType() | setType(List type) | | `Ids` | `List` | Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | List getIds() | setIds(List ids) | -| `ArchivedAt` | [`IncludeNotNull`](../../doc/models/include-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | IncludeNotNull getArchivedAt() | setArchivedAt(IncludeNotNull archivedAt) | +| `ArchivedAt` | [`IncludeNullOrNotNull`](../../doc/models/include-null-or-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | IncludeNullOrNotNull getArchivedAt() | setArchivedAt(IncludeNullOrNotNull archivedAt) | ## Example (as JSON) diff --git a/doc/models/prepayment-aggregated-error.md b/doc/models/prepayment-aggregated-error.md deleted file mode 100644 index dbdabf81..00000000 --- a/doc/models/prepayment-aggregated-error.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Prepayment Aggregated Error - -## Structure - -`PrepaymentAggregatedError` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `AmountInCents` | `List` | Optional | - | List getAmountInCents() | setAmountInCents(List amountInCents) | -| `Base` | `List` | Optional | - | List getBase() | setBase(List base) | -| `External` | `List` | Optional | - | List getExternal() | setExternal(List external) | - -## Example (as JSON) - -```json -{ - "amount_in_cents": [ - "amount_in_cents7", - "amount_in_cents6", - "amount_in_cents5" - ], - "base": [ - "base7", - "base8" - ], - "external": [ - "external0", - "external1", - "external2" - ] -} -``` - diff --git a/doc/models/refund-prepayment-aggregated-error.md b/doc/models/refund-prepayment-aggregated-error.md deleted file mode 100644 index 232697a2..00000000 --- a/doc/models/refund-prepayment-aggregated-error.md +++ /dev/null @@ -1,32 +0,0 @@ - -# Refund Prepayment Aggregated Error - -## Structure - -`RefundPrepaymentAggregatedError` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `Refund` | [`PrepaymentAggregatedError`](../../doc/models/prepayment-aggregated-error.md) | Optional | - | PrepaymentAggregatedError getRefund() | setRefund(PrepaymentAggregatedError refund) | - -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": [ - "amount_in_cents5" - ], - "base": [ - "base7" - ], - "external": [ - "external0", - "external1" - ] - } -} -``` - diff --git a/doc/models/refund-prepayment-aggregated-errors-response-exception.md b/doc/models/refund-prepayment-aggregated-errors-response-exception.md deleted file mode 100644 index e8552040..00000000 --- a/doc/models/refund-prepayment-aggregated-errors-response-exception.md +++ /dev/null @@ -1,36 +0,0 @@ - -# Refund Prepayment Aggregated Errors Response Exception - -Errors returned on creating a refund prepayment, grouped by field, as arrays of strings. - -## Structure - -`RefundPrepaymentAggregatedErrorsResponseException` - -## Fields - -| Name | Type | Tags | Description | Getter | Setter | -| --- | --- | --- | --- | --- | --- | -| `Errors` | [`RefundPrepaymentAggregatedError`](../../doc/models/refund-prepayment-aggregated-error.md) | Optional | - | RefundPrepaymentAggregatedError getErrors() | setErrors(RefundPrepaymentAggregatedError errors) | - -## Example (as JSON) - -```json -{ - "errors": { - "refund": { - "amount_in_cents": [ - "amount_in_cents5" - ], - "base": [ - "base7" - ], - "external": [ - "external0", - "external1" - ] - } - } -} -``` - diff --git a/doc/models/refund-prepayment.md b/doc/models/refund-prepayment.md index 1f858752..94326c2a 100644 --- a/doc/models/refund-prepayment.md +++ b/doc/models/refund-prepayment.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | Getter | Setter | | --- | --- | --- | --- | --- | --- | -| `AmountInCents` | `long` | Required | `amount` is not required if you pass `amount_in_cents`. | long getAmountInCents() | setAmountInCents(long amountInCents) | +| `AmountInCents` | `Long` | Required | `amount` is not required if you pass `amount_in_cents`. | Long getAmountInCents() | setAmountInCents(Long amountInCents) | | `Amount` | [`RefundPrepaymentAmount`](../../doc/models/containers/refund-prepayment-amount.md) | Required | This is a container for one-of cases. | RefundPrepaymentAmount getAmount() | setAmount(RefundPrepaymentAmount amount) | | `Memo` | `String` | Required | **Constraints**: *Minimum Length*: `1` | String getMemo() | setMemo(String memo) | | `External` | `Boolean` | Optional | Specify the type of refund you wish to initiate. When the prepayment is external, the `external` flag is optional. But if the prepayment was made through a payment profile, the `external` flag is required. | Boolean getExternal() | setExternal(Boolean external) | diff --git a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java index b854c443..d5cf7da0 100644 --- a/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java +++ b/src/main/java/com/maxio/advancedbilling/controllers/SubscriptionInvoiceAccountController.java @@ -10,8 +10,6 @@ import com.maxio.advancedbilling.ApiHelper; import com.maxio.advancedbilling.Server; import com.maxio.advancedbilling.exceptions.ApiException; -import com.maxio.advancedbilling.exceptions.ErrorListResponseException; -import com.maxio.advancedbilling.exceptions.RefundPrepaymentAggregatedErrorsResponseException; import com.maxio.advancedbilling.exceptions.RefundPrepaymentBaseErrorsResponseException; import com.maxio.advancedbilling.http.request.HttpMethod; import com.maxio.advancedbilling.models.AccountBalances; @@ -221,6 +219,9 @@ private ApiCall prepareIssueServiceCreditRequest( .deserializer( response -> ApiHelper.deserialize(response, ServiceCredit.class)) .nullify404(false) + .localErrorCase("422", + ErrorCase.setTemplate("HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.", + (reason, context) -> new ApiException(reason, context))) .globalErrorCase(GLOBAL_ERROR_CASES)) .endpointConfiguration(param -> param .arraySerializationFormat(ArraySerializationFormat.CSV)) @@ -265,7 +266,7 @@ private ApiCall prepareDeductServiceCreditRequest( .nullify404(false) .localErrorCase("422", ErrorCase.setTemplate("HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.", - (reason, context) -> new ErrorListResponseException(reason, context))) + (reason, context) -> new ApiException(reason, context))) .globalErrorCase(GLOBAL_ERROR_CASES)) .endpointConfiguration(param -> param .arraySerializationFormat(ArraySerializationFormat.CSV)) @@ -286,7 +287,7 @@ private ApiCall prepareDeductServiceCreditRequest( */ public PrepaymentResponse refundPrepayment( final int subscriptionId, - final String prepaymentId, + final long prepaymentId, final RefundPrepaymentRequest body) throws ApiException, IOException { return prepareRefundPrepaymentRequest(subscriptionId, prepaymentId, body).execute(); } @@ -296,7 +297,7 @@ public PrepaymentResponse refundPrepayment( */ private ApiCall prepareRefundPrepaymentRequest( final int subscriptionId, - final String prepaymentId, + final long prepaymentId, final RefundPrepaymentRequest body) throws JsonProcessingException, IOException { return new ApiCall.Builder() .globalConfig(getGlobalConfiguration()) @@ -307,7 +308,7 @@ private ApiCall prepareRefundPrepaymentRequest .bodySerializer(() -> ApiHelper.serialize(body)) .templateParam(param -> param.key("subscription_id").value(subscriptionId).isRequired(false) .shouldEncode(true)) - .templateParam(param -> param.key("prepayment_id").value(prepaymentId) + .templateParam(param -> param.key("prepayment_id").value(prepaymentId).isRequired(false) .shouldEncode(true)) .headerParam(param -> param.key("Content-Type") .value("application/json").isRequired(false)) @@ -327,7 +328,7 @@ private ApiCall prepareRefundPrepaymentRequest (reason, context) -> new RefundPrepaymentBaseErrorsResponseException(reason, context))) .localErrorCase("422", ErrorCase.setTemplate("HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'.", - (reason, context) -> new RefundPrepaymentAggregatedErrorsResponseException(reason, context))) + (reason, context) -> new ApiException(reason, context))) .globalErrorCase(GLOBAL_ERROR_CASES)) .endpointConfiguration(param -> param .arraySerializationFormat(ArraySerializationFormat.CSV)) diff --git a/src/main/java/com/maxio/advancedbilling/exceptions/RefundPrepaymentAggregatedErrorsResponseException.java b/src/main/java/com/maxio/advancedbilling/exceptions/RefundPrepaymentAggregatedErrorsResponseException.java deleted file mode 100644 index f3d1ddc9..00000000 --- a/src/main/java/com/maxio/advancedbilling/exceptions/RefundPrepaymentAggregatedErrorsResponseException.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.maxio.advancedbilling.exceptions; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.maxio.advancedbilling.models.RefundPrepaymentAggregatedError; -import io.apimatic.coreinterfaces.http.Context; - -/** - * This is a model class for RefundPrepaymentAggregatedErrorsResponseException type. - */ -public class RefundPrepaymentAggregatedErrorsResponseException extends ApiException { - private static final long serialVersionUID = -83180220868429741L; - private RefundPrepaymentAggregatedError errors; - - /** - * Initialization constructor. - * @param reason The reason for throwing exception - * @param context The context of the API exception - */ - public RefundPrepaymentAggregatedErrorsResponseException(String reason, Context context) { - super(reason, context); - } - - - /** - * Getter for Errors. - * @return Returns the RefundPrepaymentAggregatedError - */ - @JsonGetter("errors") - public RefundPrepaymentAggregatedError getErrors() { - return this.errors; - } - - /** - * Setter for Errors. - * @param errors Value for RefundPrepaymentAggregatedError - */ - @JsonSetter("errors") - private void setErrors(RefundPrepaymentAggregatedError errors) { - this.errors = errors; - } -} diff --git a/src/main/java/com/maxio/advancedbilling/models/CreateOfferComponent.java b/src/main/java/com/maxio/advancedbilling/models/CreateOfferComponent.java index 829f72d7..b7c41006 100644 --- a/src/main/java/com/maxio/advancedbilling/models/CreateOfferComponent.java +++ b/src/main/java/com/maxio/advancedbilling/models/CreateOfferComponent.java @@ -17,6 +17,7 @@ public class CreateOfferComponent extends BaseModel { private Integer componentId; + private Integer pricePointId; private Integer startingQuantity; /** @@ -28,12 +29,15 @@ public CreateOfferComponent() { /** * Initialization constructor. * @param componentId Integer value for componentId. + * @param pricePointId Integer value for pricePointId. * @param startingQuantity Integer value for startingQuantity. */ public CreateOfferComponent( Integer componentId, + Integer pricePointId, Integer startingQuantity) { this.componentId = componentId; + this.pricePointId = pricePointId; this.startingQuantity = startingQuantity; } @@ -56,6 +60,25 @@ public void setComponentId(Integer componentId) { this.componentId = componentId; } + /** + * Getter for PricePointId. + * @return Returns the Integer + */ + @JsonGetter("price_point_id") + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getPricePointId() { + return pricePointId; + } + + /** + * Setter for PricePointId. + * @param pricePointId Value for Integer + */ + @JsonSetter("price_point_id") + public void setPricePointId(Integer pricePointId) { + this.pricePointId = pricePointId; + } + /** * Getter for StartingQuantity. * @return Returns the Integer @@ -81,8 +104,9 @@ public void setStartingQuantity(Integer startingQuantity) { */ @Override public String toString() { - return "CreateOfferComponent [" + "componentId=" + componentId + ", startingQuantity=" - + startingQuantity + ", additionalProperties=" + getAdditionalProperties() + "]"; + return "CreateOfferComponent [" + "componentId=" + componentId + ", pricePointId=" + + pricePointId + ", startingQuantity=" + startingQuantity + + ", additionalProperties=" + getAdditionalProperties() + "]"; } /** @@ -93,6 +117,7 @@ public String toString() { public Builder toBuilder() { Builder builder = new Builder() .componentId(getComponentId()) + .pricePointId(getPricePointId()) .startingQuantity(getStartingQuantity()); return builder; } @@ -102,6 +127,7 @@ public Builder toBuilder() { */ public static class Builder { private Integer componentId; + private Integer pricePointId; private Integer startingQuantity; @@ -116,6 +142,16 @@ public Builder componentId(Integer componentId) { return this; } + /** + * Setter for pricePointId. + * @param pricePointId Integer value for pricePointId. + * @return Builder + */ + public Builder pricePointId(Integer pricePointId) { + this.pricePointId = pricePointId; + return this; + } + /** * Setter for startingQuantity. * @param startingQuantity Integer value for startingQuantity. @@ -131,7 +167,7 @@ public Builder startingQuantity(Integer startingQuantity) { * @return {@link CreateOfferComponent} */ public CreateOfferComponent build() { - return new CreateOfferComponent(componentId, startingQuantity); + return new CreateOfferComponent(componentId, pricePointId, startingQuantity); } } } diff --git a/src/main/java/com/maxio/advancedbilling/models/DeductServiceCredit.java b/src/main/java/com/maxio/advancedbilling/models/DeductServiceCredit.java index 6316598c..49ee4c02 100644 --- a/src/main/java/com/maxio/advancedbilling/models/DeductServiceCredit.java +++ b/src/main/java/com/maxio/advancedbilling/models/DeductServiceCredit.java @@ -7,6 +7,7 @@ package com.maxio.advancedbilling.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.maxio.advancedbilling.models.containers.DeductServiceCreditAmount; import io.apimatic.core.types.BaseModel; @@ -60,6 +61,7 @@ public void setAmount(DeductServiceCreditAmount amount) { * @return Returns the String */ @JsonGetter("memo") + @JsonInclude(JsonInclude.Include.NON_NULL) public String getMemo() { return memo; } @@ -89,7 +91,8 @@ public String toString() { * @return a new {@link DeductServiceCredit.Builder} object */ public Builder toBuilder() { - Builder builder = new Builder(amount, memo); + Builder builder = new Builder(amount) + .memo(getMemo()); return builder; } @@ -109,11 +112,9 @@ public Builder() { /** * Initialization constructor. * @param amount DeductServiceCreditAmount value for amount. - * @param memo String value for memo. */ - public Builder(DeductServiceCreditAmount amount, String memo) { + public Builder(DeductServiceCreditAmount amount) { this.amount = amount; - this.memo = memo; } /** diff --git a/src/main/java/com/maxio/advancedbilling/models/IncludeNullOrNotNull.java b/src/main/java/com/maxio/advancedbilling/models/IncludeNullOrNotNull.java new file mode 100644 index 00000000..80ef6b99 --- /dev/null +++ b/src/main/java/com/maxio/advancedbilling/models/IncludeNullOrNotNull.java @@ -0,0 +1,92 @@ +/* + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +package com.maxio.advancedbilling.models; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.TreeMap; + + +/** + * IncludeNullOrNotNull to be used. + */ +public enum IncludeNullOrNotNull { + NOT_NULL, + + ENUM_NULL; + + + private static TreeMap valueMap = new TreeMap<>(); + private String value; + + static { + NOT_NULL.value = "not_null"; + ENUM_NULL.value = "null"; + + valueMap.put("not_null", NOT_NULL); + valueMap.put("null", ENUM_NULL); + } + + /** + * 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 IncludeNullOrNotNull constructFromString(String toConvert) throws IOException { + IncludeNullOrNotNull 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 IncludeNullOrNotNull 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 IncludeNullOrNotNull values to list of string values. + * @param toConvert The list of IncludeNullOrNotNull 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 (IncludeNullOrNotNull enumValue : toConvert) { + convertedValues.add(enumValue.value); + } + return convertedValues; + } +} \ No newline at end of file diff --git a/src/main/java/com/maxio/advancedbilling/models/IssueServiceCredit.java b/src/main/java/com/maxio/advancedbilling/models/IssueServiceCredit.java index 22de7346..86318966 100644 --- a/src/main/java/com/maxio/advancedbilling/models/IssueServiceCredit.java +++ b/src/main/java/com/maxio/advancedbilling/models/IssueServiceCredit.java @@ -7,6 +7,7 @@ package com.maxio.advancedbilling.models; import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonSetter; import com.maxio.advancedbilling.models.containers.IssueServiceCreditAmount; import io.apimatic.core.types.BaseModel; @@ -60,6 +61,7 @@ public void setAmount(IssueServiceCreditAmount amount) { * @return Returns the String */ @JsonGetter("memo") + @JsonInclude(JsonInclude.Include.NON_NULL) public String getMemo() { return memo; } @@ -89,7 +91,8 @@ public String toString() { * @return a new {@link IssueServiceCredit.Builder} object */ public Builder toBuilder() { - Builder builder = new Builder(amount, memo); + Builder builder = new Builder(amount) + .memo(getMemo()); return builder; } @@ -109,11 +112,9 @@ public Builder() { /** * Initialization constructor. * @param amount IssueServiceCreditAmount value for amount. - * @param memo String value for memo. */ - public Builder(IssueServiceCreditAmount amount, String memo) { + public Builder(IssueServiceCreditAmount amount) { this.amount = amount; - this.memo = memo; } /** diff --git a/src/main/java/com/maxio/advancedbilling/models/ListPricePointsFilter.java b/src/main/java/com/maxio/advancedbilling/models/ListPricePointsFilter.java index 8e24b500..ec66409f 100644 --- a/src/main/java/com/maxio/advancedbilling/models/ListPricePointsFilter.java +++ b/src/main/java/com/maxio/advancedbilling/models/ListPricePointsFilter.java @@ -29,7 +29,7 @@ public class ListPricePointsFilter private ZonedDateTime endDatetime; private List type; private List ids; - private IncludeNotNull archivedAt; + private IncludeNullOrNotNull archivedAt; /** * Default constructor. @@ -46,7 +46,7 @@ public ListPricePointsFilter() { * @param endDatetime ZonedDateTime value for endDatetime. * @param type List of PricePointType value for type. * @param ids List of Integer value for ids. - * @param archivedAt IncludeNotNull value for archivedAt. + * @param archivedAt IncludeNullOrNotNull value for archivedAt. */ public ListPricePointsFilter( BasicDateField dateField, @@ -56,7 +56,7 @@ public ListPricePointsFilter( ZonedDateTime endDatetime, List type, List ids, - IncludeNotNull archivedAt) { + IncludeNullOrNotNull archivedAt) { this.dateField = dateField; this.startDate = startDate; this.endDate = endDate; @@ -250,11 +250,11 @@ public void setIds(List ids) { * Getter for ArchivedAt. * Allows fetching price points only if archived_at is present or not. Use in query: * `filter[archived_at]=not_null`. - * @return Returns the IncludeNotNull + * @return Returns the IncludeNullOrNotNull */ @JsonGetter("archived_at") @JsonInclude(JsonInclude.Include.NON_NULL) - public IncludeNotNull getArchivedAt() { + public IncludeNullOrNotNull getArchivedAt() { return archivedAt; } @@ -262,10 +262,10 @@ public IncludeNotNull getArchivedAt() { * Setter for ArchivedAt. * Allows fetching price points only if archived_at is present or not. Use in query: * `filter[archived_at]=not_null`. - * @param archivedAt Value for IncludeNotNull + * @param archivedAt Value for IncludeNullOrNotNull */ @JsonSetter("archived_at") - public void setArchivedAt(IncludeNotNull archivedAt) { + public void setArchivedAt(IncludeNullOrNotNull archivedAt) { this.archivedAt = archivedAt; } @@ -310,7 +310,7 @@ public static class Builder { private ZonedDateTime endDatetime; private List type; private List ids; - private IncludeNotNull archivedAt; + private IncludeNullOrNotNull archivedAt; @@ -386,10 +386,10 @@ public Builder ids(List ids) { /** * Setter for archivedAt. - * @param archivedAt IncludeNotNull value for archivedAt. + * @param archivedAt IncludeNullOrNotNull value for archivedAt. * @return Builder */ - public Builder archivedAt(IncludeNotNull archivedAt) { + public Builder archivedAt(IncludeNullOrNotNull archivedAt) { this.archivedAt = archivedAt; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/PrepaymentAggregatedError.java b/src/main/java/com/maxio/advancedbilling/models/PrepaymentAggregatedError.java deleted file mode 100644 index 956e480a..00000000 --- a/src/main/java/com/maxio/advancedbilling/models/PrepaymentAggregatedError.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.maxio.advancedbilling.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; -import io.apimatic.core.types.BaseModel; -import java.util.List; - -/** - * This is a model class for PrepaymentAggregatedError type. - */ -public class PrepaymentAggregatedError - extends BaseModel { - private List amountInCents; - private List base; - private List external; - - /** - * Default constructor. - */ - public PrepaymentAggregatedError() { - } - - /** - * Initialization constructor. - * @param amountInCents List of String value for amountInCents. - * @param base List of String value for base. - * @param external List of String value for external. - */ - public PrepaymentAggregatedError( - List amountInCents, - List base, - List external) { - this.amountInCents = amountInCents; - this.base = base; - this.external = external; - } - - /** - * Getter for AmountInCents. - * @return Returns the List of String - */ - @JsonGetter("amount_in_cents") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getAmountInCents() { - return amountInCents; - } - - /** - * Setter for AmountInCents. - * @param amountInCents Value for List of String - */ - @JsonSetter("amount_in_cents") - public void setAmountInCents(List amountInCents) { - this.amountInCents = amountInCents; - } - - /** - * Getter for Base. - * @return Returns the List of String - */ - @JsonGetter("base") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getBase() { - return base; - } - - /** - * Setter for Base. - * @param base Value for List of String - */ - @JsonSetter("base") - public void setBase(List base) { - this.base = base; - } - - /** - * Getter for External. - * @return Returns the List of String - */ - @JsonGetter("external") - @JsonInclude(JsonInclude.Include.NON_NULL) - public List getExternal() { - return external; - } - - /** - * Setter for External. - * @param external Value for List of String - */ - @JsonSetter("external") - public void setExternal(List external) { - this.external = external; - } - - /** - * Converts this PrepaymentAggregatedError into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "PrepaymentAggregatedError [" + "amountInCents=" + amountInCents + ", base=" + base - + ", external=" + external + ", additionalProperties=" + getAdditionalProperties() - + "]"; - } - - /** - * Builds a new {@link PrepaymentAggregatedError.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link PrepaymentAggregatedError.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .amountInCents(getAmountInCents()) - .base(getBase()) - .external(getExternal()); - return builder; - } - - /** - * Class to build instances of {@link PrepaymentAggregatedError}. - */ - public static class Builder { - private List amountInCents; - private List base; - private List external; - - - - /** - * Setter for amountInCents. - * @param amountInCents List of String value for amountInCents. - * @return Builder - */ - public Builder amountInCents(List amountInCents) { - this.amountInCents = amountInCents; - return this; - } - - /** - * Setter for base. - * @param base List of String value for base. - * @return Builder - */ - public Builder base(List base) { - this.base = base; - return this; - } - - /** - * Setter for external. - * @param external List of String value for external. - * @return Builder - */ - public Builder external(List external) { - this.external = external; - return this; - } - - /** - * Builds a new {@link PrepaymentAggregatedError} object using the set fields. - * @return {@link PrepaymentAggregatedError} - */ - public PrepaymentAggregatedError build() { - return new PrepaymentAggregatedError(amountInCents, base, external); - } - } -} diff --git a/src/main/java/com/maxio/advancedbilling/models/RefundPrepayment.java b/src/main/java/com/maxio/advancedbilling/models/RefundPrepayment.java index 130b3652..2de45ead 100644 --- a/src/main/java/com/maxio/advancedbilling/models/RefundPrepayment.java +++ b/src/main/java/com/maxio/advancedbilling/models/RefundPrepayment.java @@ -17,7 +17,7 @@ */ public class RefundPrepayment extends BaseModel { - private long amountInCents; + private Long amountInCents; private RefundPrepaymentAmount amount; private String memo; private Boolean external; @@ -30,13 +30,13 @@ public RefundPrepayment() { /** * Initialization constructor. - * @param amountInCents long value for amountInCents. + * @param amountInCents Long value for amountInCents. * @param amount RefundPrepaymentAmount value for amount. * @param memo String value for memo. * @param external Boolean value for external. */ public RefundPrepayment( - long amountInCents, + Long amountInCents, RefundPrepaymentAmount amount, String memo, Boolean external) { @@ -49,20 +49,20 @@ public RefundPrepayment( /** * Getter for AmountInCents. * `amount` is not required if you pass `amount_in_cents`. - * @return Returns the long + * @return Returns the Long */ @JsonGetter("amount_in_cents") - public long getAmountInCents() { + public Long getAmountInCents() { return amountInCents; } /** * Setter for AmountInCents. * `amount` is not required if you pass `amount_in_cents`. - * @param amountInCents Value for long + * @param amountInCents Value for Long */ @JsonSetter("amount_in_cents") - public void setAmountInCents(long amountInCents) { + public void setAmountInCents(Long amountInCents) { this.amountInCents = amountInCents; } @@ -155,7 +155,7 @@ public Builder toBuilder() { * Class to build instances of {@link RefundPrepayment}. */ public static class Builder { - private long amountInCents; + private Long amountInCents; private RefundPrepaymentAmount amount; private String memo; private Boolean external; @@ -168,11 +168,11 @@ public Builder() { /** * Initialization constructor. - * @param amountInCents long value for amountInCents. + * @param amountInCents Long value for amountInCents. * @param amount RefundPrepaymentAmount value for amount. * @param memo String value for memo. */ - public Builder(long amountInCents, RefundPrepaymentAmount amount, String memo) { + public Builder(Long amountInCents, RefundPrepaymentAmount amount, String memo) { this.amountInCents = amountInCents; this.amount = amount; this.memo = memo; @@ -180,10 +180,10 @@ public Builder(long amountInCents, RefundPrepaymentAmount amount, String memo) { /** * Setter for amountInCents. - * @param amountInCents long value for amountInCents. + * @param amountInCents Long value for amountInCents. * @return Builder */ - public Builder amountInCents(long amountInCents) { + public Builder amountInCents(Long amountInCents) { this.amountInCents = amountInCents; return this; } diff --git a/src/main/java/com/maxio/advancedbilling/models/RefundPrepaymentAggregatedError.java b/src/main/java/com/maxio/advancedbilling/models/RefundPrepaymentAggregatedError.java deleted file mode 100644 index fdcf2c86..00000000 --- a/src/main/java/com/maxio/advancedbilling/models/RefundPrepaymentAggregatedError.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * AdvancedBilling - * - * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). - */ - -package com.maxio.advancedbilling.models; - -import com.fasterxml.jackson.annotation.JsonGetter; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; -import io.apimatic.core.types.BaseModel; - -/** - * This is a model class for RefundPrepaymentAggregatedError type. - */ -public class RefundPrepaymentAggregatedError - extends BaseModel { - private PrepaymentAggregatedError refund; - - /** - * Default constructor. - */ - public RefundPrepaymentAggregatedError() { - } - - /** - * Initialization constructor. - * @param refund PrepaymentAggregatedError value for refund. - */ - public RefundPrepaymentAggregatedError( - PrepaymentAggregatedError refund) { - this.refund = refund; - } - - /** - * Getter for Refund. - * @return Returns the PrepaymentAggregatedError - */ - @JsonGetter("refund") - @JsonInclude(JsonInclude.Include.NON_NULL) - public PrepaymentAggregatedError getRefund() { - return refund; - } - - /** - * Setter for Refund. - * @param refund Value for PrepaymentAggregatedError - */ - @JsonSetter("refund") - public void setRefund(PrepaymentAggregatedError refund) { - this.refund = refund; - } - - /** - * Converts this RefundPrepaymentAggregatedError into string format. - * @return String representation of this class - */ - @Override - public String toString() { - return "RefundPrepaymentAggregatedError [" + "refund=" + refund + ", additionalProperties=" - + getAdditionalProperties() + "]"; - } - - /** - * Builds a new {@link RefundPrepaymentAggregatedError.Builder} object. - * Creates the instance with the state of the current model. - * @return a new {@link RefundPrepaymentAggregatedError.Builder} object - */ - public Builder toBuilder() { - Builder builder = new Builder() - .refund(getRefund()); - return builder; - } - - /** - * Class to build instances of {@link RefundPrepaymentAggregatedError}. - */ - public static class Builder { - private PrepaymentAggregatedError refund; - - - - /** - * Setter for refund. - * @param refund PrepaymentAggregatedError value for refund. - * @return Builder - */ - public Builder refund(PrepaymentAggregatedError refund) { - this.refund = refund; - return this; - } - - /** - * Builds a new {@link RefundPrepaymentAggregatedError} object using the set fields. - * @return {@link RefundPrepaymentAggregatedError} - */ - public RefundPrepaymentAggregatedError build() { - return new RefundPrepaymentAggregatedError(refund); - } - } -}