From 9a55fa5641af55c82f886132880a466728fa5d1d Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 14:31:30 +0000 Subject: [PATCH] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-java-sdk: 4.10.7 --- .fern/metadata.json | 6 +- build.gradle | 4 +- reference.md | 98 +++ .../com/schematic/api/core/ClientOptions.java | 4 +- .../CreateBillingSubscriptionRequestBody.java | 32 + .../companies/AsyncCompaniesClient.java | 43 ++ .../companies/AsyncRawCompaniesClient.java | 208 ++++++ .../resources/companies/CompaniesClient.java | 42 ++ .../companies/RawCompaniesClient.java | 157 +++++ ...illingEntityChildSubscriptionsRequest.java | 107 +++ .../GetCompanyBillingEntityRequest.java | 105 +++ ...BillingEntityChildSubscriptionsParams.java | 107 +++ ...llingEntityChildSubscriptionsResponse.java | 178 +++++ .../types/GetCompanyBillingEntityParams.java | 105 +++ .../GetCompanyBillingEntityResponse.java | 177 +++++ .../BillingCreditAutoTopupAvailability.java | 97 +++ .../BillingPlanCreditGrantResponseData.java | 101 ++- ...ChangeSubscriptionInternalRequestBody.java | 32 + .../types/ChangeSubscriptionRequestBody.java | 32 + .../CompanyBillingEntityResponseData.java | 150 ++++ ...BillingEntitySubscriptionResponseData.java | 657 ++++++++++++++++++ .../api/types/CompanyPlanCreditGrantView.java | 68 +- .../types/CompanyPlanDetailResponseData.java | 77 ++ ...eateBillingPlanCreditGrantRequestBody.java | 64 ++ .../api/types/ManagePlanRequest.java | 45 ++ .../api/types/PlanCreditGrantView.java | 68 +- .../api/types/PlanDetailResponseData.java | 77 ++ .../PlanGroupPlanDetailResponseData.java | 77 ++ .../api/types/PlanViewPublicResponseData.java | 77 ++ ...dateBillingPlanCreditGrantRequestBody.java | 64 ++ 30 files changed, 3042 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/schematic/api/resources/companies/requests/GetBillingEntityChildSubscriptionsRequest.java create mode 100644 src/main/java/com/schematic/api/resources/companies/requests/GetCompanyBillingEntityRequest.java create mode 100644 src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsParams.java create mode 100644 src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsResponse.java create mode 100644 src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityParams.java create mode 100644 src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityResponse.java create mode 100644 src/main/java/com/schematic/api/types/BillingCreditAutoTopupAvailability.java create mode 100644 src/main/java/com/schematic/api/types/CompanyBillingEntityResponseData.java create mode 100644 src/main/java/com/schematic/api/types/CompanyBillingEntitySubscriptionResponseData.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 5346424f..866db587 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -14,10 +14,10 @@ "implementation redis.clients:jedis:5.2.0" ] }, - "originGitCommit": "deb8532a1f84f6daa08b5c611a66a5ec92f53f0e", + "originGitCommit": "1e5d567c7baf29c75ed5e08c9dd30b7e83de8e27", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "1.4.5", + "requestedVersion": "1.5.0", "ciProvider": "github", - "sdkVersion": "1.4.5" + "sdkVersion": "1.5.0" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index a6519575..5cb80625 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ java { group = 'com.schematichq' -version = '1.4.5' +version = '1.5.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -83,7 +83,7 @@ publishing { maven(MavenPublication) { groupId = 'com.schematichq' artifactId = 'schematic-java' - version = '1.4.5' + version = '1.5.0' from components.java pom { name = 'Schematic' diff --git a/reference.md b/reference.md index a4f50b65..a8fb8944 100644 --- a/reference.md +++ b/reference.md @@ -3456,6 +3456,14 @@ client.billing().upsertBillingSubscription(
+**companyId:** `Optional` + +
+
+ +
+
+ **currency:** `String`
@@ -7292,6 +7300,96 @@ client.companies().lookupCompany(
+ + + + +
client.companies.getCompanyBillingEntity() -> GetCompanyBillingEntityResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.companies().getCompanyBillingEntity( + GetCompanyBillingEntityRequest + .builder() + .companyId("company_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `Optional` + +
+
+
+
+ + +
+
+
+ +
client.companies.getBillingEntityChildSubscriptions() -> GetBillingEntityChildSubscriptionsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.companies().getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest + .builder() + .companyId("company_id") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**companyId:** `Optional` + +
+
+
+
+ +
diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java index 2361d9a3..59fa6ca7 100644 --- a/src/main/java/com/schematic/api/core/ClientOptions.java +++ b/src/main/java/com/schematic/api/core/ClientOptions.java @@ -38,10 +38,10 @@ private ClientOptions( this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "com.schematichq:schematic-java/1.4.5"); + put("User-Agent", "com.schematichq:schematic-java/1.5.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.4.5"); + put("X-Fern-SDK-Version", "1.5.0"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java index 3bbd5230..82534df0 100644 --- a/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java +++ b/src/main/java/com/schematic/api/resources/billing/requests/CreateBillingSubscriptionRequestBody.java @@ -35,6 +35,8 @@ public final class CreateBillingSubscriptionRequestBody { private final boolean cancelAtPeriodEnd; + private final Optional companyId; + private final String currency; private final String customerExternalId; @@ -75,6 +77,7 @@ private CreateBillingSubscriptionRequestBody( Optional applicationId, Optional cancelAt, boolean cancelAtPeriodEnd, + Optional companyId, String currency, String customerExternalId, Optional defaultPaymentMethodExternalId, @@ -96,6 +99,7 @@ private CreateBillingSubscriptionRequestBody( this.applicationId = applicationId; this.cancelAt = cancelAt; this.cancelAtPeriodEnd = cancelAtPeriodEnd; + this.companyId = companyId; this.currency = currency; this.customerExternalId = customerExternalId; this.defaultPaymentMethodExternalId = defaultPaymentMethodExternalId; @@ -131,6 +135,11 @@ public boolean getCancelAtPeriodEnd() { return cancelAtPeriodEnd; } + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + @JsonProperty("currency") public String getCurrency() { return currency; @@ -232,6 +241,7 @@ private boolean equalTo(CreateBillingSubscriptionRequestBody other) { return applicationId.equals(other.applicationId) && cancelAt.equals(other.cancelAt) && cancelAtPeriodEnd == other.cancelAtPeriodEnd + && companyId.equals(other.companyId) && currency.equals(other.currency) && customerExternalId.equals(other.customerExternalId) && defaultPaymentMethodExternalId.equals(other.defaultPaymentMethodExternalId) @@ -257,6 +267,7 @@ public int hashCode() { this.applicationId, this.cancelAt, this.cancelAtPeriodEnd, + this.companyId, this.currency, this.customerExternalId, this.defaultPaymentMethodExternalId, @@ -326,6 +337,10 @@ public interface _FinalStage { _FinalStage cancelAt(Long cancelAt); + _FinalStage companyId(Optional companyId); + + _FinalStage companyId(String companyId); + _FinalStage defaultPaymentMethodExternalId(Optional defaultPaymentMethodExternalId); _FinalStage defaultPaymentMethodExternalId(String defaultPaymentMethodExternalId); @@ -424,6 +439,8 @@ public static final class Builder private Optional defaultPaymentMethodExternalId = Optional.empty(); + private Optional companyId = Optional.empty(); + private Optional cancelAt = Optional.empty(); private Optional applicationId = Optional.empty(); @@ -438,6 +455,7 @@ public Builder from(CreateBillingSubscriptionRequestBody other) { applicationId(other.getApplicationId()); cancelAt(other.getCancelAt()); cancelAtPeriodEnd(other.getCancelAtPeriodEnd()); + companyId(other.getCompanyId()); currency(other.getCurrency()); customerExternalId(other.getCustomerExternalId()); defaultPaymentMethodExternalId(other.getDefaultPaymentMethodExternalId()); @@ -679,6 +697,19 @@ public _FinalStage defaultPaymentMethodExternalId(Optional defaultPaymen return this; } + @java.lang.Override + public _FinalStage companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public _FinalStage companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + @java.lang.Override public _FinalStage cancelAt(Long cancelAt) { this.cancelAt = Optional.ofNullable(cancelAt); @@ -711,6 +742,7 @@ public CreateBillingSubscriptionRequestBody build() { applicationId, cancelAt, cancelAtPeriodEnd, + companyId, currency, customerExternalId, defaultPaymentMethodExternalId, diff --git a/src/main/java/com/schematic/api/resources/companies/AsyncCompaniesClient.java b/src/main/java/com/schematic/api/resources/companies/AsyncCompaniesClient.java index 6ec0f94a..9dfbf339 100644 --- a/src/main/java/com/schematic/api/resources/companies/AsyncCompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/AsyncCompaniesClient.java @@ -13,6 +13,8 @@ import com.schematic.api.resources.companies.requests.CreateEntityTraitDefinitionRequestBody; import com.schematic.api.resources.companies.requests.DeleteCompanyRequest; import com.schematic.api.resources.companies.requests.GetActiveCompanySubscriptionRequest; +import com.schematic.api.resources.companies.requests.GetBillingEntityChildSubscriptionsRequest; +import com.schematic.api.resources.companies.requests.GetCompanyBillingEntityRequest; import com.schematic.api.resources.companies.requests.GetEntityTraitValuesRequest; import com.schematic.api.resources.companies.requests.GetOrCreateCompanyMembershipRequestBody; import com.schematic.api.resources.companies.requests.ListCompaniesRequest; @@ -39,6 +41,8 @@ import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; +import com.schematic.api.resources.companies.types.GetBillingEntityChildSubscriptionsResponse; +import com.schematic.api.resources.companies.types.GetCompanyBillingEntityResponse; import com.schematic.api.resources.companies.types.GetCompanyResponse; import com.schematic.api.resources.companies.types.GetEntityTraitDefinitionResponse; import com.schematic.api.resources.companies.types.GetEntityTraitValuesResponse; @@ -198,6 +202,45 @@ public CompletableFuture lookupCompany( return this.rawClient.lookupCompany(request, requestOptions).thenApply(response -> response.body()); } + public CompletableFuture getCompanyBillingEntity() { + return this.rawClient.getCompanyBillingEntity().thenApply(response -> response.body()); + } + + public CompletableFuture getCompanyBillingEntity(RequestOptions requestOptions) { + return this.rawClient.getCompanyBillingEntity(requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture getCompanyBillingEntity( + GetCompanyBillingEntityRequest request) { + return this.rawClient.getCompanyBillingEntity(request).thenApply(response -> response.body()); + } + + public CompletableFuture getCompanyBillingEntity( + GetCompanyBillingEntityRequest request, RequestOptions requestOptions) { + return this.rawClient.getCompanyBillingEntity(request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture getBillingEntityChildSubscriptions() { + return this.rawClient.getBillingEntityChildSubscriptions().thenApply(response -> response.body()); + } + + public CompletableFuture getBillingEntityChildSubscriptions( + RequestOptions requestOptions) { + return this.rawClient.getBillingEntityChildSubscriptions(requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest request) { + return this.rawClient.getBillingEntityChildSubscriptions(request).thenApply(response -> response.body()); + } + + public CompletableFuture getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest request, RequestOptions requestOptions) { + return this.rawClient + .getBillingEntityChildSubscriptions(request, requestOptions) + .thenApply(response -> response.body()); + } + public CompletableFuture listCompanyMemberships() { return this.rawClient.listCompanyMemberships().thenApply(response -> response.body()); } diff --git a/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java b/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java index 84ed57d6..72443aa7 100644 --- a/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java @@ -25,6 +25,8 @@ import com.schematic.api.resources.companies.requests.CreateEntityTraitDefinitionRequestBody; import com.schematic.api.resources.companies.requests.DeleteCompanyRequest; import com.schematic.api.resources.companies.requests.GetActiveCompanySubscriptionRequest; +import com.schematic.api.resources.companies.requests.GetBillingEntityChildSubscriptionsRequest; +import com.schematic.api.resources.companies.requests.GetCompanyBillingEntityRequest; import com.schematic.api.resources.companies.requests.GetEntityTraitValuesRequest; import com.schematic.api.resources.companies.requests.GetOrCreateCompanyMembershipRequestBody; import com.schematic.api.resources.companies.requests.ListCompaniesRequest; @@ -51,6 +53,8 @@ import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; +import com.schematic.api.resources.companies.types.GetBillingEntityChildSubscriptionsResponse; +import com.schematic.api.resources.companies.types.GetCompanyBillingEntityResponse; import com.schematic.api.resources.companies.types.GetCompanyResponse; import com.schematic.api.resources.companies.types.GetEntityTraitDefinitionResponse; import com.schematic.api.resources.companies.types.GetEntityTraitValuesResponse; @@ -1056,6 +1060,210 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + public CompletableFuture> getCompanyBillingEntity() { + return getCompanyBillingEntity(GetCompanyBillingEntityRequest.builder().build()); + } + + public CompletableFuture> getCompanyBillingEntity( + RequestOptions requestOptions) { + return getCompanyBillingEntity(GetCompanyBillingEntityRequest.builder().build(), requestOptions); + } + + public CompletableFuture> getCompanyBillingEntity( + GetCompanyBillingEntityRequest request) { + return getCompanyBillingEntity(request, null); + } + + public CompletableFuture> getCompanyBillingEntity( + GetCompanyBillingEntityRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("company-billing-entity"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new BaseSchematicHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetCompanyBillingEntityResponse.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new BaseSchematicApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> + getBillingEntityChildSubscriptions() { + return getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest.builder().build()); + } + + public CompletableFuture> + getBillingEntityChildSubscriptions(RequestOptions requestOptions) { + return getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest.builder().build(), requestOptions); + } + + public CompletableFuture> + getBillingEntityChildSubscriptions(GetBillingEntityChildSubscriptionsRequest request) { + return getBillingEntityChildSubscriptions(request, null); + } + + public CompletableFuture> + getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("company-billing-entity-subscriptions"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new BaseSchematicHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBillingEntityChildSubscriptionsResponse.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 401: + future.completeExceptionally(new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + case 500: + future.completeExceptionally(new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new BaseSchematicApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new BaseSchematicException("Network error executing HTTP request", e)); + } + }); + return future; + } + public CompletableFuture> listCompanyMemberships() { return listCompanyMemberships(ListCompanyMembershipsRequest.builder().build()); } diff --git a/src/main/java/com/schematic/api/resources/companies/CompaniesClient.java b/src/main/java/com/schematic/api/resources/companies/CompaniesClient.java index 4304ca41..ae907fba 100644 --- a/src/main/java/com/schematic/api/resources/companies/CompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/CompaniesClient.java @@ -13,6 +13,8 @@ import com.schematic.api.resources.companies.requests.CreateEntityTraitDefinitionRequestBody; import com.schematic.api.resources.companies.requests.DeleteCompanyRequest; import com.schematic.api.resources.companies.requests.GetActiveCompanySubscriptionRequest; +import com.schematic.api.resources.companies.requests.GetBillingEntityChildSubscriptionsRequest; +import com.schematic.api.resources.companies.requests.GetCompanyBillingEntityRequest; import com.schematic.api.resources.companies.requests.GetEntityTraitValuesRequest; import com.schematic.api.resources.companies.requests.GetOrCreateCompanyMembershipRequestBody; import com.schematic.api.resources.companies.requests.ListCompaniesRequest; @@ -39,6 +41,8 @@ import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; +import com.schematic.api.resources.companies.types.GetBillingEntityChildSubscriptionsResponse; +import com.schematic.api.resources.companies.types.GetCompanyBillingEntityResponse; import com.schematic.api.resources.companies.types.GetCompanyResponse; import com.schematic.api.resources.companies.types.GetEntityTraitDefinitionResponse; import com.schematic.api.resources.companies.types.GetEntityTraitValuesResponse; @@ -191,6 +195,44 @@ public LookupCompanyResponse lookupCompany(LookupCompanyRequest request, Request return this.rawClient.lookupCompany(request, requestOptions).body(); } + public GetCompanyBillingEntityResponse getCompanyBillingEntity() { + return this.rawClient.getCompanyBillingEntity().body(); + } + + public GetCompanyBillingEntityResponse getCompanyBillingEntity(RequestOptions requestOptions) { + return this.rawClient.getCompanyBillingEntity(requestOptions).body(); + } + + public GetCompanyBillingEntityResponse getCompanyBillingEntity(GetCompanyBillingEntityRequest request) { + return this.rawClient.getCompanyBillingEntity(request).body(); + } + + public GetCompanyBillingEntityResponse getCompanyBillingEntity( + GetCompanyBillingEntityRequest request, RequestOptions requestOptions) { + return this.rawClient.getCompanyBillingEntity(request, requestOptions).body(); + } + + public GetBillingEntityChildSubscriptionsResponse getBillingEntityChildSubscriptions() { + return this.rawClient.getBillingEntityChildSubscriptions().body(); + } + + public GetBillingEntityChildSubscriptionsResponse getBillingEntityChildSubscriptions( + RequestOptions requestOptions) { + return this.rawClient.getBillingEntityChildSubscriptions(requestOptions).body(); + } + + public GetBillingEntityChildSubscriptionsResponse getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest request) { + return this.rawClient.getBillingEntityChildSubscriptions(request).body(); + } + + public GetBillingEntityChildSubscriptionsResponse getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest request, RequestOptions requestOptions) { + return this.rawClient + .getBillingEntityChildSubscriptions(request, requestOptions) + .body(); + } + public ListCompanyMembershipsResponse listCompanyMemberships() { return this.rawClient.listCompanyMemberships().body(); } diff --git a/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java b/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java index b513da13..f6c116b9 100644 --- a/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java @@ -25,6 +25,8 @@ import com.schematic.api.resources.companies.requests.CreateEntityTraitDefinitionRequestBody; import com.schematic.api.resources.companies.requests.DeleteCompanyRequest; import com.schematic.api.resources.companies.requests.GetActiveCompanySubscriptionRequest; +import com.schematic.api.resources.companies.requests.GetBillingEntityChildSubscriptionsRequest; +import com.schematic.api.resources.companies.requests.GetCompanyBillingEntityRequest; import com.schematic.api.resources.companies.requests.GetEntityTraitValuesRequest; import com.schematic.api.resources.companies.requests.GetOrCreateCompanyMembershipRequestBody; import com.schematic.api.resources.companies.requests.ListCompaniesRequest; @@ -51,6 +53,8 @@ import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; +import com.schematic.api.resources.companies.types.GetBillingEntityChildSubscriptionsResponse; +import com.schematic.api.resources.companies.types.GetCompanyBillingEntityResponse; import com.schematic.api.resources.companies.types.GetCompanyResponse; import com.schematic.api.resources.companies.types.GetEntityTraitDefinitionResponse; import com.schematic.api.resources.companies.types.GetEntityTraitValuesResponse; @@ -856,6 +860,159 @@ public BaseSchematicHttpResponse lookupCompany( } } + public BaseSchematicHttpResponse getCompanyBillingEntity() { + return getCompanyBillingEntity(GetCompanyBillingEntityRequest.builder().build()); + } + + public BaseSchematicHttpResponse getCompanyBillingEntity( + RequestOptions requestOptions) { + return getCompanyBillingEntity(GetCompanyBillingEntityRequest.builder().build(), requestOptions); + } + + public BaseSchematicHttpResponse getCompanyBillingEntity( + GetCompanyBillingEntityRequest request) { + return getCompanyBillingEntity(request, null); + } + + public BaseSchematicHttpResponse getCompanyBillingEntity( + GetCompanyBillingEntityRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("company-billing-entity"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new BaseSchematicHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GetCompanyBillingEntityResponse.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new BaseSchematicApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } + + public BaseSchematicHttpResponse getBillingEntityChildSubscriptions() { + return getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest.builder().build()); + } + + public BaseSchematicHttpResponse getBillingEntityChildSubscriptions( + RequestOptions requestOptions) { + return getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest.builder().build(), requestOptions); + } + + public BaseSchematicHttpResponse getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest request) { + return getBillingEntityChildSubscriptions(request, null); + } + + public BaseSchematicHttpResponse getBillingEntityChildSubscriptions( + GetBillingEntityChildSubscriptionsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("company-billing-entity-subscriptions"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new BaseSchematicHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, GetBillingEntityChildSubscriptionsResponse.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 401: + throw new UnauthorizedError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + case 500: + throw new InternalServerError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApiError.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new BaseSchematicApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } + public BaseSchematicHttpResponse listCompanyMemberships() { return listCompanyMemberships(ListCompanyMembershipsRequest.builder().build()); } diff --git a/src/main/java/com/schematic/api/resources/companies/requests/GetBillingEntityChildSubscriptionsRequest.java b/src/main/java/com/schematic/api/resources/companies/requests/GetBillingEntityChildSubscriptionsRequest.java new file mode 100644 index 00000000..d2e186a1 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/requests/GetBillingEntityChildSubscriptionsRequest.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.companies.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBillingEntityChildSubscriptionsRequest.Builder.class) +public final class GetBillingEntityChildSubscriptionsRequest { + private final Optional companyId; + + private final Map additionalProperties; + + private GetBillingEntityChildSubscriptionsRequest( + Optional companyId, Map additionalProperties) { + this.companyId = companyId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBillingEntityChildSubscriptionsRequest + && equalTo((GetBillingEntityChildSubscriptionsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBillingEntityChildSubscriptionsRequest other) { + return companyId.equals(other.companyId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.companyId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional companyId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetBillingEntityChildSubscriptionsRequest other) { + companyId(other.getCompanyId()); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + public GetBillingEntityChildSubscriptionsRequest build() { + return new GetBillingEntityChildSubscriptionsRequest(companyId, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/resources/companies/requests/GetCompanyBillingEntityRequest.java b/src/main/java/com/schematic/api/resources/companies/requests/GetCompanyBillingEntityRequest.java new file mode 100644 index 00000000..2f992129 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/requests/GetCompanyBillingEntityRequest.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.companies.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetCompanyBillingEntityRequest.Builder.class) +public final class GetCompanyBillingEntityRequest { + private final Optional companyId; + + private final Map additionalProperties; + + private GetCompanyBillingEntityRequest(Optional companyId, Map additionalProperties) { + this.companyId = companyId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetCompanyBillingEntityRequest && equalTo((GetCompanyBillingEntityRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetCompanyBillingEntityRequest other) { + return companyId.equals(other.companyId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.companyId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional companyId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetCompanyBillingEntityRequest other) { + companyId(other.getCompanyId()); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + public GetCompanyBillingEntityRequest build() { + return new GetCompanyBillingEntityRequest(companyId, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsParams.java b/src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsParams.java new file mode 100644 index 00000000..c8568aab --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsParams.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.companies.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBillingEntityChildSubscriptionsParams.Builder.class) +public final class GetBillingEntityChildSubscriptionsParams { + private final Optional companyId; + + private final Map additionalProperties; + + private GetBillingEntityChildSubscriptionsParams( + Optional companyId, Map additionalProperties) { + this.companyId = companyId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBillingEntityChildSubscriptionsParams + && equalTo((GetBillingEntityChildSubscriptionsParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBillingEntityChildSubscriptionsParams other) { + return companyId.equals(other.companyId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.companyId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional companyId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetBillingEntityChildSubscriptionsParams other) { + companyId(other.getCompanyId()); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + public GetBillingEntityChildSubscriptionsParams build() { + return new GetBillingEntityChildSubscriptionsParams(companyId, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsResponse.java b/src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsResponse.java new file mode 100644 index 00000000..18b33ec6 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/types/GetBillingEntityChildSubscriptionsResponse.java @@ -0,0 +1,178 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.companies.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.CompanyBillingEntitySubscriptionResponseData; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetBillingEntityChildSubscriptionsResponse.Builder.class) +public final class GetBillingEntityChildSubscriptionsResponse { + private final List data; + + private final GetBillingEntityChildSubscriptionsParams params; + + private final Map additionalProperties; + + private GetBillingEntityChildSubscriptionsResponse( + List data, + GetBillingEntityChildSubscriptionsParams params, + Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + /** + * @return Input parameters + */ + @JsonProperty("params") + public GetBillingEntityChildSubscriptionsParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetBillingEntityChildSubscriptionsResponse + && equalTo((GetBillingEntityChildSubscriptionsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetBillingEntityChildSubscriptionsResponse other) { + return data.equals(other.data) && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.data, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ParamsStage builder() { + return new Builder(); + } + + public interface ParamsStage { + /** + *

Input parameters

+ */ + _FinalStage params(@NotNull GetBillingEntityChildSubscriptionsParams params); + + Builder from(GetBillingEntityChildSubscriptionsResponse other); + } + + public interface _FinalStage { + GetBillingEntityChildSubscriptionsResponse build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(CompanyBillingEntitySubscriptionResponseData data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ParamsStage, _FinalStage { + private GetBillingEntityChildSubscriptionsParams params; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetBillingEntityChildSubscriptionsResponse other) { + data(other.getData()); + params(other.getParams()); + return this; + } + + /** + *

Input parameters

+ *

Input parameters

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull GetBillingEntityChildSubscriptionsParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(CompanyBillingEntitySubscriptionResponseData data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public GetBillingEntityChildSubscriptionsResponse build() { + return new GetBillingEntityChildSubscriptionsResponse(data, params, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityParams.java b/src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityParams.java new file mode 100644 index 00000000..7f0c9700 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityParams.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.companies.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetCompanyBillingEntityParams.Builder.class) +public final class GetCompanyBillingEntityParams { + private final Optional companyId; + + private final Map additionalProperties; + + private GetCompanyBillingEntityParams(Optional companyId, Map additionalProperties) { + this.companyId = companyId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetCompanyBillingEntityParams && equalTo((GetCompanyBillingEntityParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetCompanyBillingEntityParams other) { + return companyId.equals(other.companyId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.companyId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional companyId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GetCompanyBillingEntityParams other) { + companyId(other.getCompanyId()); + return this; + } + + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + public GetCompanyBillingEntityParams build() { + return new GetCompanyBillingEntityParams(companyId, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityResponse.java b/src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityResponse.java new file mode 100644 index 00000000..46e2f5bd --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/types/GetCompanyBillingEntityResponse.java @@ -0,0 +1,177 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.resources.companies.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.CompanyBillingEntityResponseData; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GetCompanyBillingEntityResponse.Builder.class) +public final class GetCompanyBillingEntityResponse { + private final List data; + + private final GetCompanyBillingEntityParams params; + + private final Map additionalProperties; + + private GetCompanyBillingEntityResponse( + List data, + GetCompanyBillingEntityParams params, + Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public List getData() { + return data; + } + + /** + * @return Input parameters + */ + @JsonProperty("params") + public GetCompanyBillingEntityParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetCompanyBillingEntityResponse && equalTo((GetCompanyBillingEntityResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GetCompanyBillingEntityResponse other) { + return data.equals(other.data) && params.equals(other.params); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.data, this.params); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ParamsStage builder() { + return new Builder(); + } + + public interface ParamsStage { + /** + *

Input parameters

+ */ + _FinalStage params(@NotNull GetCompanyBillingEntityParams params); + + Builder from(GetCompanyBillingEntityResponse other); + } + + public interface _FinalStage { + GetCompanyBillingEntityResponse build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage data(List data); + + _FinalStage addData(CompanyBillingEntityResponseData data); + + _FinalStage addAllData(List data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ParamsStage, _FinalStage { + private GetCompanyBillingEntityParams params; + + private List data = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GetCompanyBillingEntityResponse other) { + data(other.getData()); + params(other.getParams()); + return this; + } + + /** + *

Input parameters

+ *

Input parameters

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull GetCompanyBillingEntityParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage addAllData(List data) { + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public _FinalStage addData(CompanyBillingEntityResponseData data) { + this.data.add(data); + return this; + } + + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(List data) { + this.data.clear(); + if (data != null) { + this.data.addAll(data); + } + return this; + } + + @java.lang.Override + public GetCompanyBillingEntityResponse build() { + return new GetCompanyBillingEntityResponse(data, params, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/types/BillingCreditAutoTopupAvailability.java b/src/main/java/com/schematic/api/types/BillingCreditAutoTopupAvailability.java new file mode 100644 index 00000000..afeb3670 --- /dev/null +++ b/src/main/java/com/schematic/api/types/BillingCreditAutoTopupAvailability.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BillingCreditAutoTopupAvailability { + public static final BillingCreditAutoTopupAvailability OFF = + new BillingCreditAutoTopupAvailability(Value.OFF, "off"); + + public static final BillingCreditAutoTopupAvailability AUTOMATIC = + new BillingCreditAutoTopupAvailability(Value.AUTOMATIC, "automatic"); + + public static final BillingCreditAutoTopupAvailability USER_CONTROLLED = + new BillingCreditAutoTopupAvailability(Value.USER_CONTROLLED, "user_controlled"); + + private final Value value; + + private final String string; + + BillingCreditAutoTopupAvailability(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BillingCreditAutoTopupAvailability + && this.string.equals(((BillingCreditAutoTopupAvailability) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OFF: + return visitor.visitOff(); + case AUTOMATIC: + return visitor.visitAutomatic(); + case USER_CONTROLLED: + return visitor.visitUserControlled(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BillingCreditAutoTopupAvailability valueOf(String value) { + switch (value) { + case "off": + return OFF; + case "automatic": + return AUTOMATIC; + case "user_controlled": + return USER_CONTROLLED; + default: + return new BillingCreditAutoTopupAvailability(Value.UNKNOWN, value); + } + } + + public enum Value { + OFF, + + AUTOMATIC, + + USER_CONTROLLED, + + UNKNOWN + } + + public interface Visitor { + T visitOff(); + + T visitAutomatic(); + + T visitUserControlled(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/schematic/api/types/BillingPlanCreditGrantResponseData.java b/src/main/java/com/schematic/api/types/BillingPlanCreditGrantResponseData.java index 8e471b47..ca17cbd2 100644 --- a/src/main/java/com/schematic/api/types/BillingPlanCreditGrantResponseData.java +++ b/src/main/java/com/schematic/api/types/BillingPlanCreditGrantResponseData.java @@ -26,6 +26,8 @@ public final class BillingPlanCreditGrantResponseData { private final Optional autoTopupAmountType; + private final BillingCreditAutoTopupAvailability autoTopupAvailability; + private final boolean autoTopupEnabled; private final Optional autoTopupExpiryType; @@ -40,6 +42,8 @@ public final class BillingPlanCreditGrantResponseData { private final Optional autoTopupThresholdPercent; + private final boolean canBuyBundles; + private final OffsetDateTime createdAt; private final Optional credit; @@ -85,6 +89,7 @@ public final class BillingPlanCreditGrantResponseData { private BillingPlanCreditGrantResponseData( Optional autoTopupAmount, Optional autoTopupAmountType, + BillingCreditAutoTopupAvailability autoTopupAvailability, boolean autoTopupEnabled, Optional autoTopupExpiryType, Optional autoTopupExpiryUnit, @@ -92,6 +97,7 @@ private BillingPlanCreditGrantResponseData( boolean autoTopupSelfService, Optional autoTopupThresholdCredits, Optional autoTopupThresholdPercent, + boolean canBuyBundles, OffsetDateTime createdAt, Optional credit, long creditAmount, @@ -115,6 +121,7 @@ private BillingPlanCreditGrantResponseData( Map additionalProperties) { this.autoTopupAmount = autoTopupAmount; this.autoTopupAmountType = autoTopupAmountType; + this.autoTopupAvailability = autoTopupAvailability; this.autoTopupEnabled = autoTopupEnabled; this.autoTopupExpiryType = autoTopupExpiryType; this.autoTopupExpiryUnit = autoTopupExpiryUnit; @@ -122,6 +129,7 @@ private BillingPlanCreditGrantResponseData( this.autoTopupSelfService = autoTopupSelfService; this.autoTopupThresholdCredits = autoTopupThresholdCredits; this.autoTopupThresholdPercent = autoTopupThresholdPercent; + this.canBuyBundles = canBuyBundles; this.createdAt = createdAt; this.credit = credit; this.creditAmount = creditAmount; @@ -155,6 +163,14 @@ public Optional getAutoTopupAmountType() { return autoTopupAmountType; } + @JsonProperty("auto_topup_availability") + public BillingCreditAutoTopupAvailability getAutoTopupAvailability() { + return autoTopupAvailability; + } + + /** + * @return Derived from auto_topup_availability; use that instead. + */ @JsonProperty("auto_topup_enabled") public boolean getAutoTopupEnabled() { return autoTopupEnabled; @@ -175,6 +191,9 @@ public Optional getAutoTopupExpiryUnitCount() { return autoTopupExpiryUnitCount; } + /** + * @return Derived from auto_topup_availability; use that instead. + */ @JsonProperty("auto_topup_self_service") public boolean getAutoTopupSelfService() { return autoTopupSelfService; @@ -190,6 +209,14 @@ public Optional getAutoTopupThresholdPercent() { return autoTopupThresholdPercent; } + /** + * @return Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability. + */ + @JsonProperty("can_buy_bundles") + public boolean getCanBuyBundles() { + return canBuyBundles; + } + @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; @@ -320,6 +347,7 @@ public Map getAdditionalProperties() { private boolean equalTo(BillingPlanCreditGrantResponseData other) { return autoTopupAmount.equals(other.autoTopupAmount) && autoTopupAmountType.equals(other.autoTopupAmountType) + && autoTopupAvailability.equals(other.autoTopupAvailability) && autoTopupEnabled == other.autoTopupEnabled && autoTopupExpiryType.equals(other.autoTopupExpiryType) && autoTopupExpiryUnit.equals(other.autoTopupExpiryUnit) @@ -327,6 +355,7 @@ private boolean equalTo(BillingPlanCreditGrantResponseData other) { && autoTopupSelfService == other.autoTopupSelfService && autoTopupThresholdCredits.equals(other.autoTopupThresholdCredits) && autoTopupThresholdPercent.equals(other.autoTopupThresholdPercent) + && canBuyBundles == other.canBuyBundles && createdAt.equals(other.createdAt) && credit.equals(other.credit) && creditAmount == other.creditAmount @@ -354,6 +383,7 @@ public int hashCode() { return Objects.hash( this.autoTopupAmount, this.autoTopupAmountType, + this.autoTopupAvailability, this.autoTopupEnabled, this.autoTopupExpiryType, this.autoTopupExpiryUnit, @@ -361,6 +391,7 @@ public int hashCode() { this.autoTopupSelfService, this.autoTopupThresholdCredits, this.autoTopupThresholdPercent, + this.canBuyBundles, this.createdAt, this.credit, this.creditAmount, @@ -388,18 +419,35 @@ public String toString() { return ObjectMappers.stringify(this); } - public static AutoTopupEnabledStage builder() { + public static AutoTopupAvailabilityStage builder() { return new Builder(); } - public interface AutoTopupEnabledStage { - AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled); + public interface AutoTopupAvailabilityStage { + AutoTopupEnabledStage autoTopupAvailability(@NotNull BillingCreditAutoTopupAvailability autoTopupAvailability); Builder from(BillingPlanCreditGrantResponseData other); } + public interface AutoTopupEnabledStage { + /** + *

Derived from auto_topup_availability; use that instead.

+ */ + AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled); + } + public interface AutoTopupSelfServiceStage { - CreatedAtStage autoTopupSelfService(boolean autoTopupSelfService); + /** + *

Derived from auto_topup_availability; use that instead.

+ */ + CanBuyBundlesStage autoTopupSelfService(boolean autoTopupSelfService); + } + + public interface CanBuyBundlesStage { + /** + *

Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability.

+ */ + CreatedAtStage canBuyBundles(boolean canBuyBundles); } public interface CreatedAtStage { @@ -535,8 +583,10 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements AutoTopupEnabledStage, + implements AutoTopupAvailabilityStage, + AutoTopupEnabledStage, AutoTopupSelfServiceStage, + CanBuyBundlesStage, CreatedAtStage, CreditAmountStage, CreditIdStage, @@ -547,10 +597,14 @@ public static final class Builder RolloverPercentageStage, UpdatedAtStage, _FinalStage { + private BillingCreditAutoTopupAvailability autoTopupAvailability; + private boolean autoTopupEnabled; private boolean autoTopupSelfService; + private boolean canBuyBundles; + private OffsetDateTime createdAt; private long creditAmount; @@ -614,6 +668,7 @@ private Builder() {} public Builder from(BillingPlanCreditGrantResponseData other) { autoTopupAmount(other.getAutoTopupAmount()); autoTopupAmountType(other.getAutoTopupAmountType()); + autoTopupAvailability(other.getAutoTopupAvailability()); autoTopupEnabled(other.getAutoTopupEnabled()); autoTopupExpiryType(other.getAutoTopupExpiryType()); autoTopupExpiryUnit(other.getAutoTopupExpiryUnit()); @@ -621,6 +676,7 @@ public Builder from(BillingPlanCreditGrantResponseData other) { autoTopupSelfService(other.getAutoTopupSelfService()); autoTopupThresholdCredits(other.getAutoTopupThresholdCredits()); autoTopupThresholdPercent(other.getAutoTopupThresholdPercent()); + canBuyBundles(other.getCanBuyBundles()); createdAt(other.getCreatedAt()); credit(other.getCredit()); creditAmount(other.getCreditAmount()); @@ -644,6 +700,20 @@ public Builder from(BillingPlanCreditGrantResponseData other) { return this; } + @java.lang.Override + @JsonSetter("auto_topup_availability") + public AutoTopupEnabledStage autoTopupAvailability( + @NotNull BillingCreditAutoTopupAvailability autoTopupAvailability) { + this.autoTopupAvailability = + Objects.requireNonNull(autoTopupAvailability, "autoTopupAvailability must not be null"); + return this; + } + + /** + *

Derived from auto_topup_availability; use that instead.

+ *

Derived from auto_topup_availability; use that instead.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("auto_topup_enabled") public AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled) { @@ -651,13 +721,30 @@ public AutoTopupSelfServiceStage autoTopupEnabled(boolean autoTopupEnabled) { return this; } + /** + *

Derived from auto_topup_availability; use that instead.

+ *

Derived from auto_topup_availability; use that instead.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override @JsonSetter("auto_topup_self_service") - public CreatedAtStage autoTopupSelfService(boolean autoTopupSelfService) { + public CanBuyBundlesStage autoTopupSelfService(boolean autoTopupSelfService) { this.autoTopupSelfService = autoTopupSelfService; return this; } + /** + *

Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability.

+ *

Whether buyers can purchase one-time credit bundles on this grant, independent of auto top-up availability.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("can_buy_bundles") + public CreatedAtStage canBuyBundles(boolean canBuyBundles) { + this.canBuyBundles = canBuyBundles; + return this; + } + @java.lang.Override @JsonSetter("created_at") public CreditAmountStage createdAt(@NotNull OffsetDateTime createdAt) { @@ -989,6 +1076,7 @@ public BillingPlanCreditGrantResponseData build() { return new BillingPlanCreditGrantResponseData( autoTopupAmount, autoTopupAmountType, + autoTopupAvailability, autoTopupEnabled, autoTopupExpiryType, autoTopupExpiryUnit, @@ -996,6 +1084,7 @@ public BillingPlanCreditGrantResponseData build() { autoTopupSelfService, autoTopupThresholdCredits, autoTopupThresholdPercent, + canBuyBundles, createdAt, credit, creditAmount, diff --git a/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java b/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java index 6ef605eb..b8eec751 100644 --- a/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java +++ b/src/main/java/com/schematic/api/types/ChangeSubscriptionInternalRequestBody.java @@ -27,6 +27,8 @@ public final class ChangeSubscriptionInternalRequestBody { private final List autoTopupOverrides; + private final Optional billingEntityId; + private final String companyId; private final Optional couponExternalId; @@ -54,6 +56,7 @@ public final class ChangeSubscriptionInternalRequestBody { private ChangeSubscriptionInternalRequestBody( List addOnIds, List autoTopupOverrides, + Optional billingEntityId, String companyId, Optional couponExternalId, List creditBundles, @@ -68,6 +71,7 @@ private ChangeSubscriptionInternalRequestBody( Map additionalProperties) { this.addOnIds = addOnIds; this.autoTopupOverrides = autoTopupOverrides; + this.billingEntityId = billingEntityId; this.companyId = companyId; this.couponExternalId = couponExternalId; this.creditBundles = creditBundles; @@ -92,6 +96,11 @@ public List getAutoTopupOverrides() { return autoTopupOverrides; } + @JsonProperty("billing_entity_id") + public Optional getBillingEntityId() { + return billingEntityId; + } + @JsonProperty("company_id") public String getCompanyId() { return companyId; @@ -162,6 +171,7 @@ public Map getAdditionalProperties() { private boolean equalTo(ChangeSubscriptionInternalRequestBody other) { return addOnIds.equals(other.addOnIds) && autoTopupOverrides.equals(other.autoTopupOverrides) + && billingEntityId.equals(other.billingEntityId) && companyId.equals(other.companyId) && couponExternalId.equals(other.couponExternalId) && creditBundles.equals(other.creditBundles) @@ -180,6 +190,7 @@ public int hashCode() { return Objects.hash( this.addOnIds, this.autoTopupOverrides, + this.billingEntityId, this.companyId, this.couponExternalId, this.creditBundles, @@ -239,6 +250,10 @@ public interface _FinalStage { _FinalStage addAllAutoTopupOverrides(List autoTopupOverrides); + _FinalStage billingEntityId(Optional billingEntityId); + + _FinalStage billingEntityId(String billingEntityId); + _FinalStage couponExternalId(Optional couponExternalId); _FinalStage couponExternalId(String couponExternalId); @@ -299,6 +314,8 @@ public static final class Builder private Optional couponExternalId = Optional.empty(); + private Optional billingEntityId = Optional.empty(); + private List autoTopupOverrides = new ArrayList<>(); private List addOnIds = new ArrayList<>(); @@ -312,6 +329,7 @@ private Builder() {} public Builder from(ChangeSubscriptionInternalRequestBody other) { addOnIds(other.getAddOnIds()); autoTopupOverrides(other.getAutoTopupOverrides()); + billingEntityId(other.getBillingEntityId()); companyId(other.getCompanyId()); couponExternalId(other.getCouponExternalId()); creditBundles(other.getCreditBundles()); @@ -478,6 +496,19 @@ public _FinalStage couponExternalId(Optional couponExternalId) { return this; } + @java.lang.Override + public _FinalStage billingEntityId(String billingEntityId) { + this.billingEntityId = Optional.ofNullable(billingEntityId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "billing_entity_id", nulls = Nulls.SKIP) + public _FinalStage billingEntityId(Optional billingEntityId) { + this.billingEntityId = billingEntityId; + return this; + } + @java.lang.Override public _FinalStage addAllAutoTopupOverrides(List autoTopupOverrides) { if (autoTopupOverrides != null) { @@ -531,6 +562,7 @@ public ChangeSubscriptionInternalRequestBody build() { return new ChangeSubscriptionInternalRequestBody( addOnIds, autoTopupOverrides, + billingEntityId, companyId, couponExternalId, creditBundles, diff --git a/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java b/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java index 6cc9c729..3c43cd68 100644 --- a/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java +++ b/src/main/java/com/schematic/api/types/ChangeSubscriptionRequestBody.java @@ -27,6 +27,8 @@ public final class ChangeSubscriptionRequestBody { private final List autoTopupOverrides; + private final Optional billingEntityId; + private final Optional couponExternalId; private final List creditBundles; @@ -52,6 +54,7 @@ public final class ChangeSubscriptionRequestBody { private ChangeSubscriptionRequestBody( List addOnIds, List autoTopupOverrides, + Optional billingEntityId, Optional couponExternalId, List creditBundles, List customFieldValues, @@ -65,6 +68,7 @@ private ChangeSubscriptionRequestBody( Map additionalProperties) { this.addOnIds = addOnIds; this.autoTopupOverrides = autoTopupOverrides; + this.billingEntityId = billingEntityId; this.couponExternalId = couponExternalId; this.creditBundles = creditBundles; this.customFieldValues = customFieldValues; @@ -88,6 +92,11 @@ public List getAutoTopupOverrides() { return autoTopupOverrides; } + @JsonProperty("billing_entity_id") + public Optional getBillingEntityId() { + return billingEntityId; + } + @JsonProperty("coupon_external_id") public Optional getCouponExternalId() { return couponExternalId; @@ -152,6 +161,7 @@ public Map getAdditionalProperties() { private boolean equalTo(ChangeSubscriptionRequestBody other) { return addOnIds.equals(other.addOnIds) && autoTopupOverrides.equals(other.autoTopupOverrides) + && billingEntityId.equals(other.billingEntityId) && couponExternalId.equals(other.couponExternalId) && creditBundles.equals(other.creditBundles) && customFieldValues.equals(other.customFieldValues) @@ -169,6 +179,7 @@ public int hashCode() { return Objects.hash( this.addOnIds, this.autoTopupOverrides, + this.billingEntityId, this.couponExternalId, this.creditBundles, this.customFieldValues, @@ -223,6 +234,10 @@ public interface _FinalStage { _FinalStage addAllAutoTopupOverrides(List autoTopupOverrides); + _FinalStage billingEntityId(Optional billingEntityId); + + _FinalStage billingEntityId(String billingEntityId); + _FinalStage couponExternalId(Optional couponExternalId); _FinalStage couponExternalId(String couponExternalId); @@ -280,6 +295,8 @@ public static final class Builder implements NewPlanIdStage, NewPriceIdStage, Sk private Optional couponExternalId = Optional.empty(); + private Optional billingEntityId = Optional.empty(); + private List autoTopupOverrides = new ArrayList<>(); private List addOnIds = new ArrayList<>(); @@ -293,6 +310,7 @@ private Builder() {} public Builder from(ChangeSubscriptionRequestBody other) { addOnIds(other.getAddOnIds()); autoTopupOverrides(other.getAutoTopupOverrides()); + billingEntityId(other.getBillingEntityId()); couponExternalId(other.getCouponExternalId()); creditBundles(other.getCreditBundles()); customFieldValues(other.getCustomFieldValues()); @@ -451,6 +469,19 @@ public _FinalStage couponExternalId(Optional couponExternalId) { return this; } + @java.lang.Override + public _FinalStage billingEntityId(String billingEntityId) { + this.billingEntityId = Optional.ofNullable(billingEntityId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "billing_entity_id", nulls = Nulls.SKIP) + public _FinalStage billingEntityId(Optional billingEntityId) { + this.billingEntityId = billingEntityId; + return this; + } + @java.lang.Override public _FinalStage addAllAutoTopupOverrides(List autoTopupOverrides) { if (autoTopupOverrides != null) { @@ -504,6 +535,7 @@ public ChangeSubscriptionRequestBody build() { return new ChangeSubscriptionRequestBody( addOnIds, autoTopupOverrides, + billingEntityId, couponExternalId, creditBundles, customFieldValues, diff --git a/src/main/java/com/schematic/api/types/CompanyBillingEntityResponseData.java b/src/main/java/com/schematic/api/types/CompanyBillingEntityResponseData.java new file mode 100644 index 00000000..d8e5eb7c --- /dev/null +++ b/src/main/java/com/schematic/api/types/CompanyBillingEntityResponseData.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CompanyBillingEntityResponseData.Builder.class) +public final class CompanyBillingEntityResponseData { + private final Optional billingEntity; + + private final boolean hasOwnStripeCustomer; + + private final Map additionalProperties; + + private CompanyBillingEntityResponseData( + Optional billingEntity, + boolean hasOwnStripeCustomer, + Map additionalProperties) { + this.billingEntity = billingEntity; + this.hasOwnStripeCustomer = hasOwnStripeCustomer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("billing_entity") + public Optional getBillingEntity() { + return billingEntity; + } + + @JsonProperty("has_own_stripe_customer") + public boolean getHasOwnStripeCustomer() { + return hasOwnStripeCustomer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyBillingEntityResponseData && equalTo((CompanyBillingEntityResponseData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompanyBillingEntityResponseData other) { + return billingEntity.equals(other.billingEntity) && hasOwnStripeCustomer == other.hasOwnStripeCustomer; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.billingEntity, this.hasOwnStripeCustomer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasOwnStripeCustomerStage builder() { + return new Builder(); + } + + public interface HasOwnStripeCustomerStage { + _FinalStage hasOwnStripeCustomer(boolean hasOwnStripeCustomer); + + Builder from(CompanyBillingEntityResponseData other); + } + + public interface _FinalStage { + CompanyBillingEntityResponseData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage billingEntity(Optional billingEntity); + + _FinalStage billingEntity(CompanyResponseData billingEntity); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HasOwnStripeCustomerStage, _FinalStage { + private boolean hasOwnStripeCustomer; + + private Optional billingEntity = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CompanyBillingEntityResponseData other) { + billingEntity(other.getBillingEntity()); + hasOwnStripeCustomer(other.getHasOwnStripeCustomer()); + return this; + } + + @java.lang.Override + @JsonSetter("has_own_stripe_customer") + public _FinalStage hasOwnStripeCustomer(boolean hasOwnStripeCustomer) { + this.hasOwnStripeCustomer = hasOwnStripeCustomer; + return this; + } + + @java.lang.Override + public _FinalStage billingEntity(CompanyResponseData billingEntity) { + this.billingEntity = Optional.ofNullable(billingEntity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "billing_entity", nulls = Nulls.SKIP) + public _FinalStage billingEntity(Optional billingEntity) { + this.billingEntity = billingEntity; + return this; + } + + @java.lang.Override + public CompanyBillingEntityResponseData build() { + return new CompanyBillingEntityResponseData(billingEntity, hasOwnStripeCustomer, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/types/CompanyBillingEntitySubscriptionResponseData.java b/src/main/java/com/schematic/api/types/CompanyBillingEntitySubscriptionResponseData.java new file mode 100644 index 00000000..59d2f48e --- /dev/null +++ b/src/main/java/com/schematic/api/types/CompanyBillingEntitySubscriptionResponseData.java @@ -0,0 +1,657 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.schematic.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CompanyBillingEntitySubscriptionResponseData.Builder.class) +public final class CompanyBillingEntitySubscriptionResponseData { + private final Optional cancelAt; + + private final boolean cancelAtPeriodEnd; + + private final Optional company; + + private final String currency; + + private final String customerExternalId; + + private final List discounts; + + private final Optional expiredAt; + + private final String interval; + + private final boolean isInitial; + + private final Optional latestInvoice; + + private final Optional paymentMethod; + + private final String planName; + + private final List products; + + private final BillingProviderType providerType; + + private final String status; + + private final String subscriptionExternalId; + + private final long totalPrice; + + private final Optional trialEnd; + + private final Map additionalProperties; + + private CompanyBillingEntitySubscriptionResponseData( + Optional cancelAt, + boolean cancelAtPeriodEnd, + Optional company, + String currency, + String customerExternalId, + List discounts, + Optional expiredAt, + String interval, + boolean isInitial, + Optional latestInvoice, + Optional paymentMethod, + String planName, + List products, + BillingProviderType providerType, + String status, + String subscriptionExternalId, + long totalPrice, + Optional trialEnd, + Map additionalProperties) { + this.cancelAt = cancelAt; + this.cancelAtPeriodEnd = cancelAtPeriodEnd; + this.company = company; + this.currency = currency; + this.customerExternalId = customerExternalId; + this.discounts = discounts; + this.expiredAt = expiredAt; + this.interval = interval; + this.isInitial = isInitial; + this.latestInvoice = latestInvoice; + this.paymentMethod = paymentMethod; + this.planName = planName; + this.products = products; + this.providerType = providerType; + this.status = status; + this.subscriptionExternalId = subscriptionExternalId; + this.totalPrice = totalPrice; + this.trialEnd = trialEnd; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("cancel_at") + public Optional getCancelAt() { + return cancelAt; + } + + @JsonProperty("cancel_at_period_end") + public boolean getCancelAtPeriodEnd() { + return cancelAtPeriodEnd; + } + + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("currency") + public String getCurrency() { + return currency; + } + + @JsonProperty("customer_external_id") + public String getCustomerExternalId() { + return customerExternalId; + } + + @JsonProperty("discounts") + public List getDiscounts() { + return discounts; + } + + @JsonProperty("expired_at") + public Optional getExpiredAt() { + return expiredAt; + } + + @JsonProperty("interval") + public String getInterval() { + return interval; + } + + @JsonProperty("is_initial") + public boolean getIsInitial() { + return isInitial; + } + + @JsonProperty("latest_invoice") + public Optional getLatestInvoice() { + return latestInvoice; + } + + @JsonProperty("payment_method") + public Optional getPaymentMethod() { + return paymentMethod; + } + + @JsonProperty("plan_name") + public String getPlanName() { + return planName; + } + + @JsonProperty("products") + public List getProducts() { + return products; + } + + @JsonProperty("provider_type") + public BillingProviderType getProviderType() { + return providerType; + } + + @JsonProperty("status") + public String getStatus() { + return status; + } + + @JsonProperty("subscription_external_id") + public String getSubscriptionExternalId() { + return subscriptionExternalId; + } + + @JsonProperty("total_price") + public long getTotalPrice() { + return totalPrice; + } + + @JsonProperty("trial_end") + public Optional getTrialEnd() { + return trialEnd; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyBillingEntitySubscriptionResponseData + && equalTo((CompanyBillingEntitySubscriptionResponseData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompanyBillingEntitySubscriptionResponseData other) { + return cancelAt.equals(other.cancelAt) + && cancelAtPeriodEnd == other.cancelAtPeriodEnd + && company.equals(other.company) + && currency.equals(other.currency) + && customerExternalId.equals(other.customerExternalId) + && discounts.equals(other.discounts) + && expiredAt.equals(other.expiredAt) + && interval.equals(other.interval) + && isInitial == other.isInitial + && latestInvoice.equals(other.latestInvoice) + && paymentMethod.equals(other.paymentMethod) + && planName.equals(other.planName) + && products.equals(other.products) + && providerType.equals(other.providerType) + && status.equals(other.status) + && subscriptionExternalId.equals(other.subscriptionExternalId) + && totalPrice == other.totalPrice + && trialEnd.equals(other.trialEnd); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cancelAt, + this.cancelAtPeriodEnd, + this.company, + this.currency, + this.customerExternalId, + this.discounts, + this.expiredAt, + this.interval, + this.isInitial, + this.latestInvoice, + this.paymentMethod, + this.planName, + this.products, + this.providerType, + this.status, + this.subscriptionExternalId, + this.totalPrice, + this.trialEnd); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CancelAtPeriodEndStage builder() { + return new Builder(); + } + + public interface CancelAtPeriodEndStage { + CurrencyStage cancelAtPeriodEnd(boolean cancelAtPeriodEnd); + + Builder from(CompanyBillingEntitySubscriptionResponseData other); + } + + public interface CurrencyStage { + CustomerExternalIdStage currency(@NotNull String currency); + } + + public interface CustomerExternalIdStage { + IntervalStage customerExternalId(@NotNull String customerExternalId); + } + + public interface IntervalStage { + IsInitialStage interval(@NotNull String interval); + } + + public interface IsInitialStage { + PlanNameStage isInitial(boolean isInitial); + } + + public interface PlanNameStage { + ProviderTypeStage planName(@NotNull String planName); + } + + public interface ProviderTypeStage { + StatusStage providerType(@NotNull BillingProviderType providerType); + } + + public interface StatusStage { + SubscriptionExternalIdStage status(@NotNull String status); + } + + public interface SubscriptionExternalIdStage { + TotalPriceStage subscriptionExternalId(@NotNull String subscriptionExternalId); + } + + public interface TotalPriceStage { + _FinalStage totalPrice(long totalPrice); + } + + public interface _FinalStage { + CompanyBillingEntitySubscriptionResponseData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage cancelAt(Optional cancelAt); + + _FinalStage cancelAt(OffsetDateTime cancelAt); + + _FinalStage company(Optional company); + + _FinalStage company(CompanyResponseData company); + + _FinalStage discounts(List discounts); + + _FinalStage addDiscounts(BillingSubscriptionDiscountView discounts); + + _FinalStage addAllDiscounts(List discounts); + + _FinalStage expiredAt(Optional expiredAt); + + _FinalStage expiredAt(OffsetDateTime expiredAt); + + _FinalStage latestInvoice(Optional latestInvoice); + + _FinalStage latestInvoice(InvoiceResponseData latestInvoice); + + _FinalStage paymentMethod(Optional paymentMethod); + + _FinalStage paymentMethod(PaymentMethodResponseData paymentMethod); + + _FinalStage products(List products); + + _FinalStage addProducts(BillingProductForSubscriptionResponseData products); + + _FinalStage addAllProducts(List products); + + _FinalStage trialEnd(Optional trialEnd); + + _FinalStage trialEnd(OffsetDateTime trialEnd); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CancelAtPeriodEndStage, + CurrencyStage, + CustomerExternalIdStage, + IntervalStage, + IsInitialStage, + PlanNameStage, + ProviderTypeStage, + StatusStage, + SubscriptionExternalIdStage, + TotalPriceStage, + _FinalStage { + private boolean cancelAtPeriodEnd; + + private String currency; + + private String customerExternalId; + + private String interval; + + private boolean isInitial; + + private String planName; + + private BillingProviderType providerType; + + private String status; + + private String subscriptionExternalId; + + private long totalPrice; + + private Optional trialEnd = Optional.empty(); + + private List products = new ArrayList<>(); + + private Optional paymentMethod = Optional.empty(); + + private Optional latestInvoice = Optional.empty(); + + private Optional expiredAt = Optional.empty(); + + private List discounts = new ArrayList<>(); + + private Optional company = Optional.empty(); + + private Optional cancelAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CompanyBillingEntitySubscriptionResponseData other) { + cancelAt(other.getCancelAt()); + cancelAtPeriodEnd(other.getCancelAtPeriodEnd()); + company(other.getCompany()); + currency(other.getCurrency()); + customerExternalId(other.getCustomerExternalId()); + discounts(other.getDiscounts()); + expiredAt(other.getExpiredAt()); + interval(other.getInterval()); + isInitial(other.getIsInitial()); + latestInvoice(other.getLatestInvoice()); + paymentMethod(other.getPaymentMethod()); + planName(other.getPlanName()); + products(other.getProducts()); + providerType(other.getProviderType()); + status(other.getStatus()); + subscriptionExternalId(other.getSubscriptionExternalId()); + totalPrice(other.getTotalPrice()); + trialEnd(other.getTrialEnd()); + return this; + } + + @java.lang.Override + @JsonSetter("cancel_at_period_end") + public CurrencyStage cancelAtPeriodEnd(boolean cancelAtPeriodEnd) { + this.cancelAtPeriodEnd = cancelAtPeriodEnd; + return this; + } + + @java.lang.Override + @JsonSetter("currency") + public CustomerExternalIdStage currency(@NotNull String currency) { + this.currency = Objects.requireNonNull(currency, "currency must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("customer_external_id") + public IntervalStage customerExternalId(@NotNull String customerExternalId) { + this.customerExternalId = Objects.requireNonNull(customerExternalId, "customerExternalId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("interval") + public IsInitialStage interval(@NotNull String interval) { + this.interval = Objects.requireNonNull(interval, "interval must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("is_initial") + public PlanNameStage isInitial(boolean isInitial) { + this.isInitial = isInitial; + return this; + } + + @java.lang.Override + @JsonSetter("plan_name") + public ProviderTypeStage planName(@NotNull String planName) { + this.planName = Objects.requireNonNull(planName, "planName must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("provider_type") + public StatusStage providerType(@NotNull BillingProviderType providerType) { + this.providerType = Objects.requireNonNull(providerType, "providerType must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("status") + public SubscriptionExternalIdStage status(@NotNull String status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("subscription_external_id") + public TotalPriceStage subscriptionExternalId(@NotNull String subscriptionExternalId) { + this.subscriptionExternalId = + Objects.requireNonNull(subscriptionExternalId, "subscriptionExternalId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("total_price") + public _FinalStage totalPrice(long totalPrice) { + this.totalPrice = totalPrice; + return this; + } + + @java.lang.Override + public _FinalStage trialEnd(OffsetDateTime trialEnd) { + this.trialEnd = Optional.ofNullable(trialEnd); + return this; + } + + @java.lang.Override + @JsonSetter(value = "trial_end", nulls = Nulls.SKIP) + public _FinalStage trialEnd(Optional trialEnd) { + this.trialEnd = trialEnd; + return this; + } + + @java.lang.Override + public _FinalStage addAllProducts(List products) { + if (products != null) { + this.products.addAll(products); + } + return this; + } + + @java.lang.Override + public _FinalStage addProducts(BillingProductForSubscriptionResponseData products) { + this.products.add(products); + return this; + } + + @java.lang.Override + @JsonSetter(value = "products", nulls = Nulls.SKIP) + public _FinalStage products(List products) { + this.products.clear(); + if (products != null) { + this.products.addAll(products); + } + return this; + } + + @java.lang.Override + public _FinalStage paymentMethod(PaymentMethodResponseData paymentMethod) { + this.paymentMethod = Optional.ofNullable(paymentMethod); + return this; + } + + @java.lang.Override + @JsonSetter(value = "payment_method", nulls = Nulls.SKIP) + public _FinalStage paymentMethod(Optional paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + @java.lang.Override + public _FinalStage latestInvoice(InvoiceResponseData latestInvoice) { + this.latestInvoice = Optional.ofNullable(latestInvoice); + return this; + } + + @java.lang.Override + @JsonSetter(value = "latest_invoice", nulls = Nulls.SKIP) + public _FinalStage latestInvoice(Optional latestInvoice) { + this.latestInvoice = latestInvoice; + return this; + } + + @java.lang.Override + public _FinalStage expiredAt(OffsetDateTime expiredAt) { + this.expiredAt = Optional.ofNullable(expiredAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "expired_at", nulls = Nulls.SKIP) + public _FinalStage expiredAt(Optional expiredAt) { + this.expiredAt = expiredAt; + return this; + } + + @java.lang.Override + public _FinalStage addAllDiscounts(List discounts) { + if (discounts != null) { + this.discounts.addAll(discounts); + } + return this; + } + + @java.lang.Override + public _FinalStage addDiscounts(BillingSubscriptionDiscountView discounts) { + this.discounts.add(discounts); + return this; + } + + @java.lang.Override + @JsonSetter(value = "discounts", nulls = Nulls.SKIP) + public _FinalStage discounts(List discounts) { + this.discounts.clear(); + if (discounts != null) { + this.discounts.addAll(discounts); + } + return this; + } + + @java.lang.Override + public _FinalStage company(CompanyResponseData company) { + this.company = Optional.ofNullable(company); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public _FinalStage company(Optional company) { + this.company = company; + return this; + } + + @java.lang.Override + public _FinalStage cancelAt(OffsetDateTime cancelAt) { + this.cancelAt = Optional.ofNullable(cancelAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "cancel_at", nulls = Nulls.SKIP) + public _FinalStage cancelAt(Optional cancelAt) { + this.cancelAt = cancelAt; + return this; + } + + @java.lang.Override + public CompanyBillingEntitySubscriptionResponseData build() { + return new CompanyBillingEntitySubscriptionResponseData( + cancelAt, + cancelAtPeriodEnd, + company, + currency, + customerExternalId, + discounts, + expiredAt, + interval, + isInitial, + latestInvoice, + paymentMethod, + planName, + products, + providerType, + status, + subscriptionExternalId, + totalPrice, + trialEnd, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java b/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java index 5324b63d..6ccf3a6b 100644 --- a/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java +++ b/src/main/java/com/schematic/api/types/CompanyPlanCreditGrantView.java @@ -26,6 +26,8 @@ public final class CompanyPlanCreditGrantView { private final Optional billingCreditAutoTopupAmountType; + private final Optional billingCreditAutoTopupAvailability; + private final boolean billingCreditAutoTopupEnabled; private final Optional billingCreditAutoTopupExpiryType; @@ -40,6 +42,8 @@ public final class CompanyPlanCreditGrantView { private final Optional billingCreditAutoTopupThresholdPercent; + private final boolean billingCreditCanBuyBundles; + private final Optional companyAutoTopupAmount; private final Optional companyAutoTopupEnabled; @@ -93,6 +97,7 @@ public final class CompanyPlanCreditGrantView { private CompanyPlanCreditGrantView( Optional billingCreditAutoTopupAmount, Optional billingCreditAutoTopupAmountType, + Optional billingCreditAutoTopupAvailability, boolean billingCreditAutoTopupEnabled, Optional billingCreditAutoTopupExpiryType, Optional billingCreditAutoTopupExpiryUnit, @@ -100,6 +105,7 @@ private CompanyPlanCreditGrantView( boolean billingCreditAutoTopupSelfService, Optional billingCreditAutoTopupThresholdCredits, Optional billingCreditAutoTopupThresholdPercent, + boolean billingCreditCanBuyBundles, Optional companyAutoTopupAmount, Optional companyAutoTopupEnabled, Optional companyAutoTopupThresholdCredits, @@ -127,6 +133,7 @@ private CompanyPlanCreditGrantView( Map additionalProperties) { this.billingCreditAutoTopupAmount = billingCreditAutoTopupAmount; this.billingCreditAutoTopupAmountType = billingCreditAutoTopupAmountType; + this.billingCreditAutoTopupAvailability = billingCreditAutoTopupAvailability; this.billingCreditAutoTopupEnabled = billingCreditAutoTopupEnabled; this.billingCreditAutoTopupExpiryType = billingCreditAutoTopupExpiryType; this.billingCreditAutoTopupExpiryUnit = billingCreditAutoTopupExpiryUnit; @@ -134,6 +141,7 @@ private CompanyPlanCreditGrantView( this.billingCreditAutoTopupSelfService = billingCreditAutoTopupSelfService; this.billingCreditAutoTopupThresholdCredits = billingCreditAutoTopupThresholdCredits; this.billingCreditAutoTopupThresholdPercent = billingCreditAutoTopupThresholdPercent; + this.billingCreditCanBuyBundles = billingCreditCanBuyBundles; this.companyAutoTopupAmount = companyAutoTopupAmount; this.companyAutoTopupEnabled = companyAutoTopupEnabled; this.companyAutoTopupThresholdCredits = companyAutoTopupThresholdCredits; @@ -171,6 +179,11 @@ public Optional getBillingCreditAutoTopupAmountType() { return billingCreditAutoTopupAmountType; } + @JsonProperty("billing_credit_auto_topup_availability") + public Optional getBillingCreditAutoTopupAvailability() { + return billingCreditAutoTopupAvailability; + } + @JsonProperty("billing_credit_auto_topup_enabled") public boolean getBillingCreditAutoTopupEnabled() { return billingCreditAutoTopupEnabled; @@ -206,6 +219,11 @@ public Optional getBillingCreditAutoTopupThresholdPercent() { return billingCreditAutoTopupThresholdPercent; } + @JsonProperty("billing_credit_can_buy_bundles") + public boolean getBillingCreditCanBuyBundles() { + return billingCreditCanBuyBundles; + } + @JsonProperty("company_auto_topup_amount") public Optional getCompanyAutoTopupAmount() { return companyAutoTopupAmount; @@ -355,6 +373,7 @@ public Map getAdditionalProperties() { private boolean equalTo(CompanyPlanCreditGrantView other) { return billingCreditAutoTopupAmount.equals(other.billingCreditAutoTopupAmount) && billingCreditAutoTopupAmountType.equals(other.billingCreditAutoTopupAmountType) + && billingCreditAutoTopupAvailability.equals(other.billingCreditAutoTopupAvailability) && billingCreditAutoTopupEnabled == other.billingCreditAutoTopupEnabled && billingCreditAutoTopupExpiryType.equals(other.billingCreditAutoTopupExpiryType) && billingCreditAutoTopupExpiryUnit.equals(other.billingCreditAutoTopupExpiryUnit) @@ -362,6 +381,7 @@ private boolean equalTo(CompanyPlanCreditGrantView other) { && billingCreditAutoTopupSelfService == other.billingCreditAutoTopupSelfService && billingCreditAutoTopupThresholdCredits.equals(other.billingCreditAutoTopupThresholdCredits) && billingCreditAutoTopupThresholdPercent.equals(other.billingCreditAutoTopupThresholdPercent) + && billingCreditCanBuyBundles == other.billingCreditCanBuyBundles && companyAutoTopupAmount.equals(other.companyAutoTopupAmount) && companyAutoTopupEnabled.equals(other.companyAutoTopupEnabled) && companyAutoTopupThresholdCredits.equals(other.companyAutoTopupThresholdCredits) @@ -393,6 +413,7 @@ public int hashCode() { return Objects.hash( this.billingCreditAutoTopupAmount, this.billingCreditAutoTopupAmountType, + this.billingCreditAutoTopupAvailability, this.billingCreditAutoTopupEnabled, this.billingCreditAutoTopupExpiryType, this.billingCreditAutoTopupExpiryUnit, @@ -400,6 +421,7 @@ public int hashCode() { this.billingCreditAutoTopupSelfService, this.billingCreditAutoTopupThresholdCredits, this.billingCreditAutoTopupThresholdPercent, + this.billingCreditCanBuyBundles, this.companyAutoTopupAmount, this.companyAutoTopupEnabled, this.companyAutoTopupThresholdCredits, @@ -442,7 +464,11 @@ public interface BillingCreditAutoTopupEnabledStage { } public interface BillingCreditAutoTopupSelfServiceStage { - CreatedAtStage billingCreditAutoTopupSelfService(boolean billingCreditAutoTopupSelfService); + BillingCreditCanBuyBundlesStage billingCreditAutoTopupSelfService(boolean billingCreditAutoTopupSelfService); + } + + public interface BillingCreditCanBuyBundlesStage { + CreatedAtStage billingCreditCanBuyBundles(boolean billingCreditCanBuyBundles); } public interface CreatedAtStage { @@ -506,6 +532,12 @@ public interface _FinalStage { _FinalStage billingCreditAutoTopupAmountType(String billingCreditAutoTopupAmountType); + _FinalStage billingCreditAutoTopupAvailability( + Optional billingCreditAutoTopupAvailability); + + _FinalStage billingCreditAutoTopupAvailability( + BillingCreditAutoTopupAvailability billingCreditAutoTopupAvailability); + _FinalStage billingCreditAutoTopupExpiryType( Optional billingCreditAutoTopupExpiryType); @@ -598,6 +630,7 @@ _FinalStage billingCreditAutoTopupExpiryUnit( public static final class Builder implements BillingCreditAutoTopupEnabledStage, BillingCreditAutoTopupSelfServiceStage, + BillingCreditCanBuyBundlesStage, CreatedAtStage, CreditAmountStage, CreditDescriptionStage, @@ -613,6 +646,8 @@ public static final class Builder private boolean billingCreditAutoTopupSelfService; + private boolean billingCreditCanBuyBundles; + private OffsetDateTime createdAt; private long creditAmount; @@ -671,6 +706,8 @@ public static final class Builder private Optional billingCreditAutoTopupExpiryType = Optional.empty(); + private Optional billingCreditAutoTopupAvailability = Optional.empty(); + private Optional billingCreditAutoTopupAmountType = Optional.empty(); private Optional billingCreditAutoTopupAmount = Optional.empty(); @@ -684,6 +721,7 @@ private Builder() {} public Builder from(CompanyPlanCreditGrantView other) { billingCreditAutoTopupAmount(other.getBillingCreditAutoTopupAmount()); billingCreditAutoTopupAmountType(other.getBillingCreditAutoTopupAmountType()); + billingCreditAutoTopupAvailability(other.getBillingCreditAutoTopupAvailability()); billingCreditAutoTopupEnabled(other.getBillingCreditAutoTopupEnabled()); billingCreditAutoTopupExpiryType(other.getBillingCreditAutoTopupExpiryType()); billingCreditAutoTopupExpiryUnit(other.getBillingCreditAutoTopupExpiryUnit()); @@ -691,6 +729,7 @@ public Builder from(CompanyPlanCreditGrantView other) { billingCreditAutoTopupSelfService(other.getBillingCreditAutoTopupSelfService()); billingCreditAutoTopupThresholdCredits(other.getBillingCreditAutoTopupThresholdCredits()); billingCreditAutoTopupThresholdPercent(other.getBillingCreditAutoTopupThresholdPercent()); + billingCreditCanBuyBundles(other.getBillingCreditCanBuyBundles()); companyAutoTopupAmount(other.getCompanyAutoTopupAmount()); companyAutoTopupEnabled(other.getCompanyAutoTopupEnabled()); companyAutoTopupThresholdCredits(other.getCompanyAutoTopupThresholdCredits()); @@ -728,11 +767,19 @@ public BillingCreditAutoTopupSelfServiceStage billingCreditAutoTopupEnabled( @java.lang.Override @JsonSetter("billing_credit_auto_topup_self_service") - public CreatedAtStage billingCreditAutoTopupSelfService(boolean billingCreditAutoTopupSelfService) { + public BillingCreditCanBuyBundlesStage billingCreditAutoTopupSelfService( + boolean billingCreditAutoTopupSelfService) { this.billingCreditAutoTopupSelfService = billingCreditAutoTopupSelfService; return this; } + @java.lang.Override + @JsonSetter("billing_credit_can_buy_bundles") + public CreatedAtStage billingCreditCanBuyBundles(boolean billingCreditCanBuyBundles) { + this.billingCreditCanBuyBundles = billingCreditCanBuyBundles; + return this; + } + @java.lang.Override @JsonSetter("created_at") public CreditAmountStage createdAt(@NotNull OffsetDateTime createdAt) { @@ -1085,6 +1132,21 @@ public _FinalStage billingCreditAutoTopupExpiryType( return this; } + @java.lang.Override + public _FinalStage billingCreditAutoTopupAvailability( + BillingCreditAutoTopupAvailability billingCreditAutoTopupAvailability) { + this.billingCreditAutoTopupAvailability = Optional.ofNullable(billingCreditAutoTopupAvailability); + return this; + } + + @java.lang.Override + @JsonSetter(value = "billing_credit_auto_topup_availability", nulls = Nulls.SKIP) + public _FinalStage billingCreditAutoTopupAvailability( + Optional billingCreditAutoTopupAvailability) { + this.billingCreditAutoTopupAvailability = billingCreditAutoTopupAvailability; + return this; + } + @java.lang.Override public _FinalStage billingCreditAutoTopupAmountType(String billingCreditAutoTopupAmountType) { this.billingCreditAutoTopupAmountType = Optional.ofNullable(billingCreditAutoTopupAmountType); @@ -1116,6 +1178,7 @@ public CompanyPlanCreditGrantView build() { return new CompanyPlanCreditGrantView( billingCreditAutoTopupAmount, billingCreditAutoTopupAmountType, + billingCreditAutoTopupAvailability, billingCreditAutoTopupEnabled, billingCreditAutoTopupExpiryType, billingCreditAutoTopupExpiryUnit, @@ -1123,6 +1186,7 @@ public CompanyPlanCreditGrantView build() { billingCreditAutoTopupSelfService, billingCreditAutoTopupThresholdCredits, billingCreditAutoTopupThresholdPercent, + billingCreditCanBuyBundles, companyAutoTopupAmount, companyAutoTopupEnabled, companyAutoTopupThresholdCredits, diff --git a/src/main/java/com/schematic/api/types/CompanyPlanDetailResponseData.java b/src/main/java/com/schematic/api/types/CompanyPlanDetailResponseData.java index 852d06b0..f99fca34 100644 --- a/src/main/java/com/schematic/api/types/CompanyPlanDetailResponseData.java +++ b/src/main/java/com/schematic/api/types/CompanyPlanDetailResponseData.java @@ -44,6 +44,8 @@ public final class CompanyPlanDetailResponseData { private final Optional companyId; + private final Optional companyLogoUrl; + private final Optional companyName; private final List compatiblePlanIds; @@ -54,6 +56,8 @@ public final class CompanyPlanDetailResponseData { private final OffsetDateTime createdAt; + private final List credits; + private final List currencyPrices; private final boolean current; @@ -121,11 +125,13 @@ private CompanyPlanDetailResponseData( boolean companyCanTrial, long companyCount, Optional companyId, + Optional companyLogoUrl, Optional companyName, List compatiblePlanIds, BillingProviderType controlledBy, Optional copiedFromPlanId, OffsetDateTime createdAt, + List credits, List currencyPrices, boolean current, boolean custom, @@ -164,11 +170,13 @@ private CompanyPlanDetailResponseData( this.companyCanTrial = companyCanTrial; this.companyCount = companyCount; this.companyId = companyId; + this.companyLogoUrl = companyLogoUrl; this.companyName = companyName; this.compatiblePlanIds = compatiblePlanIds; this.controlledBy = controlledBy; this.copiedFromPlanId = copiedFromPlanId; this.createdAt = createdAt; + this.credits = credits; this.currencyPrices = currencyPrices; this.current = current; this.custom = custom; @@ -249,6 +257,11 @@ public Optional getCompanyId() { return companyId; } + @JsonProperty("company_logo_url") + public Optional getCompanyLogoUrl() { + return companyLogoUrl; + } + @JsonProperty("company_name") public Optional getCompanyName() { return companyName; @@ -274,6 +287,11 @@ public OffsetDateTime getCreatedAt() { return createdAt; } + @JsonProperty("credits") + public List getCredits() { + return credits; + } + @JsonProperty("currency_prices") public List getCurrencyPrices() { return currencyPrices; @@ -434,11 +452,13 @@ private boolean equalTo(CompanyPlanDetailResponseData other) { && companyCanTrial == other.companyCanTrial && companyCount == other.companyCount && companyId.equals(other.companyId) + && companyLogoUrl.equals(other.companyLogoUrl) && companyName.equals(other.companyName) && compatiblePlanIds.equals(other.compatiblePlanIds) && controlledBy.equals(other.controlledBy) && copiedFromPlanId.equals(other.copiedFromPlanId) && createdAt.equals(other.createdAt) + && credits.equals(other.credits) && currencyPrices.equals(other.currencyPrices) && current == other.current && custom == other.custom @@ -481,11 +501,13 @@ public int hashCode() { this.companyCanTrial, this.companyCount, this.companyId, + this.companyLogoUrl, this.companyName, this.compatiblePlanIds, this.controlledBy, this.copiedFromPlanId, this.createdAt, + this.credits, this.currencyPrices, this.current, this.custom, @@ -638,6 +660,10 @@ public interface _FinalStage { _FinalStage companyId(String companyId); + _FinalStage companyLogoUrl(Optional companyLogoUrl); + + _FinalStage companyLogoUrl(String companyLogoUrl); + _FinalStage companyName(Optional companyName); _FinalStage companyName(String companyName); @@ -652,6 +678,12 @@ public interface _FinalStage { _FinalStage copiedFromPlanId(String copiedFromPlanId); + _FinalStage credits(List credits); + + _FinalStage addCredits(BillingCreditResponseData credits); + + _FinalStage addAllCredits(List credits); + _FinalStage currencyPrices(List currencyPrices); _FinalStage addCurrencyPrices(PlanCurrencyPricesResponseData currencyPrices); @@ -807,12 +839,16 @@ public static final class Builder private List currencyPrices = new ArrayList<>(); + private List credits = new ArrayList<>(); + private Optional copiedFromPlanId = Optional.empty(); private List compatiblePlanIds = new ArrayList<>(); private Optional companyName = Optional.empty(); + private Optional companyLogoUrl = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional billingProduct = Optional.empty(); @@ -842,11 +878,13 @@ public Builder from(CompanyPlanDetailResponseData other) { companyCanTrial(other.getCompanyCanTrial()); companyCount(other.getCompanyCount()); companyId(other.getCompanyId()); + companyLogoUrl(other.getCompanyLogoUrl()); companyName(other.getCompanyName()); compatiblePlanIds(other.getCompatiblePlanIds()); controlledBy(other.getControlledBy()); copiedFromPlanId(other.getCopiedFromPlanId()); createdAt(other.getCreatedAt()); + credits(other.getCredits()); currencyPrices(other.getCurrencyPrices()); current(other.getCurrent()); custom(other.getCustom()); @@ -1252,6 +1290,30 @@ public _FinalStage currencyPrices(List currencyP return this; } + @java.lang.Override + public _FinalStage addAllCredits(List credits) { + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + + @java.lang.Override + public _FinalStage addCredits(BillingCreditResponseData credits) { + this.credits.add(credits); + return this; + } + + @java.lang.Override + @JsonSetter(value = "credits", nulls = Nulls.SKIP) + public _FinalStage credits(List credits) { + this.credits.clear(); + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + @java.lang.Override public _FinalStage copiedFromPlanId(String copiedFromPlanId) { this.copiedFromPlanId = Optional.ofNullable(copiedFromPlanId); @@ -1302,6 +1364,19 @@ public _FinalStage companyName(Optional companyName) { return this; } + @java.lang.Override + public _FinalStage companyLogoUrl(String companyLogoUrl) { + this.companyLogoUrl = Optional.ofNullable(companyLogoUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company_logo_url", nulls = Nulls.SKIP) + public _FinalStage companyLogoUrl(Optional companyLogoUrl) { + this.companyLogoUrl = companyLogoUrl; + return this; + } + @java.lang.Override public _FinalStage companyId(String companyId) { this.companyId = Optional.ofNullable(companyId); @@ -1404,11 +1479,13 @@ public CompanyPlanDetailResponseData build() { companyCanTrial, companyCount, companyId, + companyLogoUrl, companyName, compatiblePlanIds, controlledBy, copiedFromPlanId, createdAt, + credits, currencyPrices, current, custom, diff --git a/src/main/java/com/schematic/api/types/CreateBillingPlanCreditGrantRequestBody.java b/src/main/java/com/schematic/api/types/CreateBillingPlanCreditGrantRequestBody.java index c336298e..b191b0e6 100644 --- a/src/main/java/com/schematic/api/types/CreateBillingPlanCreditGrantRequestBody.java +++ b/src/main/java/com/schematic/api/types/CreateBillingPlanCreditGrantRequestBody.java @@ -27,6 +27,8 @@ public final class CreateBillingPlanCreditGrantRequestBody { private final Optional autoTopupAmountType; + private final Optional autoTopupAvailability; + private final Optional autoTopupEnabled; private final Optional autoTopupExpiryType; @@ -41,6 +43,8 @@ public final class CreateBillingPlanCreditGrantRequestBody { private final Optional autoTopupThresholdPercent; + private final Optional canBuyBundles; + private final long creditAmount; private final String creditId; @@ -69,6 +73,7 @@ private CreateBillingPlanCreditGrantRequestBody( Optional applyToExisting, Optional autoTopupAmount, Optional autoTopupAmountType, + Optional autoTopupAvailability, Optional autoTopupEnabled, Optional autoTopupExpiryType, Optional autoTopupExpiryUnit, @@ -76,6 +81,7 @@ private CreateBillingPlanCreditGrantRequestBody( Optional autoTopupSelfService, Optional autoTopupThresholdCredits, Optional autoTopupThresholdPercent, + Optional canBuyBundles, long creditAmount, String creditId, Optional expiryType, @@ -91,6 +97,7 @@ private CreateBillingPlanCreditGrantRequestBody( this.applyToExisting = applyToExisting; this.autoTopupAmount = autoTopupAmount; this.autoTopupAmountType = autoTopupAmountType; + this.autoTopupAvailability = autoTopupAvailability; this.autoTopupEnabled = autoTopupEnabled; this.autoTopupExpiryType = autoTopupExpiryType; this.autoTopupExpiryUnit = autoTopupExpiryUnit; @@ -98,6 +105,7 @@ private CreateBillingPlanCreditGrantRequestBody( this.autoTopupSelfService = autoTopupSelfService; this.autoTopupThresholdCredits = autoTopupThresholdCredits; this.autoTopupThresholdPercent = autoTopupThresholdPercent; + this.canBuyBundles = canBuyBundles; this.creditAmount = creditAmount; this.creditId = creditId; this.expiryType = expiryType; @@ -127,6 +135,11 @@ public Optional getAutoTopupAmountType() { return autoTopupAmountType; } + @JsonProperty("auto_topup_availability") + public Optional getAutoTopupAvailability() { + return autoTopupAvailability; + } + @JsonProperty("auto_topup_enabled") public Optional getAutoTopupEnabled() { return autoTopupEnabled; @@ -162,6 +175,11 @@ public Optional getAutoTopupThresholdPercent() { return autoTopupThresholdPercent; } + @JsonProperty("can_buy_bundles") + public Optional getCanBuyBundles() { + return canBuyBundles; + } + @JsonProperty("credit_amount") public long getCreditAmount() { return creditAmount; @@ -236,6 +254,7 @@ private boolean equalTo(CreateBillingPlanCreditGrantRequestBody other) { return applyToExisting.equals(other.applyToExisting) && autoTopupAmount.equals(other.autoTopupAmount) && autoTopupAmountType.equals(other.autoTopupAmountType) + && autoTopupAvailability.equals(other.autoTopupAvailability) && autoTopupEnabled.equals(other.autoTopupEnabled) && autoTopupExpiryType.equals(other.autoTopupExpiryType) && autoTopupExpiryUnit.equals(other.autoTopupExpiryUnit) @@ -243,6 +262,7 @@ private boolean equalTo(CreateBillingPlanCreditGrantRequestBody other) { && autoTopupSelfService.equals(other.autoTopupSelfService) && autoTopupThresholdCredits.equals(other.autoTopupThresholdCredits) && autoTopupThresholdPercent.equals(other.autoTopupThresholdPercent) + && canBuyBundles.equals(other.canBuyBundles) && creditAmount == other.creditAmount && creditId.equals(other.creditId) && expiryType.equals(other.expiryType) @@ -262,6 +282,7 @@ public int hashCode() { this.applyToExisting, this.autoTopupAmount, this.autoTopupAmountType, + this.autoTopupAvailability, this.autoTopupEnabled, this.autoTopupExpiryType, this.autoTopupExpiryUnit, @@ -269,6 +290,7 @@ public int hashCode() { this.autoTopupSelfService, this.autoTopupThresholdCredits, this.autoTopupThresholdPercent, + this.canBuyBundles, this.creditAmount, this.creditId, this.expiryType, @@ -332,6 +354,10 @@ public interface _FinalStage { _FinalStage autoTopupAmountType(String autoTopupAmountType); + _FinalStage autoTopupAvailability(Optional autoTopupAvailability); + + _FinalStage autoTopupAvailability(BillingCreditAutoTopupAvailability autoTopupAvailability); + _FinalStage autoTopupEnabled(Optional autoTopupEnabled); _FinalStage autoTopupEnabled(Boolean autoTopupEnabled); @@ -360,6 +386,10 @@ public interface _FinalStage { _FinalStage autoTopupThresholdPercent(Long autoTopupThresholdPercent); + _FinalStage canBuyBundles(Optional canBuyBundles); + + _FinalStage canBuyBundles(Boolean canBuyBundles); + _FinalStage expiryType(Optional expiryType); _FinalStage expiryType(BillingCreditExpiryType expiryType); @@ -413,6 +443,8 @@ public static final class Builder private Optional expiryType = Optional.empty(); + private Optional canBuyBundles = Optional.empty(); + private Optional autoTopupThresholdPercent = Optional.empty(); private Optional autoTopupThresholdCredits = Optional.empty(); @@ -427,6 +459,8 @@ public static final class Builder private Optional autoTopupEnabled = Optional.empty(); + private Optional autoTopupAvailability = Optional.empty(); + private Optional autoTopupAmountType = Optional.empty(); private Optional autoTopupAmount = Optional.empty(); @@ -443,6 +477,7 @@ public Builder from(CreateBillingPlanCreditGrantRequestBody other) { applyToExisting(other.getApplyToExisting()); autoTopupAmount(other.getAutoTopupAmount()); autoTopupAmountType(other.getAutoTopupAmountType()); + autoTopupAvailability(other.getAutoTopupAvailability()); autoTopupEnabled(other.getAutoTopupEnabled()); autoTopupExpiryType(other.getAutoTopupExpiryType()); autoTopupExpiryUnit(other.getAutoTopupExpiryUnit()); @@ -450,6 +485,7 @@ public Builder from(CreateBillingPlanCreditGrantRequestBody other) { autoTopupSelfService(other.getAutoTopupSelfService()); autoTopupThresholdCredits(other.getAutoTopupThresholdCredits()); autoTopupThresholdPercent(other.getAutoTopupThresholdPercent()); + canBuyBundles(other.getCanBuyBundles()); creditAmount(other.getCreditAmount()); creditId(other.getCreditId()); expiryType(other.getExpiryType()); @@ -584,6 +620,19 @@ public _FinalStage expiryType(Optional expiryType) { return this; } + @java.lang.Override + public _FinalStage canBuyBundles(Boolean canBuyBundles) { + this.canBuyBundles = Optional.ofNullable(canBuyBundles); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_buy_bundles", nulls = Nulls.SKIP) + public _FinalStage canBuyBundles(Optional canBuyBundles) { + this.canBuyBundles = canBuyBundles; + return this; + } + @java.lang.Override public _FinalStage autoTopupThresholdPercent(Long autoTopupThresholdPercent) { this.autoTopupThresholdPercent = Optional.ofNullable(autoTopupThresholdPercent); @@ -675,6 +724,19 @@ public _FinalStage autoTopupEnabled(Optional autoTopupEnabled) { return this; } + @java.lang.Override + public _FinalStage autoTopupAvailability(BillingCreditAutoTopupAvailability autoTopupAvailability) { + this.autoTopupAvailability = Optional.ofNullable(autoTopupAvailability); + return this; + } + + @java.lang.Override + @JsonSetter(value = "auto_topup_availability", nulls = Nulls.SKIP) + public _FinalStage autoTopupAvailability(Optional autoTopupAvailability) { + this.autoTopupAvailability = autoTopupAvailability; + return this; + } + @java.lang.Override public _FinalStage autoTopupAmountType(String autoTopupAmountType) { this.autoTopupAmountType = Optional.ofNullable(autoTopupAmountType); @@ -720,6 +782,7 @@ public CreateBillingPlanCreditGrantRequestBody build() { applyToExisting, autoTopupAmount, autoTopupAmountType, + autoTopupAvailability, autoTopupEnabled, autoTopupExpiryType, autoTopupExpiryUnit, @@ -727,6 +790,7 @@ public CreateBillingPlanCreditGrantRequestBody build() { autoTopupSelfService, autoTopupThresholdCredits, autoTopupThresholdPercent, + canBuyBundles, creditAmount, creditId, expiryType, diff --git a/src/main/java/com/schematic/api/types/ManagePlanRequest.java b/src/main/java/com/schematic/api/types/ManagePlanRequest.java index b03e7c69..44c41c0b 100644 --- a/src/main/java/com/schematic/api/types/ManagePlanRequest.java +++ b/src/main/java/com/schematic/api/types/ManagePlanRequest.java @@ -32,6 +32,8 @@ public final class ManagePlanRequest { private final Optional basePlanVersionId; + private final Optional billingEntityId; + private final Optional cancelImmediately; private final String companyId; @@ -59,6 +61,7 @@ private ManagePlanRequest( Optional basePlanId, Optional basePlanPriceId, Optional basePlanVersionId, + Optional billingEntityId, Optional cancelImmediately, String companyId, Optional couponExternalId, @@ -74,6 +77,7 @@ private ManagePlanRequest( this.basePlanId = basePlanId; this.basePlanPriceId = basePlanPriceId; this.basePlanVersionId = basePlanVersionId; + this.billingEntityId = billingEntityId; this.cancelImmediately = cancelImmediately; this.companyId = companyId; this.couponExternalId = couponExternalId; @@ -107,6 +111,14 @@ public Optional getBasePlanVersionId() { return basePlanVersionId; } + /** + * @return The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription. + */ + @JsonProperty("billing_entity_id") + public Optional getBillingEntityId() { + return billingEntityId; + } + /** * @return If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true. */ @@ -179,6 +191,7 @@ private boolean equalTo(ManagePlanRequest other) { && basePlanId.equals(other.basePlanId) && basePlanPriceId.equals(other.basePlanPriceId) && basePlanVersionId.equals(other.basePlanVersionId) + && billingEntityId.equals(other.billingEntityId) && cancelImmediately.equals(other.cancelImmediately) && companyId.equals(other.companyId) && couponExternalId.equals(other.couponExternalId) @@ -198,6 +211,7 @@ public int hashCode() { this.basePlanId, this.basePlanPriceId, this.basePlanVersionId, + this.billingEntityId, this.cancelImmediately, this.companyId, this.couponExternalId, @@ -250,6 +264,13 @@ public interface _FinalStage { _FinalStage basePlanVersionId(String basePlanVersionId); + /** + *

The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.

+ */ + _FinalStage billingEntityId(Optional billingEntityId); + + _FinalStage billingEntityId(String billingEntityId); + /** *

If false, subscription cancels at period end. Only applies when removing all plans. Defaults to true.

*/ @@ -321,6 +342,8 @@ public static final class Builder implements CompanyIdStage, _FinalStage { private Optional cancelImmediately = Optional.empty(); + private Optional billingEntityId = Optional.empty(); + private Optional basePlanVersionId = Optional.empty(); private Optional basePlanPriceId = Optional.empty(); @@ -340,6 +363,7 @@ public Builder from(ManagePlanRequest other) { basePlanId(other.getBasePlanId()); basePlanPriceId(other.getBasePlanPriceId()); basePlanVersionId(other.getBasePlanVersionId()); + billingEntityId(other.getBillingEntityId()); cancelImmediately(other.getCancelImmediately()); companyId(other.getCompanyId()); couponExternalId(other.getCouponExternalId()); @@ -525,6 +549,26 @@ public _FinalStage cancelImmediately(Optional cancelImmediately) { return this; } + /** + *

The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage billingEntityId(String billingEntityId) { + this.billingEntityId = Optional.ofNullable(billingEntityId); + return this; + } + + /** + *

The company that pays for this subscription. Must already have a Stripe customer. Only honored when starting a new subscription.

+ */ + @java.lang.Override + @JsonSetter(value = "billing_entity_id", nulls = Nulls.SKIP) + public _FinalStage billingEntityId(Optional billingEntityId) { + this.billingEntityId = billingEntityId; + return this; + } + @java.lang.Override public _FinalStage basePlanVersionId(String basePlanVersionId) { this.basePlanVersionId = Optional.ofNullable(basePlanVersionId); @@ -595,6 +639,7 @@ public ManagePlanRequest build() { basePlanId, basePlanPriceId, basePlanVersionId, + billingEntityId, cancelImmediately, companyId, couponExternalId, diff --git a/src/main/java/com/schematic/api/types/PlanCreditGrantView.java b/src/main/java/com/schematic/api/types/PlanCreditGrantView.java index 35b87eb9..2bfda7bd 100644 --- a/src/main/java/com/schematic/api/types/PlanCreditGrantView.java +++ b/src/main/java/com/schematic/api/types/PlanCreditGrantView.java @@ -26,6 +26,8 @@ public final class PlanCreditGrantView { private final Optional billingCreditAutoTopupAmountType; + private final Optional billingCreditAutoTopupAvailability; + private final boolean billingCreditAutoTopupEnabled; private final Optional billingCreditAutoTopupExpiryType; @@ -40,6 +42,8 @@ public final class PlanCreditGrantView { private final Optional billingCreditAutoTopupThresholdPercent; + private final boolean billingCreditCanBuyBundles; + private final OffsetDateTime createdAt; private final Optional credit; @@ -87,6 +91,7 @@ public final class PlanCreditGrantView { private PlanCreditGrantView( Optional billingCreditAutoTopupAmount, Optional billingCreditAutoTopupAmountType, + Optional billingCreditAutoTopupAvailability, boolean billingCreditAutoTopupEnabled, Optional billingCreditAutoTopupExpiryType, Optional billingCreditAutoTopupExpiryUnit, @@ -94,6 +99,7 @@ private PlanCreditGrantView( boolean billingCreditAutoTopupSelfService, Optional billingCreditAutoTopupThresholdCredits, Optional billingCreditAutoTopupThresholdPercent, + boolean billingCreditCanBuyBundles, OffsetDateTime createdAt, Optional credit, long creditAmount, @@ -118,6 +124,7 @@ private PlanCreditGrantView( Map additionalProperties) { this.billingCreditAutoTopupAmount = billingCreditAutoTopupAmount; this.billingCreditAutoTopupAmountType = billingCreditAutoTopupAmountType; + this.billingCreditAutoTopupAvailability = billingCreditAutoTopupAvailability; this.billingCreditAutoTopupEnabled = billingCreditAutoTopupEnabled; this.billingCreditAutoTopupExpiryType = billingCreditAutoTopupExpiryType; this.billingCreditAutoTopupExpiryUnit = billingCreditAutoTopupExpiryUnit; @@ -125,6 +132,7 @@ private PlanCreditGrantView( this.billingCreditAutoTopupSelfService = billingCreditAutoTopupSelfService; this.billingCreditAutoTopupThresholdCredits = billingCreditAutoTopupThresholdCredits; this.billingCreditAutoTopupThresholdPercent = billingCreditAutoTopupThresholdPercent; + this.billingCreditCanBuyBundles = billingCreditCanBuyBundles; this.createdAt = createdAt; this.credit = credit; this.creditAmount = creditAmount; @@ -159,6 +167,11 @@ public Optional getBillingCreditAutoTopupAmountType() { return billingCreditAutoTopupAmountType; } + @JsonProperty("billing_credit_auto_topup_availability") + public Optional getBillingCreditAutoTopupAvailability() { + return billingCreditAutoTopupAvailability; + } + @JsonProperty("billing_credit_auto_topup_enabled") public boolean getBillingCreditAutoTopupEnabled() { return billingCreditAutoTopupEnabled; @@ -194,6 +207,11 @@ public Optional getBillingCreditAutoTopupThresholdPercent() { return billingCreditAutoTopupThresholdPercent; } + @JsonProperty("billing_credit_can_buy_bundles") + public boolean getBillingCreditCanBuyBundles() { + return billingCreditCanBuyBundles; + } + @JsonProperty("created_at") public OffsetDateTime getCreatedAt() { return createdAt; @@ -328,6 +346,7 @@ public Map getAdditionalProperties() { private boolean equalTo(PlanCreditGrantView other) { return billingCreditAutoTopupAmount.equals(other.billingCreditAutoTopupAmount) && billingCreditAutoTopupAmountType.equals(other.billingCreditAutoTopupAmountType) + && billingCreditAutoTopupAvailability.equals(other.billingCreditAutoTopupAvailability) && billingCreditAutoTopupEnabled == other.billingCreditAutoTopupEnabled && billingCreditAutoTopupExpiryType.equals(other.billingCreditAutoTopupExpiryType) && billingCreditAutoTopupExpiryUnit.equals(other.billingCreditAutoTopupExpiryUnit) @@ -335,6 +354,7 @@ private boolean equalTo(PlanCreditGrantView other) { && billingCreditAutoTopupSelfService == other.billingCreditAutoTopupSelfService && billingCreditAutoTopupThresholdCredits.equals(other.billingCreditAutoTopupThresholdCredits) && billingCreditAutoTopupThresholdPercent.equals(other.billingCreditAutoTopupThresholdPercent) + && billingCreditCanBuyBundles == other.billingCreditCanBuyBundles && createdAt.equals(other.createdAt) && credit.equals(other.credit) && creditAmount == other.creditAmount @@ -363,6 +383,7 @@ public int hashCode() { return Objects.hash( this.billingCreditAutoTopupAmount, this.billingCreditAutoTopupAmountType, + this.billingCreditAutoTopupAvailability, this.billingCreditAutoTopupEnabled, this.billingCreditAutoTopupExpiryType, this.billingCreditAutoTopupExpiryUnit, @@ -370,6 +391,7 @@ public int hashCode() { this.billingCreditAutoTopupSelfService, this.billingCreditAutoTopupThresholdCredits, this.billingCreditAutoTopupThresholdPercent, + this.billingCreditCanBuyBundles, this.createdAt, this.credit, this.creditAmount, @@ -409,7 +431,11 @@ public interface BillingCreditAutoTopupEnabledStage { } public interface BillingCreditAutoTopupSelfServiceStage { - CreatedAtStage billingCreditAutoTopupSelfService(boolean billingCreditAutoTopupSelfService); + BillingCreditCanBuyBundlesStage billingCreditAutoTopupSelfService(boolean billingCreditAutoTopupSelfService); + } + + public interface BillingCreditCanBuyBundlesStage { + CreatedAtStage billingCreditCanBuyBundles(boolean billingCreditCanBuyBundles); } public interface CreatedAtStage { @@ -473,6 +499,12 @@ public interface _FinalStage { _FinalStage billingCreditAutoTopupAmountType(String billingCreditAutoTopupAmountType); + _FinalStage billingCreditAutoTopupAvailability( + Optional billingCreditAutoTopupAvailability); + + _FinalStage billingCreditAutoTopupAvailability( + BillingCreditAutoTopupAvailability billingCreditAutoTopupAvailability); + _FinalStage billingCreditAutoTopupExpiryType( Optional billingCreditAutoTopupExpiryType); @@ -553,6 +585,7 @@ _FinalStage billingCreditAutoTopupExpiryUnit( public static final class Builder implements BillingCreditAutoTopupEnabledStage, BillingCreditAutoTopupSelfServiceStage, + BillingCreditCanBuyBundlesStage, CreatedAtStage, CreditAmountStage, CreditDescriptionStage, @@ -568,6 +601,8 @@ public static final class Builder private boolean billingCreditAutoTopupSelfService; + private boolean billingCreditCanBuyBundles; + private OffsetDateTime createdAt; private long creditAmount; @@ -620,6 +655,8 @@ public static final class Builder private Optional billingCreditAutoTopupExpiryType = Optional.empty(); + private Optional billingCreditAutoTopupAvailability = Optional.empty(); + private Optional billingCreditAutoTopupAmountType = Optional.empty(); private Optional billingCreditAutoTopupAmount = Optional.empty(); @@ -633,6 +670,7 @@ private Builder() {} public Builder from(PlanCreditGrantView other) { billingCreditAutoTopupAmount(other.getBillingCreditAutoTopupAmount()); billingCreditAutoTopupAmountType(other.getBillingCreditAutoTopupAmountType()); + billingCreditAutoTopupAvailability(other.getBillingCreditAutoTopupAvailability()); billingCreditAutoTopupEnabled(other.getBillingCreditAutoTopupEnabled()); billingCreditAutoTopupExpiryType(other.getBillingCreditAutoTopupExpiryType()); billingCreditAutoTopupExpiryUnit(other.getBillingCreditAutoTopupExpiryUnit()); @@ -640,6 +678,7 @@ public Builder from(PlanCreditGrantView other) { billingCreditAutoTopupSelfService(other.getBillingCreditAutoTopupSelfService()); billingCreditAutoTopupThresholdCredits(other.getBillingCreditAutoTopupThresholdCredits()); billingCreditAutoTopupThresholdPercent(other.getBillingCreditAutoTopupThresholdPercent()); + billingCreditCanBuyBundles(other.getBillingCreditCanBuyBundles()); createdAt(other.getCreatedAt()); credit(other.getCredit()); creditAmount(other.getCreditAmount()); @@ -674,11 +713,19 @@ public BillingCreditAutoTopupSelfServiceStage billingCreditAutoTopupEnabled( @java.lang.Override @JsonSetter("billing_credit_auto_topup_self_service") - public CreatedAtStage billingCreditAutoTopupSelfService(boolean billingCreditAutoTopupSelfService) { + public BillingCreditCanBuyBundlesStage billingCreditAutoTopupSelfService( + boolean billingCreditAutoTopupSelfService) { this.billingCreditAutoTopupSelfService = billingCreditAutoTopupSelfService; return this; } + @java.lang.Override + @JsonSetter("billing_credit_can_buy_bundles") + public CreatedAtStage billingCreditCanBuyBundles(boolean billingCreditCanBuyBundles) { + this.billingCreditCanBuyBundles = billingCreditCanBuyBundles; + return this; + } + @java.lang.Override @JsonSetter("created_at") public CreditAmountStage createdAt(@NotNull OffsetDateTime createdAt) { @@ -992,6 +1039,21 @@ public _FinalStage billingCreditAutoTopupExpiryType( return this; } + @java.lang.Override + public _FinalStage billingCreditAutoTopupAvailability( + BillingCreditAutoTopupAvailability billingCreditAutoTopupAvailability) { + this.billingCreditAutoTopupAvailability = Optional.ofNullable(billingCreditAutoTopupAvailability); + return this; + } + + @java.lang.Override + @JsonSetter(value = "billing_credit_auto_topup_availability", nulls = Nulls.SKIP) + public _FinalStage billingCreditAutoTopupAvailability( + Optional billingCreditAutoTopupAvailability) { + this.billingCreditAutoTopupAvailability = billingCreditAutoTopupAvailability; + return this; + } + @java.lang.Override public _FinalStage billingCreditAutoTopupAmountType(String billingCreditAutoTopupAmountType) { this.billingCreditAutoTopupAmountType = Optional.ofNullable(billingCreditAutoTopupAmountType); @@ -1023,6 +1085,7 @@ public PlanCreditGrantView build() { return new PlanCreditGrantView( billingCreditAutoTopupAmount, billingCreditAutoTopupAmountType, + billingCreditAutoTopupAvailability, billingCreditAutoTopupEnabled, billingCreditAutoTopupExpiryType, billingCreditAutoTopupExpiryUnit, @@ -1030,6 +1093,7 @@ public PlanCreditGrantView build() { billingCreditAutoTopupSelfService, billingCreditAutoTopupThresholdCredits, billingCreditAutoTopupThresholdPercent, + billingCreditCanBuyBundles, createdAt, credit, creditAmount, diff --git a/src/main/java/com/schematic/api/types/PlanDetailResponseData.java b/src/main/java/com/schematic/api/types/PlanDetailResponseData.java index c615a3aa..0cb96b96 100644 --- a/src/main/java/com/schematic/api/types/PlanDetailResponseData.java +++ b/src/main/java/com/schematic/api/types/PlanDetailResponseData.java @@ -40,6 +40,8 @@ public final class PlanDetailResponseData { private final Optional companyId; + private final Optional companyLogoUrl; + private final Optional companyName; private final BillingProviderType controlledBy; @@ -48,6 +50,8 @@ public final class PlanDetailResponseData { private final OffsetDateTime createdAt; + private final List credits; + private final List currencyPrices; private final String description; @@ -99,10 +103,12 @@ private PlanDetailResponseData( ChargeType chargeType, long companyCount, Optional companyId, + Optional companyLogoUrl, Optional companyName, BillingProviderType controlledBy, Optional copiedFromPlanId, OffsetDateTime createdAt, + List credits, List currencyPrices, String description, Optional draftVersion, @@ -132,10 +138,12 @@ private PlanDetailResponseData( this.chargeType = chargeType; this.companyCount = companyCount; this.companyId = companyId; + this.companyLogoUrl = companyLogoUrl; this.companyName = companyName; this.controlledBy = controlledBy; this.copiedFromPlanId = copiedFromPlanId; this.createdAt = createdAt; + this.credits = credits; this.currencyPrices = currencyPrices; this.description = description; this.draftVersion = draftVersion; @@ -199,6 +207,11 @@ public Optional getCompanyId() { return companyId; } + @JsonProperty("company_logo_url") + public Optional getCompanyLogoUrl() { + return companyLogoUrl; + } + @JsonProperty("company_name") public Optional getCompanyName() { return companyName; @@ -219,6 +232,11 @@ public OffsetDateTime getCreatedAt() { return createdAt; } + @JsonProperty("credits") + public List getCredits() { + return credits; + } + @JsonProperty("currency_prices") public List getCurrencyPrices() { return currencyPrices; @@ -342,10 +360,12 @@ private boolean equalTo(PlanDetailResponseData other) { && chargeType.equals(other.chargeType) && companyCount == other.companyCount && companyId.equals(other.companyId) + && companyLogoUrl.equals(other.companyLogoUrl) && companyName.equals(other.companyName) && controlledBy.equals(other.controlledBy) && copiedFromPlanId.equals(other.copiedFromPlanId) && createdAt.equals(other.createdAt) + && credits.equals(other.credits) && currencyPrices.equals(other.currencyPrices) && description.equals(other.description) && draftVersion.equals(other.draftVersion) @@ -379,10 +399,12 @@ public int hashCode() { this.chargeType, this.companyCount, this.companyId, + this.companyLogoUrl, this.companyName, this.controlledBy, this.copiedFromPlanId, this.createdAt, + this.credits, this.currencyPrices, this.description, this.draftVersion, @@ -502,6 +524,10 @@ public interface _FinalStage { _FinalStage companyId(String companyId); + _FinalStage companyLogoUrl(Optional companyLogoUrl); + + _FinalStage companyLogoUrl(String companyLogoUrl); + _FinalStage companyName(Optional companyName); _FinalStage companyName(String companyName); @@ -510,6 +536,12 @@ public interface _FinalStage { _FinalStage copiedFromPlanId(String copiedFromPlanId); + _FinalStage credits(List credits); + + _FinalStage addCredits(BillingCreditResponseData credits); + + _FinalStage addAllCredits(List credits); + _FinalStage currencyPrices(List currencyPrices); _FinalStage addCurrencyPrices(PlanCurrencyPricesResponseData currencyPrices); @@ -628,10 +660,14 @@ public static final class Builder private List currencyPrices = new ArrayList<>(); + private List credits = new ArrayList<>(); + private Optional copiedFromPlanId = Optional.empty(); private Optional companyName = Optional.empty(); + private Optional companyLogoUrl = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional billingProduct = Optional.empty(); @@ -657,10 +693,12 @@ public Builder from(PlanDetailResponseData other) { chargeType(other.getChargeType()); companyCount(other.getCompanyCount()); companyId(other.getCompanyId()); + companyLogoUrl(other.getCompanyLogoUrl()); companyName(other.getCompanyName()); controlledBy(other.getControlledBy()); copiedFromPlanId(other.getCopiedFromPlanId()); createdAt(other.getCreatedAt()); + credits(other.getCredits()); currencyPrices(other.getCurrencyPrices()); description(other.getDescription()); draftVersion(other.getDraftVersion()); @@ -964,6 +1002,30 @@ public _FinalStage currencyPrices(List currencyP return this; } + @java.lang.Override + public _FinalStage addAllCredits(List credits) { + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + + @java.lang.Override + public _FinalStage addCredits(BillingCreditResponseData credits) { + this.credits.add(credits); + return this; + } + + @java.lang.Override + @JsonSetter(value = "credits", nulls = Nulls.SKIP) + public _FinalStage credits(List credits) { + this.credits.clear(); + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + @java.lang.Override public _FinalStage copiedFromPlanId(String copiedFromPlanId) { this.copiedFromPlanId = Optional.ofNullable(copiedFromPlanId); @@ -990,6 +1052,19 @@ public _FinalStage companyName(Optional companyName) { return this; } + @java.lang.Override + public _FinalStage companyLogoUrl(String companyLogoUrl) { + this.companyLogoUrl = Optional.ofNullable(companyLogoUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company_logo_url", nulls = Nulls.SKIP) + public _FinalStage companyLogoUrl(Optional companyLogoUrl) { + this.companyLogoUrl = companyLogoUrl; + return this; + } + @java.lang.Override public _FinalStage companyId(String companyId) { this.companyId = Optional.ofNullable(companyId); @@ -1066,10 +1141,12 @@ public PlanDetailResponseData build() { chargeType, companyCount, companyId, + companyLogoUrl, companyName, controlledBy, copiedFromPlanId, createdAt, + credits, currencyPrices, description, draftVersion, diff --git a/src/main/java/com/schematic/api/types/PlanGroupPlanDetailResponseData.java b/src/main/java/com/schematic/api/types/PlanGroupPlanDetailResponseData.java index 1f242b60..79ae7a8b 100644 --- a/src/main/java/com/schematic/api/types/PlanGroupPlanDetailResponseData.java +++ b/src/main/java/com/schematic/api/types/PlanGroupPlanDetailResponseData.java @@ -42,6 +42,8 @@ public final class PlanGroupPlanDetailResponseData { private final Optional companyId; + private final Optional companyLogoUrl; + private final Optional companyName; private final List compatiblePlanIds; @@ -52,6 +54,8 @@ public final class PlanGroupPlanDetailResponseData { private final OffsetDateTime createdAt; + private final List credits; + private final List currencyPrices; private final Optional customPlanConfig; @@ -108,11 +112,13 @@ private PlanGroupPlanDetailResponseData( ChargeType chargeType, long companyCount, Optional companyId, + Optional companyLogoUrl, Optional companyName, List compatiblePlanIds, BillingProviderType controlledBy, Optional copiedFromPlanId, OffsetDateTime createdAt, + List credits, List currencyPrices, Optional customPlanConfig, String description, @@ -145,11 +151,13 @@ private PlanGroupPlanDetailResponseData( this.chargeType = chargeType; this.companyCount = companyCount; this.companyId = companyId; + this.companyLogoUrl = companyLogoUrl; this.companyName = companyName; this.compatiblePlanIds = compatiblePlanIds; this.controlledBy = controlledBy; this.copiedFromPlanId = copiedFromPlanId; this.createdAt = createdAt; + this.credits = credits; this.currencyPrices = currencyPrices; this.customPlanConfig = customPlanConfig; this.description = description; @@ -220,6 +228,11 @@ public Optional getCompanyId() { return companyId; } + @JsonProperty("company_logo_url") + public Optional getCompanyLogoUrl() { + return companyLogoUrl; + } + @JsonProperty("company_name") public Optional getCompanyName() { return companyName; @@ -245,6 +258,11 @@ public OffsetDateTime getCreatedAt() { return createdAt; } + @JsonProperty("credits") + public List getCredits() { + return credits; + } + @JsonProperty("currency_prices") public List getCurrencyPrices() { return currencyPrices; @@ -379,11 +397,13 @@ private boolean equalTo(PlanGroupPlanDetailResponseData other) { && chargeType.equals(other.chargeType) && companyCount == other.companyCount && companyId.equals(other.companyId) + && companyLogoUrl.equals(other.companyLogoUrl) && companyName.equals(other.companyName) && compatiblePlanIds.equals(other.compatiblePlanIds) && controlledBy.equals(other.controlledBy) && copiedFromPlanId.equals(other.copiedFromPlanId) && createdAt.equals(other.createdAt) + && credits.equals(other.credits) && currencyPrices.equals(other.currencyPrices) && customPlanConfig.equals(other.customPlanConfig) && description.equals(other.description) @@ -420,11 +440,13 @@ public int hashCode() { this.chargeType, this.companyCount, this.companyId, + this.companyLogoUrl, this.companyName, this.compatiblePlanIds, this.controlledBy, this.copiedFromPlanId, this.createdAt, + this.credits, this.currencyPrices, this.customPlanConfig, this.description, @@ -556,6 +578,10 @@ public interface _FinalStage { _FinalStage companyId(String companyId); + _FinalStage companyLogoUrl(Optional companyLogoUrl); + + _FinalStage companyLogoUrl(String companyLogoUrl); + _FinalStage companyName(Optional companyName); _FinalStage companyName(String companyName); @@ -570,6 +596,12 @@ public interface _FinalStage { _FinalStage copiedFromPlanId(String copiedFromPlanId); + _FinalStage credits(List credits); + + _FinalStage addCredits(BillingCreditResponseData credits); + + _FinalStage addAllCredits(List credits); + _FinalStage currencyPrices(List currencyPrices); _FinalStage addCurrencyPrices(PlanCurrencyPricesResponseData currencyPrices); @@ -697,12 +729,16 @@ public static final class Builder private List currencyPrices = new ArrayList<>(); + private List credits = new ArrayList<>(); + private Optional copiedFromPlanId = Optional.empty(); private List compatiblePlanIds = new ArrayList<>(); private Optional companyName = Optional.empty(); + private Optional companyLogoUrl = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional billingProduct = Optional.empty(); @@ -731,11 +767,13 @@ public Builder from(PlanGroupPlanDetailResponseData other) { chargeType(other.getChargeType()); companyCount(other.getCompanyCount()); companyId(other.getCompanyId()); + companyLogoUrl(other.getCompanyLogoUrl()); companyName(other.getCompanyName()); compatiblePlanIds(other.getCompatiblePlanIds()); controlledBy(other.getControlledBy()); copiedFromPlanId(other.getCopiedFromPlanId()); createdAt(other.getCreatedAt()); + credits(other.getCredits()); currencyPrices(other.getCurrencyPrices()); customPlanConfig(other.getCustomPlanConfig()); description(other.getDescription()); @@ -1061,6 +1099,30 @@ public _FinalStage currencyPrices(List currencyP return this; } + @java.lang.Override + public _FinalStage addAllCredits(List credits) { + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + + @java.lang.Override + public _FinalStage addCredits(BillingCreditResponseData credits) { + this.credits.add(credits); + return this; + } + + @java.lang.Override + @JsonSetter(value = "credits", nulls = Nulls.SKIP) + public _FinalStage credits(List credits) { + this.credits.clear(); + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + @java.lang.Override public _FinalStage copiedFromPlanId(String copiedFromPlanId) { this.copiedFromPlanId = Optional.ofNullable(copiedFromPlanId); @@ -1111,6 +1173,19 @@ public _FinalStage companyName(Optional companyName) { return this; } + @java.lang.Override + public _FinalStage companyLogoUrl(String companyLogoUrl) { + this.companyLogoUrl = Optional.ofNullable(companyLogoUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company_logo_url", nulls = Nulls.SKIP) + public _FinalStage companyLogoUrl(Optional companyLogoUrl) { + this.companyLogoUrl = companyLogoUrl; + return this; + } + @java.lang.Override public _FinalStage companyId(String companyId) { this.companyId = Optional.ofNullable(companyId); @@ -1212,11 +1287,13 @@ public PlanGroupPlanDetailResponseData build() { chargeType, companyCount, companyId, + companyLogoUrl, companyName, compatiblePlanIds, controlledBy, copiedFromPlanId, createdAt, + credits, currencyPrices, customPlanConfig, description, diff --git a/src/main/java/com/schematic/api/types/PlanViewPublicResponseData.java b/src/main/java/com/schematic/api/types/PlanViewPublicResponseData.java index 7e1fe8ec..be02eb4b 100644 --- a/src/main/java/com/schematic/api/types/PlanViewPublicResponseData.java +++ b/src/main/java/com/schematic/api/types/PlanViewPublicResponseData.java @@ -42,6 +42,8 @@ public final class PlanViewPublicResponseData { private final Optional companyId; + private final Optional companyLogoUrl; + private final Optional companyName; private final List compatiblePlanIds; @@ -52,6 +54,8 @@ public final class PlanViewPublicResponseData { private final OffsetDateTime createdAt; + private final List credits; + private final List currencyPrices; private final boolean custom; @@ -110,11 +114,13 @@ private PlanViewPublicResponseData( ChargeType chargeType, long companyCount, Optional companyId, + Optional companyLogoUrl, Optional companyName, List compatiblePlanIds, BillingProviderType controlledBy, Optional copiedFromPlanId, OffsetDateTime createdAt, + List credits, List currencyPrices, boolean custom, Optional customPlanConfig, @@ -148,11 +154,13 @@ private PlanViewPublicResponseData( this.chargeType = chargeType; this.companyCount = companyCount; this.companyId = companyId; + this.companyLogoUrl = companyLogoUrl; this.companyName = companyName; this.compatiblePlanIds = compatiblePlanIds; this.controlledBy = controlledBy; this.copiedFromPlanId = copiedFromPlanId; this.createdAt = createdAt; + this.credits = credits; this.currencyPrices = currencyPrices; this.custom = custom; this.customPlanConfig = customPlanConfig; @@ -224,6 +232,11 @@ public Optional getCompanyId() { return companyId; } + @JsonProperty("company_logo_url") + public Optional getCompanyLogoUrl() { + return companyLogoUrl; + } + @JsonProperty("company_name") public Optional getCompanyName() { return companyName; @@ -249,6 +262,11 @@ public OffsetDateTime getCreatedAt() { return createdAt; } + @JsonProperty("credits") + public List getCredits() { + return credits; + } + @JsonProperty("currency_prices") public List getCurrencyPrices() { return currencyPrices; @@ -388,11 +406,13 @@ private boolean equalTo(PlanViewPublicResponseData other) { && chargeType.equals(other.chargeType) && companyCount == other.companyCount && companyId.equals(other.companyId) + && companyLogoUrl.equals(other.companyLogoUrl) && companyName.equals(other.companyName) && compatiblePlanIds.equals(other.compatiblePlanIds) && controlledBy.equals(other.controlledBy) && copiedFromPlanId.equals(other.copiedFromPlanId) && createdAt.equals(other.createdAt) + && credits.equals(other.credits) && currencyPrices.equals(other.currencyPrices) && custom == other.custom && customPlanConfig.equals(other.customPlanConfig) @@ -430,11 +450,13 @@ public int hashCode() { this.chargeType, this.companyCount, this.companyId, + this.companyLogoUrl, this.companyName, this.compatiblePlanIds, this.controlledBy, this.copiedFromPlanId, this.createdAt, + this.credits, this.currencyPrices, this.custom, this.customPlanConfig, @@ -571,6 +593,10 @@ public interface _FinalStage { _FinalStage companyId(String companyId); + _FinalStage companyLogoUrl(Optional companyLogoUrl); + + _FinalStage companyLogoUrl(String companyLogoUrl); + _FinalStage companyName(Optional companyName); _FinalStage companyName(String companyName); @@ -585,6 +611,12 @@ public interface _FinalStage { _FinalStage copiedFromPlanId(String copiedFromPlanId); + _FinalStage credits(List credits); + + _FinalStage addCredits(BillingCreditResponseData credits); + + _FinalStage addAllCredits(List credits); + _FinalStage currencyPrices(List currencyPrices); _FinalStage addCurrencyPrices(PlanCurrencyPricesResponseData currencyPrices); @@ -717,12 +749,16 @@ public static final class Builder private List currencyPrices = new ArrayList<>(); + private List credits = new ArrayList<>(); + private Optional copiedFromPlanId = Optional.empty(); private List compatiblePlanIds = new ArrayList<>(); private Optional companyName = Optional.empty(); + private Optional companyLogoUrl = Optional.empty(); + private Optional companyId = Optional.empty(); private Optional billingProduct = Optional.empty(); @@ -751,11 +787,13 @@ public Builder from(PlanViewPublicResponseData other) { chargeType(other.getChargeType()); companyCount(other.getCompanyCount()); companyId(other.getCompanyId()); + companyLogoUrl(other.getCompanyLogoUrl()); companyName(other.getCompanyName()); compatiblePlanIds(other.getCompatiblePlanIds()); controlledBy(other.getControlledBy()); copiedFromPlanId(other.getCopiedFromPlanId()); createdAt(other.getCreatedAt()); + credits(other.getCredits()); currencyPrices(other.getCurrencyPrices()); custom(other.getCustom()); customPlanConfig(other.getCustomPlanConfig()); @@ -1099,6 +1137,30 @@ public _FinalStage currencyPrices(List currencyP return this; } + @java.lang.Override + public _FinalStage addAllCredits(List credits) { + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + + @java.lang.Override + public _FinalStage addCredits(BillingCreditResponseData credits) { + this.credits.add(credits); + return this; + } + + @java.lang.Override + @JsonSetter(value = "credits", nulls = Nulls.SKIP) + public _FinalStage credits(List credits) { + this.credits.clear(); + if (credits != null) { + this.credits.addAll(credits); + } + return this; + } + @java.lang.Override public _FinalStage copiedFromPlanId(String copiedFromPlanId) { this.copiedFromPlanId = Optional.ofNullable(copiedFromPlanId); @@ -1149,6 +1211,19 @@ public _FinalStage companyName(Optional companyName) { return this; } + @java.lang.Override + public _FinalStage companyLogoUrl(String companyLogoUrl) { + this.companyLogoUrl = Optional.ofNullable(companyLogoUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "company_logo_url", nulls = Nulls.SKIP) + public _FinalStage companyLogoUrl(Optional companyLogoUrl) { + this.companyLogoUrl = companyLogoUrl; + return this; + } + @java.lang.Override public _FinalStage companyId(String companyId) { this.companyId = Optional.ofNullable(companyId); @@ -1250,11 +1325,13 @@ public PlanViewPublicResponseData build() { chargeType, companyCount, companyId, + companyLogoUrl, companyName, compatiblePlanIds, controlledBy, copiedFromPlanId, createdAt, + credits, currencyPrices, custom, customPlanConfig, diff --git a/src/main/java/com/schematic/api/types/UpdateBillingPlanCreditGrantRequestBody.java b/src/main/java/com/schematic/api/types/UpdateBillingPlanCreditGrantRequestBody.java index b19f7bde..8b2470d4 100644 --- a/src/main/java/com/schematic/api/types/UpdateBillingPlanCreditGrantRequestBody.java +++ b/src/main/java/com/schematic/api/types/UpdateBillingPlanCreditGrantRequestBody.java @@ -27,6 +27,8 @@ public final class UpdateBillingPlanCreditGrantRequestBody { private final Optional autoTopupAmountType; + private final Optional autoTopupAvailability; + private final Optional autoTopupEnabled; private final Optional autoTopupExpiryType; @@ -41,6 +43,8 @@ public final class UpdateBillingPlanCreditGrantRequestBody { private final Optional autoTopupThresholdPercent; + private final Optional canBuyBundles; + private final Optional creditAmount; private final Optional expiryType; @@ -63,6 +67,7 @@ private UpdateBillingPlanCreditGrantRequestBody( Optional applyToExisting, Optional autoTopupAmount, Optional autoTopupAmountType, + Optional autoTopupAvailability, Optional autoTopupEnabled, Optional autoTopupExpiryType, Optional autoTopupExpiryUnit, @@ -70,6 +75,7 @@ private UpdateBillingPlanCreditGrantRequestBody( Optional autoTopupSelfService, Optional autoTopupThresholdCredits, Optional autoTopupThresholdPercent, + Optional canBuyBundles, Optional creditAmount, Optional expiryType, Optional expiryUnit, @@ -82,6 +88,7 @@ private UpdateBillingPlanCreditGrantRequestBody( this.applyToExisting = applyToExisting; this.autoTopupAmount = autoTopupAmount; this.autoTopupAmountType = autoTopupAmountType; + this.autoTopupAvailability = autoTopupAvailability; this.autoTopupEnabled = autoTopupEnabled; this.autoTopupExpiryType = autoTopupExpiryType; this.autoTopupExpiryUnit = autoTopupExpiryUnit; @@ -89,6 +96,7 @@ private UpdateBillingPlanCreditGrantRequestBody( this.autoTopupSelfService = autoTopupSelfService; this.autoTopupThresholdCredits = autoTopupThresholdCredits; this.autoTopupThresholdPercent = autoTopupThresholdPercent; + this.canBuyBundles = canBuyBundles; this.creditAmount = creditAmount; this.expiryType = expiryType; this.expiryUnit = expiryUnit; @@ -115,6 +123,11 @@ public Optional getAutoTopupAmountType() { return autoTopupAmountType; } + @JsonProperty("auto_topup_availability") + public Optional getAutoTopupAvailability() { + return autoTopupAvailability; + } + @JsonProperty("auto_topup_enabled") public Optional getAutoTopupEnabled() { return autoTopupEnabled; @@ -150,6 +163,11 @@ public Optional getAutoTopupThresholdPercent() { return autoTopupThresholdPercent; } + @JsonProperty("can_buy_bundles") + public Optional getCanBuyBundles() { + return canBuyBundles; + } + @JsonProperty("credit_amount") public Optional getCreditAmount() { return creditAmount; @@ -209,6 +227,7 @@ private boolean equalTo(UpdateBillingPlanCreditGrantRequestBody other) { return applyToExisting.equals(other.applyToExisting) && autoTopupAmount.equals(other.autoTopupAmount) && autoTopupAmountType.equals(other.autoTopupAmountType) + && autoTopupAvailability.equals(other.autoTopupAvailability) && autoTopupEnabled.equals(other.autoTopupEnabled) && autoTopupExpiryType.equals(other.autoTopupExpiryType) && autoTopupExpiryUnit.equals(other.autoTopupExpiryUnit) @@ -216,6 +235,7 @@ private boolean equalTo(UpdateBillingPlanCreditGrantRequestBody other) { && autoTopupSelfService.equals(other.autoTopupSelfService) && autoTopupThresholdCredits.equals(other.autoTopupThresholdCredits) && autoTopupThresholdPercent.equals(other.autoTopupThresholdPercent) + && canBuyBundles.equals(other.canBuyBundles) && creditAmount.equals(other.creditAmount) && expiryType.equals(other.expiryType) && expiryUnit.equals(other.expiryUnit) @@ -232,6 +252,7 @@ public int hashCode() { this.applyToExisting, this.autoTopupAmount, this.autoTopupAmountType, + this.autoTopupAvailability, this.autoTopupEnabled, this.autoTopupExpiryType, this.autoTopupExpiryUnit, @@ -239,6 +260,7 @@ public int hashCode() { this.autoTopupSelfService, this.autoTopupThresholdCredits, this.autoTopupThresholdPercent, + this.canBuyBundles, this.creditAmount, this.expiryType, this.expiryUnit, @@ -287,6 +309,10 @@ public interface _FinalStage { _FinalStage autoTopupAmountType(String autoTopupAmountType); + _FinalStage autoTopupAvailability(Optional autoTopupAvailability); + + _FinalStage autoTopupAvailability(BillingCreditAutoTopupAvailability autoTopupAvailability); + _FinalStage autoTopupEnabled(Optional autoTopupEnabled); _FinalStage autoTopupEnabled(Boolean autoTopupEnabled); @@ -315,6 +341,10 @@ public interface _FinalStage { _FinalStage autoTopupThresholdPercent(Long autoTopupThresholdPercent); + _FinalStage canBuyBundles(Optional canBuyBundles); + + _FinalStage canBuyBundles(Boolean canBuyBundles); + _FinalStage creditAmount(Optional creditAmount); _FinalStage creditAmount(Long creditAmount); @@ -361,6 +391,8 @@ public static final class Builder implements ResetCadenceStage, ResetStartStage, private Optional creditAmount = Optional.empty(); + private Optional canBuyBundles = Optional.empty(); + private Optional autoTopupThresholdPercent = Optional.empty(); private Optional autoTopupThresholdCredits = Optional.empty(); @@ -375,6 +407,8 @@ public static final class Builder implements ResetCadenceStage, ResetStartStage, private Optional autoTopupEnabled = Optional.empty(); + private Optional autoTopupAvailability = Optional.empty(); + private Optional autoTopupAmountType = Optional.empty(); private Optional autoTopupAmount = Optional.empty(); @@ -391,6 +425,7 @@ public Builder from(UpdateBillingPlanCreditGrantRequestBody other) { applyToExisting(other.getApplyToExisting()); autoTopupAmount(other.getAutoTopupAmount()); autoTopupAmountType(other.getAutoTopupAmountType()); + autoTopupAvailability(other.getAutoTopupAvailability()); autoTopupEnabled(other.getAutoTopupEnabled()); autoTopupExpiryType(other.getAutoTopupExpiryType()); autoTopupExpiryUnit(other.getAutoTopupExpiryUnit()); @@ -398,6 +433,7 @@ public Builder from(UpdateBillingPlanCreditGrantRequestBody other) { autoTopupSelfService(other.getAutoTopupSelfService()); autoTopupThresholdCredits(other.getAutoTopupThresholdCredits()); autoTopupThresholdPercent(other.getAutoTopupThresholdPercent()); + canBuyBundles(other.getCanBuyBundles()); creditAmount(other.getCreditAmount()); expiryType(other.getExpiryType()); expiryUnit(other.getExpiryUnit()); @@ -508,6 +544,19 @@ public _FinalStage creditAmount(Optional creditAmount) { return this; } + @java.lang.Override + public _FinalStage canBuyBundles(Boolean canBuyBundles) { + this.canBuyBundles = Optional.ofNullable(canBuyBundles); + return this; + } + + @java.lang.Override + @JsonSetter(value = "can_buy_bundles", nulls = Nulls.SKIP) + public _FinalStage canBuyBundles(Optional canBuyBundles) { + this.canBuyBundles = canBuyBundles; + return this; + } + @java.lang.Override public _FinalStage autoTopupThresholdPercent(Long autoTopupThresholdPercent) { this.autoTopupThresholdPercent = Optional.ofNullable(autoTopupThresholdPercent); @@ -599,6 +648,19 @@ public _FinalStage autoTopupEnabled(Optional autoTopupEnabled) { return this; } + @java.lang.Override + public _FinalStage autoTopupAvailability(BillingCreditAutoTopupAvailability autoTopupAvailability) { + this.autoTopupAvailability = Optional.ofNullable(autoTopupAvailability); + return this; + } + + @java.lang.Override + @JsonSetter(value = "auto_topup_availability", nulls = Nulls.SKIP) + public _FinalStage autoTopupAvailability(Optional autoTopupAvailability) { + this.autoTopupAvailability = autoTopupAvailability; + return this; + } + @java.lang.Override public _FinalStage autoTopupAmountType(String autoTopupAmountType) { this.autoTopupAmountType = Optional.ofNullable(autoTopupAmountType); @@ -644,6 +706,7 @@ public UpdateBillingPlanCreditGrantRequestBody build() { applyToExisting, autoTopupAmount, autoTopupAmountType, + autoTopupAvailability, autoTopupEnabled, autoTopupExpiryType, autoTopupExpiryUnit, @@ -651,6 +714,7 @@ public UpdateBillingPlanCreditGrantRequestBody build() { autoTopupSelfService, autoTopupThresholdCredits, autoTopupThresholdPercent, + canBuyBundles, creditAmount, expiryType, expiryUnit,