Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE-613] Adjustments to product price points #27

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,16 +274,16 @@ Install the SDK by adding the following dependency in your project's pom.xml fil
<dependency>
<groupId>com.maxio</groupId>
<artifactId>advanced-billing-sdk</artifactId>
<version>0.0.3</version>
<version>0.0.4</version>
</dependency>
```

You can also view the package at:
https://mvnrepository.com/artifact/com.maxio/advanced-billing-sdk/0.0.3
https://mvnrepository.com/artifact/com.maxio/advanced-billing-sdk/0.0.4

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -292,7 +292,7 @@ The following parameters are configurable for the API Client:
| `subdomain` | `String` | The subdomain for your Chargify site.<br>*Default*: `"subdomain"` |
| `domain` | `String` | The Chargify server domain.<br>*Default*: `"chargify.com"` |
| `environment` | Environment | The API environment. <br> **Default: `Environment.PRODUCTION`** |
| `httpClientConfig` | [`ReadonlyHttpClientConfiguration`](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-client-configuration.md) | Http Client Configuration instance. |
| `httpClientConfig` | [`ReadonlyHttpClientConfiguration`](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-client-configuration.md) | Http Client Configuration instance. |
| `basicAuthUserName` | `String` | The username to use with basic authentication |
| `basicAuthPassword` | `String` | The password to use with basic authentication |

Expand Down Expand Up @@ -326,49 +326,49 @@ This API uses `Basic Authentication`.

## List of APIs

* [API Exports](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/billing-portal.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/controllers/webhooks.md)
* [API Exports](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/billing-portal.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/controllers/webhooks.md)

## Classes Documentation

* [Utility Classes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/utility-classes.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-request.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-response.md)
* [HttpStringResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-string-response.md)
* [HttpContext](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-context.md)
* [HttpBodyRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-body-request.md)
* [Headers](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/headers.md)
* [ApiException](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/api-exception.md)
* [Configuration Interface](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/configuration-interface.md)
* [HttpClientConfiguration](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-client-configuration.md)
* [HttpClientConfiguration.Builder](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.3/doc/http-client-configuration-builder.md)
* [Utility Classes](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/utility-classes.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-request.md)
* [HttpResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-response.md)
* [HttpStringResponse](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-string-response.md)
* [HttpContext](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-context.md)
* [HttpBodyRequest](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-body-request.md)
* [Headers](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/headers.md)
* [ApiException](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/api-exception.md)
* [Configuration Interface](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/configuration-interface.md)
* [HttpClientConfiguration](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-client-configuration.md)
* [HttpClientConfiguration.Builder](https://www.github.com/maxio-com/ab-java-sdk/tree/0.0.4/doc/http-client-configuration-builder.md)

12 changes: 12 additions & 0 deletions doc/controllers/product-price-points.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ try {
}
```

## Errors

| HTTP Status Code | Error Description | Exception Class |
| --- | --- | --- |
| 422 | Unprocessable Entity (WebDAV) | [`ProductPricePointErrorResponseException`](../../doc/models/product-price-point-error-response-exception.md) |


# List Product Price Points

Expand Down Expand Up @@ -621,6 +627,12 @@ try {
}
```

## Errors

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


# Create Product Currency Prices

Expand Down
41 changes: 41 additions & 0 deletions doc/models/product-price-point-error-response-exception.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

# Product Price Point Error Response Exception

## Structure

`ProductPricePointErrorResponseException`

## Fields

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `Errors` | [`ProductPricePointErrors`](../../doc/models/product-price-point-errors.md) | Required | - | ProductPricePointErrors getErrors() | setErrors(ProductPricePointErrors errors) |

## Example (as JSON)

```json
{
"errors": {
"price_point": "can't be blank",
"interval": [
"Recurring Interval: cannot be blank.",
"Recurring Interval: must be greater than or equal to 1."
],
"interval_unit": [
"Interval unit: cannot be blank.",
"Interval unit: must be 'month' or 'day'."
],
"name": [
"Name: cannot be blank."
],
"price": [
"Price: is not a number.",
"Price: must be greater than or equal to 0."
],
"price_in_cents": [
"Price in cents: cannot be blank."
]
}
}
```

44 changes: 44 additions & 0 deletions doc/models/product-price-point-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

# Product Price Point Errors

## Structure

`ProductPricePointErrors`

## Fields

| Name | Type | Tags | Description | Getter | Setter |
| --- | --- | --- | --- | --- | --- |
| `PricePoint` | `String` | Optional | - | String getPricePoint() | setPricePoint(String pricePoint) |
| `Interval` | `List<String>` | Optional | - | List<String> getInterval() | setInterval(List<String> interval) |
| `IntervalUnit` | `List<String>` | Optional | - | List<String> getIntervalUnit() | setIntervalUnit(List<String> intervalUnit) |
| `Name` | `List<String>` | Optional | - | List<String> getName() | setName(List<String> name) |
| `Price` | `List<String>` | Optional | - | List<String> getPrice() | setPrice(List<String> price) |
| `PriceInCents` | `List<String>` | Optional | - | List<String> getPriceInCents() | setPriceInCents(List<String> priceInCents) |

## Example (as JSON)

```json
{
"price_point": "can't be blank",
"interval": [
"Recurring Interval: cannot be blank.",
"Recurring Interval: must be greater than or equal to 1."
],
"interval_unit": [
"Interval unit: cannot be blank.",
"Interval unit: must be 'month' or 'day'."
],
"name": [
"Name: cannot be blank."
],
"price": [
"Price: is not a number.",
"Price: must be greater than or equal to 0."
],
"price_in_cents": [
"Price in cents: cannot be blank."
]
}
```

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.maxio</groupId>
<artifactId>advanced-billing-sdk</artifactId>
<version>0.0.3</version>
<version>0.0.4</version>
<packaging>jar</packaging>
<name>Advanced Billing</name>
<description>Ultimate billing and pricing flexibility for B2B SaaS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public final class AdvancedBillingClient implements Configuration {

private static final CompatibilityFactory compatibilityFactory = new CompatibilityFactoryImpl();

private static String userAgent = "AB SDK Java:0.0.3 on OS {os-info}";
private static String userAgent = "AB SDK Java:0.0.4 on OS {os-info}";

/**
* Current API environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.maxio.advancedbilling.exceptions.ApiException;
import com.maxio.advancedbilling.exceptions.ErrorListResponseException;
import com.maxio.advancedbilling.exceptions.ErrorMapResponseException;
import com.maxio.advancedbilling.exceptions.ProductPricePointErrorResponseException;
import com.maxio.advancedbilling.http.request.HttpMethod;
import com.maxio.advancedbilling.models.BulkCreateProductPricePointsRequest;
import com.maxio.advancedbilling.models.BulkCreateProductPricePointsResponse;
Expand Down Expand Up @@ -84,6 +85,9 @@ private ApiCall<ProductPricePointResponse, ApiException> prepareCreateProductPri
.responseHandler(responseHandler -> responseHandler
.deserializer(
response -> ApiHelper.deserialize(response, ProductPricePointResponse.class))
.localErrorCase("422",
ErrorCase.setReason("Unprocessable Entity (WebDAV)",
(reason, context) -> new ProductPricePointErrorResponseException(reason, context)))
.globalErrorCase(GLOBAL_ERROR_CASES))
.endpointConfiguration(param -> param
.arraySerializationFormat(ArraySerializationFormat.CSV))
Expand Down Expand Up @@ -405,6 +409,9 @@ private ApiCall<BulkCreateProductPricePointsResponse, ApiException> prepareCreat
.responseHandler(responseHandler -> responseHandler
.deserializer(
response -> ApiHelper.deserialize(response, BulkCreateProductPricePointsResponse.class))
.localErrorCase("422",
ErrorCase.setReason("Unprocessable Entity (WebDAV)",
(reason, context) -> new ApiException(reason, context)))
.globalErrorCase(GLOBAL_ERROR_CASES))
.endpointConfiguration(param -> param
.arraySerializationFormat(ArraySerializationFormat.CSV))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* 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.ProductPricePointErrors;
import io.apimatic.coreinterfaces.http.Context;

/**
* This is a model class for ProductPricePointErrorResponseException type.
*/
public class ProductPricePointErrorResponseException extends ApiException {
private static final long serialVersionUID = -58754930854777035L;
private ProductPricePointErrors errors;

/**
* Initialization constructor.
* @param reason The reason for throwing exception
* @param context The context of the API exception
*/
public ProductPricePointErrorResponseException(String reason, Context context) {
super(reason, context);
}


/**
* Getter for Errors.
* @return Returns the ProductPricePointErrors
*/
@JsonGetter("errors")
public ProductPricePointErrors getErrors() {
return this.errors;
}

/**
* Setter for Errors.
* @param errors Value for ProductPricePointErrors
*/
@JsonSetter("errors")
private void setErrors(ProductPricePointErrors errors) {
this.errors = errors;
}
}
Loading