Skip to content

Commit

Permalink
Automated commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
maxio-sdk committed Apr 11, 2024
1 parent 5241795 commit 74a5e7a
Show file tree
Hide file tree
Showing 23 changed files with 221 additions and 485 deletions.
8 changes: 4 additions & 4 deletions doc/controllers/subscription-group-invoice-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
23 changes: 14 additions & 9 deletions doc/controllers/subscription-invoice-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ IssueServiceCreditRequest body = new IssueServiceCreditRequest.Builder(
new IssueServiceCredit.Builder(
IssueServiceCreditAmount.fromString(
"1"
),
"Courtesy credit"
)
)
.build()
)
Expand Down Expand Up @@ -261,6 +260,12 @@ try {
}
```

## Errors

| HTTP Status Code | Error Description | Exception Class |
| --- | --- | --- |
| 422 | Unprocessable Entity (WebDAV) | `ApiException` |


# Deduct Service Credit

Expand Down Expand Up @@ -291,9 +296,9 @@ DeductServiceCreditRequest body = new DeductServiceCreditRequest.Builder(
new DeductServiceCredit.Builder(
DeductServiceCreditAmount.fromString(
"1"
),
"Deduction"
)
)
.memo("Deduction")
.build()
)
.build();
Expand All @@ -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
Expand All @@ -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)
```

Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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` |

2 changes: 2 additions & 0 deletions doc/models/create-offer-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
| 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)

```json
{
"component_id": 242,
"price_point_id": 10,
"starting_quantity": 50
}
```
Expand Down
2 changes: 2 additions & 0 deletions doc/models/create-offer-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
],
Expand Down
2 changes: 2 additions & 0 deletions doc/models/create-offer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
],
Expand Down
2 changes: 1 addition & 1 deletion doc/models/deduct-service-credit.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
22 changes: 22 additions & 0 deletions doc/models/include-null-or-not-null.md
Original file line number Diff line number Diff line change
@@ -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
```

2 changes: 1 addition & 1 deletion doc/models/issue-service-credit.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion doc/models/list-price-points-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<PricePointType>`](../../doc/models/price-point-type.md) | Optional | Allows fetching price points with matching type. Use in query: `filter[type]=custom,catalog`. | List<PricePointType> getType() | setType(List<PricePointType> type) |
| `Ids` | `List<Integer>` | Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | List<Integer> getIds() | setIds(List<Integer> 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)

Expand Down
36 changes: 0 additions & 36 deletions doc/models/prepayment-aggregated-error.md

This file was deleted.

32 changes: 0 additions & 32 deletions doc/models/refund-prepayment-aggregated-error.md

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion doc/models/refund-prepayment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -221,6 +219,9 @@ private ApiCall<ServiceCredit, ApiException> 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))
Expand Down Expand Up @@ -265,7 +266,7 @@ private ApiCall<Void, ApiException> 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))
Expand All @@ -286,7 +287,7 @@ private ApiCall<Void, ApiException> 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();
}
Expand All @@ -296,7 +297,7 @@ public PrepaymentResponse refundPrepayment(
*/
private ApiCall<PrepaymentResponse, ApiException> prepareRefundPrepaymentRequest(
final int subscriptionId,
final String prepaymentId,
final long prepaymentId,
final RefundPrepaymentRequest body) throws JsonProcessingException, IOException {
return new ApiCall.Builder<PrepaymentResponse, ApiException>()
.globalConfig(getGlobalConfiguration())
Expand All @@ -307,7 +308,7 @@ private ApiCall<PrepaymentResponse, ApiException> 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))
Expand All @@ -327,7 +328,7 @@ private ApiCall<PrepaymentResponse, ApiException> 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))
Expand Down
Loading

0 comments on commit 74a5e7a

Please sign in to comment.