diff --git a/.fern/metadata.json b/.fern/metadata.json index b61fbff..a66ea1e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -14,10 +14,10 @@ "implementation redis.clients:jedis:5.2.0" ] }, - "originGitCommit": "a9fc73b97dcfa602bff97a7d41d980a55c9c9030", + "originGitCommit": "8cfe954dda14329fc30a4f80b915db0acf608382", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "1.5.4", + "requestedVersion": "1.5.5", "ciProvider": "github", - "sdkVersion": "1.5.4" + "sdkVersion": "1.5.5" } \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock index e55ba63..8683d29 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -30,5 +30,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-java-sdk: 4.11.1 -current_generation: 7fc1ea4af8ebf683e8739f2b1fb365bd61e60e98 + - commit_sha: d154934d6a2afaf450896d2bbc575fdd061e1562 + tree_hash: fe26eb97d4488df2ff608182d71ddde00393ec97 + timestamp: 2026-08-10T10:30:33.106Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 4.11.1 +current_generation: d154934d6a2afaf450896d2bbc575fdd061e1562 patches: [] diff --git a/build.gradle b/build.gradle index 27c828f..71faae1 100644 --- a/build.gradle +++ b/build.gradle @@ -62,7 +62,7 @@ java { group = 'com.schematichq' -version = '1.5.4' +version = '1.5.5' jar { dependsOn(":generatePomFileForMavenPublication") @@ -93,7 +93,7 @@ publishing { maven(MavenPublication) { groupId = 'com.schematichq' artifactId = 'schematic-java' - version = '1.5.4' + version = '1.5.5' from components.java pom { name = 'Schematic' diff --git a/reference.md b/reference.md index ce1f593..cef993c 100644 --- a/reference.md +++ b/reference.md @@ -8709,6 +8709,46 @@ client.companies().listEntityKeyDefinitions( + + + + +
client.companies.deleteEntityKeyDefinition(entityKeyDefinitionId) -> DeleteEntityKeyDefinitionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.companies().deleteEntityKeyDefinition("entity_key_definition_id"); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**entityKeyDefinitionId:** `String` — entity_key_definition_id + +
+
+
+
+ +
@@ -8792,6 +8832,78 @@ client.companies().countEntityKeyDefinitions( + + + + +
client.companies.countEntityKeys() -> CountEntityKeysResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.companies().countEntityKeys( + CountEntityKeysRequest + .builder() + .definitionId("definition_id") + .entityType(EntityType.COMPANY) + .limit(1000000L) + .offset(1000000L) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**definitionId:** `Optional` + +
+
+ +
+
+ +**entityType:** `Optional` + +
+
+ +
+
+ +**limit:** `Optional` — Page limit (default 100) + +
+
+ +
+
+ +**offset:** `Optional` — Page offset (default 0) + +
+
+
+
+ +
diff --git a/src/main/java/com/schematic/api/core/ClientOptions.java b/src/main/java/com/schematic/api/core/ClientOptions.java index 514e4b2..0873c62 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.5.4"); + put("User-Agent", "com.schematichq:schematic-java/1.5.5"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.schematic.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.5.4"); + put("X-Fern-SDK-Version", "1.5.5"); } }); this.headerSuppliers = headerSuppliers; 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 9dfbf33..8e49990 100644 --- a/src/main/java/com/schematic/api/resources/companies/AsyncCompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/AsyncCompaniesClient.java @@ -7,6 +7,7 @@ import com.schematic.api.core.RequestOptions; import com.schematic.api.resources.companies.requests.CountCompaniesRequest; import com.schematic.api.resources.companies.requests.CountEntityKeyDefinitionsRequest; +import com.schematic.api.resources.companies.requests.CountEntityKeysRequest; import com.schematic.api.resources.companies.requests.CountEntityTraitDefinitionsRequest; import com.schematic.api.resources.companies.requests.CountPlanTraitsRequest; import com.schematic.api.resources.companies.requests.CountUsersRequest; @@ -30,6 +31,7 @@ import com.schematic.api.resources.companies.requests.UpdatePlanTraitBulkRequestBody; import com.schematic.api.resources.companies.types.CountCompaniesResponse; import com.schematic.api.resources.companies.types.CountEntityKeyDefinitionsResponse; +import com.schematic.api.resources.companies.types.CountEntityKeysResponse; import com.schematic.api.resources.companies.types.CountEntityTraitDefinitionsResponse; import com.schematic.api.resources.companies.types.CountPlanTraitsResponse; import com.schematic.api.resources.companies.types.CountUsersResponse; @@ -38,6 +40,7 @@ import com.schematic.api.resources.companies.types.DeleteCompanyByKeysResponse; import com.schematic.api.resources.companies.types.DeleteCompanyMembershipResponse; import com.schematic.api.resources.companies.types.DeleteCompanyResponse; +import com.schematic.api.resources.companies.types.DeleteEntityKeyDefinitionResponse; import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; @@ -330,6 +333,18 @@ public CompletableFuture listEntityKeyDefiniti return this.rawClient.listEntityKeyDefinitions(request, requestOptions).thenApply(response -> response.body()); } + public CompletableFuture deleteEntityKeyDefinition( + String entityKeyDefinitionId) { + return this.rawClient.deleteEntityKeyDefinition(entityKeyDefinitionId).thenApply(response -> response.body()); + } + + public CompletableFuture deleteEntityKeyDefinition( + String entityKeyDefinitionId, RequestOptions requestOptions) { + return this.rawClient + .deleteEntityKeyDefinition(entityKeyDefinitionId, requestOptions) + .thenApply(response -> response.body()); + } + public CompletableFuture countEntityKeyDefinitions() { return this.rawClient.countEntityKeyDefinitions().thenApply(response -> response.body()); } @@ -349,6 +364,23 @@ public CompletableFuture countEntityKeyDefini return this.rawClient.countEntityKeyDefinitions(request, requestOptions).thenApply(response -> response.body()); } + public CompletableFuture countEntityKeys() { + return this.rawClient.countEntityKeys().thenApply(response -> response.body()); + } + + public CompletableFuture countEntityKeys(RequestOptions requestOptions) { + return this.rawClient.countEntityKeys(requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture countEntityKeys(CountEntityKeysRequest request) { + return this.rawClient.countEntityKeys(request).thenApply(response -> response.body()); + } + + public CompletableFuture countEntityKeys( + CountEntityKeysRequest request, RequestOptions requestOptions) { + return this.rawClient.countEntityKeys(request, requestOptions).thenApply(response -> response.body()); + } + public CompletableFuture listEntityTraitDefinitions() { return this.rawClient.listEntityTraitDefinitions().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 1190e7e..294c557 100644 --- a/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/AsyncRawCompaniesClient.java @@ -20,6 +20,7 @@ import com.schematic.api.errors.UnauthorizedError; import com.schematic.api.resources.companies.requests.CountCompaniesRequest; import com.schematic.api.resources.companies.requests.CountEntityKeyDefinitionsRequest; +import com.schematic.api.resources.companies.requests.CountEntityKeysRequest; import com.schematic.api.resources.companies.requests.CountEntityTraitDefinitionsRequest; import com.schematic.api.resources.companies.requests.CountPlanTraitsRequest; import com.schematic.api.resources.companies.requests.CountUsersRequest; @@ -43,6 +44,7 @@ import com.schematic.api.resources.companies.requests.UpdatePlanTraitBulkRequestBody; import com.schematic.api.resources.companies.types.CountCompaniesResponse; import com.schematic.api.resources.companies.types.CountEntityKeyDefinitionsResponse; +import com.schematic.api.resources.companies.types.CountEntityKeysResponse; import com.schematic.api.resources.companies.types.CountEntityTraitDefinitionsResponse; import com.schematic.api.resources.companies.types.CountPlanTraitsResponse; import com.schematic.api.resources.companies.types.CountUsersResponse; @@ -51,6 +53,7 @@ import com.schematic.api.resources.companies.types.DeleteCompanyByKeysResponse; import com.schematic.api.resources.companies.types.DeleteCompanyMembershipResponse; import com.schematic.api.resources.companies.types.DeleteCompanyResponse; +import com.schematic.api.resources.companies.types.DeleteEntityKeyDefinitionResponse; import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; @@ -2077,6 +2080,106 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + public CompletableFuture> deleteEntityKeyDefinition( + String entityKeyDefinitionId) { + return deleteEntityKeyDefinition(entityKeyDefinitionId, null); + } + + public CompletableFuture> deleteEntityKeyDefinition( + String entityKeyDefinitionId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("entity-key-definitions") + .addPathSegment(entityKeyDefinitionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, DeleteEntityKeyDefinitionResponse.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 (JsonProcessingException e) { + future.completeExceptionally( + new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e)); + } 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> countEntityKeyDefinitions() { return countEntityKeyDefinitions( CountEntityKeyDefinitionsRequest.builder().build()); @@ -2205,6 +2308,128 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + public CompletableFuture> countEntityKeys() { + return countEntityKeys(CountEntityKeysRequest.builder().build()); + } + + public CompletableFuture> countEntityKeys( + RequestOptions requestOptions) { + return countEntityKeys(CountEntityKeysRequest.builder().build(), requestOptions); + } + + public CompletableFuture> countEntityKeys( + CountEntityKeysRequest request) { + return countEntityKeys(request, null); + } + + public CompletableFuture> countEntityKeys( + CountEntityKeysRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("entity-keys/count"); + if (request.getDefinitionId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "definition_id", request.getDefinitionId().get(), false); + } + if (request.getEntityType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "entity_type", request.getEntityType().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getOffset().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offset", request.getOffset().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); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, CountEntityKeysResponse.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 (JsonProcessingException e) { + future.completeExceptionally( + new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e)); + } 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> listEntityTraitDefinitions() { return listEntityTraitDefinitions( 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 ae907fb..1b228e1 100644 --- a/src/main/java/com/schematic/api/resources/companies/CompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/CompaniesClient.java @@ -7,6 +7,7 @@ import com.schematic.api.core.RequestOptions; import com.schematic.api.resources.companies.requests.CountCompaniesRequest; import com.schematic.api.resources.companies.requests.CountEntityKeyDefinitionsRequest; +import com.schematic.api.resources.companies.requests.CountEntityKeysRequest; import com.schematic.api.resources.companies.requests.CountEntityTraitDefinitionsRequest; import com.schematic.api.resources.companies.requests.CountPlanTraitsRequest; import com.schematic.api.resources.companies.requests.CountUsersRequest; @@ -30,6 +31,7 @@ import com.schematic.api.resources.companies.requests.UpdatePlanTraitBulkRequestBody; import com.schematic.api.resources.companies.types.CountCompaniesResponse; import com.schematic.api.resources.companies.types.CountEntityKeyDefinitionsResponse; +import com.schematic.api.resources.companies.types.CountEntityKeysResponse; import com.schematic.api.resources.companies.types.CountEntityTraitDefinitionsResponse; import com.schematic.api.resources.companies.types.CountPlanTraitsResponse; import com.schematic.api.resources.companies.types.CountUsersResponse; @@ -38,6 +40,7 @@ import com.schematic.api.resources.companies.types.DeleteCompanyByKeysResponse; import com.schematic.api.resources.companies.types.DeleteCompanyMembershipResponse; import com.schematic.api.resources.companies.types.DeleteCompanyResponse; +import com.schematic.api.resources.companies.types.DeleteEntityKeyDefinitionResponse; import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; @@ -319,6 +322,17 @@ public ListEntityKeyDefinitionsResponse listEntityKeyDefinitions( return this.rawClient.listEntityKeyDefinitions(request, requestOptions).body(); } + public DeleteEntityKeyDefinitionResponse deleteEntityKeyDefinition(String entityKeyDefinitionId) { + return this.rawClient.deleteEntityKeyDefinition(entityKeyDefinitionId).body(); + } + + public DeleteEntityKeyDefinitionResponse deleteEntityKeyDefinition( + String entityKeyDefinitionId, RequestOptions requestOptions) { + return this.rawClient + .deleteEntityKeyDefinition(entityKeyDefinitionId, requestOptions) + .body(); + } + public CountEntityKeyDefinitionsResponse countEntityKeyDefinitions() { return this.rawClient.countEntityKeyDefinitions().body(); } @@ -336,6 +350,22 @@ public CountEntityKeyDefinitionsResponse countEntityKeyDefinitions( return this.rawClient.countEntityKeyDefinitions(request, requestOptions).body(); } + public CountEntityKeysResponse countEntityKeys() { + return this.rawClient.countEntityKeys().body(); + } + + public CountEntityKeysResponse countEntityKeys(RequestOptions requestOptions) { + return this.rawClient.countEntityKeys(requestOptions).body(); + } + + public CountEntityKeysResponse countEntityKeys(CountEntityKeysRequest request) { + return this.rawClient.countEntityKeys(request).body(); + } + + public CountEntityKeysResponse countEntityKeys(CountEntityKeysRequest request, RequestOptions requestOptions) { + return this.rawClient.countEntityKeys(request, requestOptions).body(); + } + public ListEntityTraitDefinitionsResponse listEntityTraitDefinitions() { return this.rawClient.listEntityTraitDefinitions().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 45b682d..a1493cc 100644 --- a/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java +++ b/src/main/java/com/schematic/api/resources/companies/RawCompaniesClient.java @@ -20,6 +20,7 @@ import com.schematic.api.errors.UnauthorizedError; import com.schematic.api.resources.companies.requests.CountCompaniesRequest; import com.schematic.api.resources.companies.requests.CountEntityKeyDefinitionsRequest; +import com.schematic.api.resources.companies.requests.CountEntityKeysRequest; import com.schematic.api.resources.companies.requests.CountEntityTraitDefinitionsRequest; import com.schematic.api.resources.companies.requests.CountPlanTraitsRequest; import com.schematic.api.resources.companies.requests.CountUsersRequest; @@ -43,6 +44,7 @@ import com.schematic.api.resources.companies.requests.UpdatePlanTraitBulkRequestBody; import com.schematic.api.resources.companies.types.CountCompaniesResponse; import com.schematic.api.resources.companies.types.CountEntityKeyDefinitionsResponse; +import com.schematic.api.resources.companies.types.CountEntityKeysResponse; import com.schematic.api.resources.companies.types.CountEntityTraitDefinitionsResponse; import com.schematic.api.resources.companies.types.CountPlanTraitsResponse; import com.schematic.api.resources.companies.types.CountUsersResponse; @@ -51,6 +53,7 @@ import com.schematic.api.resources.companies.types.DeleteCompanyByKeysResponse; import com.schematic.api.resources.companies.types.DeleteCompanyMembershipResponse; import com.schematic.api.resources.companies.types.DeleteCompanyResponse; +import com.schematic.api.resources.companies.types.DeleteEntityKeyDefinitionResponse; import com.schematic.api.resources.companies.types.DeleteUserByKeysResponse; import com.schematic.api.resources.companies.types.DeleteUserResponse; import com.schematic.api.resources.companies.types.GetActiveCompanySubscriptionResponse; @@ -1661,6 +1664,81 @@ public BaseSchematicHttpResponse listEntityKey } } + public BaseSchematicHttpResponse deleteEntityKeyDefinition( + String entityKeyDefinitionId) { + return deleteEntityKeyDefinition(entityKeyDefinitionId, null); + } + + public BaseSchematicHttpResponse deleteEntityKeyDefinition( + String entityKeyDefinitionId, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("entity-key-definitions") + .addPathSegment(entityKeyDefinitionId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, DeleteEntityKeyDefinitionResponse.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 (JsonProcessingException e) { + throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } + public BaseSchematicHttpResponse countEntityKeyDefinitions() { return countEntityKeyDefinitions( CountEntityKeyDefinitionsRequest.builder().build()); @@ -1764,6 +1842,102 @@ public BaseSchematicHttpResponse countEntityK } } + public BaseSchematicHttpResponse countEntityKeys() { + return countEntityKeys(CountEntityKeysRequest.builder().build()); + } + + public BaseSchematicHttpResponse countEntityKeys(RequestOptions requestOptions) { + return countEntityKeys(CountEntityKeysRequest.builder().build(), requestOptions); + } + + public BaseSchematicHttpResponse countEntityKeys(CountEntityKeysRequest request) { + return countEntityKeys(request, null); + } + + public BaseSchematicHttpResponse countEntityKeys( + CountEntityKeysRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("entity-keys/count"); + if (request.getDefinitionId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "definition_id", request.getDefinitionId().get(), false); + } + if (request.getEntityType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "entity_type", request.getEntityType().get(), false); + } + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getOffset().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "offset", request.getOffset().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); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + 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, CountEntityKeysResponse.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 (JsonProcessingException e) { + throw new BaseSchematicException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new BaseSchematicException("Network error executing HTTP request", e); + } + } + public BaseSchematicHttpResponse listEntityTraitDefinitions() { return listEntityTraitDefinitions( ListEntityTraitDefinitionsRequest.builder().build()); diff --git a/src/main/java/com/schematic/api/resources/companies/requests/CountEntityKeysRequest.java b/src/main/java/com/schematic/api/resources/companies/requests/CountEntityKeysRequest.java new file mode 100644 index 0000000..cbdbd8e --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/requests/CountEntityKeysRequest.java @@ -0,0 +1,192 @@ +/** + * 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 com.schematic.api.types.EntityType; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CountEntityKeysRequest.Builder.class) +public final class CountEntityKeysRequest { + private final Optional definitionId; + + private final Optional entityType; + + private final Optional limit; + + private final Optional offset; + + private final Map additionalProperties; + + private CountEntityKeysRequest( + Optional definitionId, + Optional entityType, + Optional limit, + Optional offset, + Map additionalProperties) { + this.definitionId = definitionId; + this.entityType = entityType; + this.limit = limit; + this.offset = offset; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("definition_id") + public Optional getDefinitionId() { + return definitionId; + } + + @JsonProperty("entity_type") + public Optional getEntityType() { + return entityType; + } + + /** + * @return Page limit (default 100) + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return Page offset (default 0) + */ + @JsonProperty("offset") + public Optional getOffset() { + return offset; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CountEntityKeysRequest && equalTo((CountEntityKeysRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CountEntityKeysRequest other) { + return definitionId.equals(other.definitionId) + && entityType.equals(other.entityType) + && limit.equals(other.limit) + && offset.equals(other.offset); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.definitionId, this.entityType, this.limit, this.offset); + } + + @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 definitionId = Optional.empty(); + + private Optional entityType = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional offset = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CountEntityKeysRequest other) { + definitionId(other.getDefinitionId()); + entityType(other.getEntityType()); + limit(other.getLimit()); + offset(other.getOffset()); + return this; + } + + @JsonSetter(value = "definition_id", nulls = Nulls.SKIP) + public Builder definitionId(Optional definitionId) { + this.definitionId = definitionId; + return this; + } + + public Builder definitionId(String definitionId) { + this.definitionId = Optional.ofNullable(definitionId); + return this; + } + + @JsonSetter(value = "entity_type", nulls = Nulls.SKIP) + public Builder entityType(Optional entityType) { + this.entityType = entityType; + return this; + } + + public Builder entityType(EntityType entityType) { + this.entityType = Optional.ofNullable(entityType); + return this; + } + + /** + *

Page limit (default 100)

+ */ + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Long limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

Page offset (default 0)

+ */ + @JsonSetter(value = "offset", nulls = Nulls.SKIP) + public Builder offset(Optional offset) { + this.offset = offset; + return this; + } + + public Builder offset(Long offset) { + this.offset = Optional.ofNullable(offset); + return this; + } + + public CountEntityKeysRequest build() { + return new CountEntityKeysRequest(definitionId, entityType, limit, offset, 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/CountEntityKeysParams.java b/src/main/java/com/schematic/api/resources/companies/types/CountEntityKeysParams.java new file mode 100644 index 0000000..df555a8 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/types/CountEntityKeysParams.java @@ -0,0 +1,192 @@ +/** + * 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.EntityType; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CountEntityKeysParams.Builder.class) +public final class CountEntityKeysParams { + private final Optional definitionId; + + private final Optional entityType; + + private final Optional limit; + + private final Optional offset; + + private final Map additionalProperties; + + private CountEntityKeysParams( + Optional definitionId, + Optional entityType, + Optional limit, + Optional offset, + Map additionalProperties) { + this.definitionId = definitionId; + this.entityType = entityType; + this.limit = limit; + this.offset = offset; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("definition_id") + public Optional getDefinitionId() { + return definitionId; + } + + @JsonProperty("entity_type") + public Optional getEntityType() { + return entityType; + } + + /** + * @return Page limit (default 100) + */ + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + /** + * @return Page offset (default 0) + */ + @JsonProperty("offset") + public Optional getOffset() { + return offset; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CountEntityKeysParams && equalTo((CountEntityKeysParams) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CountEntityKeysParams other) { + return definitionId.equals(other.definitionId) + && entityType.equals(other.entityType) + && limit.equals(other.limit) + && offset.equals(other.offset); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.definitionId, this.entityType, this.limit, this.offset); + } + + @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 definitionId = Optional.empty(); + + private Optional entityType = Optional.empty(); + + private Optional limit = Optional.empty(); + + private Optional offset = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CountEntityKeysParams other) { + definitionId(other.getDefinitionId()); + entityType(other.getEntityType()); + limit(other.getLimit()); + offset(other.getOffset()); + return this; + } + + @JsonSetter(value = "definition_id", nulls = Nulls.SKIP) + public Builder definitionId(Optional definitionId) { + this.definitionId = definitionId; + return this; + } + + public Builder definitionId(String definitionId) { + this.definitionId = Optional.ofNullable(definitionId); + return this; + } + + @JsonSetter(value = "entity_type", nulls = Nulls.SKIP) + public Builder entityType(Optional entityType) { + this.entityType = entityType; + return this; + } + + public Builder entityType(EntityType entityType) { + this.entityType = Optional.ofNullable(entityType); + return this; + } + + /** + *

Page limit (default 100)

+ */ + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Long limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + *

Page offset (default 0)

+ */ + @JsonSetter(value = "offset", nulls = Nulls.SKIP) + public Builder offset(Optional offset) { + this.offset = offset; + return this; + } + + public Builder offset(Long offset) { + this.offset = Optional.ofNullable(offset); + return this; + } + + public CountEntityKeysParams build() { + return new CountEntityKeysParams(definitionId, entityType, limit, offset, 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/CountEntityKeysResponse.java b/src/main/java/com/schematic/api/resources/companies/types/CountEntityKeysResponse.java new file mode 100644 index 0000000..2a12b7c --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/types/CountEntityKeysResponse.java @@ -0,0 +1,152 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.CountResponse; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CountEntityKeysResponse.Builder.class) +public final class CountEntityKeysResponse { + private final CountResponse data; + + private final CountEntityKeysParams params; + + private final Map additionalProperties; + + private CountEntityKeysResponse( + CountResponse data, CountEntityKeysParams params, Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public CountResponse getData() { + return data; + } + + /** + * @return Input parameters + */ + @JsonProperty("params") + public CountEntityKeysParams getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CountEntityKeysResponse && equalTo((CountEntityKeysResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CountEntityKeysResponse 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 DataStage builder() { + return new Builder(); + } + + public interface DataStage { + ParamsStage data(@NotNull CountResponse data); + + Builder from(CountEntityKeysResponse other); + } + + public interface ParamsStage { + /** + *

Input parameters

+ */ + _FinalStage params(@NotNull CountEntityKeysParams params); + } + + public interface _FinalStage { + CountEntityKeysResponse build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DataStage, ParamsStage, _FinalStage { + private CountResponse data; + + private CountEntityKeysParams params; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CountEntityKeysResponse other) { + data(other.getData()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public ParamsStage data(@NotNull CountResponse data) { + this.data = Objects.requireNonNull(data, "data must not be null"); + return this; + } + + /** + *

Input parameters

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("params") + public _FinalStage params(@NotNull CountEntityKeysParams params) { + this.params = Objects.requireNonNull(params, "params must not be null"); + return this; + } + + @java.lang.Override + public CountEntityKeysResponse build() { + return new CountEntityKeysResponse(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/DeleteEntityKeyDefinitionResponse.java b/src/main/java/com/schematic/api/resources/companies/types/DeleteEntityKeyDefinitionResponse.java new file mode 100644 index 0000000..03a97c2 --- /dev/null +++ b/src/main/java/com/schematic/api/resources/companies/types/DeleteEntityKeyDefinitionResponse.java @@ -0,0 +1,181 @@ +/** + * 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.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import com.schematic.api.types.DeleteResponse; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteEntityKeyDefinitionResponse.Builder.class) +public final class DeleteEntityKeyDefinitionResponse { + private final DeleteResponse data; + + private final Map params; + + private final Map additionalProperties; + + private DeleteEntityKeyDefinitionResponse( + DeleteResponse data, Map params, Map additionalProperties) { + this.data = data; + this.params = params; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("data") + public DeleteResponse getData() { + return data; + } + + /** + * @return Input parameters + */ + @JsonProperty("params") + public Map getParams() { + return params; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteEntityKeyDefinitionResponse && equalTo((DeleteEntityKeyDefinitionResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteEntityKeyDefinitionResponse 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 DataStage builder() { + return new Builder(); + } + + public interface DataStage { + _FinalStage data(@NotNull DeleteResponse data); + + Builder from(DeleteEntityKeyDefinitionResponse other); + } + + public interface _FinalStage { + DeleteEntityKeyDefinitionResponse build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Input parameters

+ */ + _FinalStage params(Map params); + + _FinalStage putAllParams(Map params); + + _FinalStage params(String key, JsonNode value); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DataStage, _FinalStage { + private DeleteResponse data; + + private Map params = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DeleteEntityKeyDefinitionResponse other) { + data(other.getData()); + params(other.getParams()); + return this; + } + + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull DeleteResponse data) { + this.data = Objects.requireNonNull(data, "data must not be null"); + return this; + } + + /** + *

Input parameters

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage params(String key, JsonNode value) { + this.params.put(key, value); + return this; + } + + /** + *

Input parameters

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage putAllParams(Map params) { + if (params != null) { + this.params.putAll(params); + } + return this; + } + + /** + *

Input parameters

+ */ + @java.lang.Override + @JsonSetter(value = "params", nulls = Nulls.SKIP) + public _FinalStage params(Map params) { + this.params.clear(); + if (params != null) { + this.params.putAll(params); + } + return this; + } + + @java.lang.Override + public DeleteEntityKeyDefinitionResponse build() { + return new DeleteEntityKeyDefinitionResponse(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/BillingCreditView.java b/src/main/java/com/schematic/api/types/BillingCreditView.java index 89031b6..29fc500 100644 --- a/src/main/java/com/schematic/api/types/BillingCreditView.java +++ b/src/main/java/com/schematic/api/types/BillingCreditView.java @@ -60,7 +60,7 @@ public final class BillingCreditView { private final Optional pricePerUnitDecimal; - private final Optional product; + private final Optional product; private final Optional singularName; @@ -87,7 +87,7 @@ private BillingCreditView( Optional price, Optional pricePerUnit, Optional pricePerUnitDecimal, - Optional product, + Optional product, Optional singularName, OffsetDateTime updatedAt, Map additionalProperties) { @@ -206,7 +206,7 @@ public Optional getPricePerUnitDecimal() { } @JsonProperty("product") - public Optional getProduct() { + public Optional getProduct() { return product; } @@ -377,9 +377,9 @@ public interface _FinalStage { _FinalStage pricePerUnitDecimal(String pricePerUnitDecimal); - _FinalStage product(Optional product); + _FinalStage product(Optional product); - _FinalStage product(BillingProductResponseData product); + _FinalStage product(BillingProductRecordResponseData product); _FinalStage singularName(Optional singularName); @@ -427,7 +427,7 @@ public static final class Builder private Optional singularName = Optional.empty(); - private Optional product = Optional.empty(); + private Optional product = Optional.empty(); private Optional pricePerUnitDecimal = Optional.empty(); @@ -573,14 +573,14 @@ public _FinalStage singularName(Optional singularName) { } @java.lang.Override - public _FinalStage product(BillingProductResponseData product) { + public _FinalStage product(BillingProductRecordResponseData product) { this.product = Optional.ofNullable(product); return this; } @java.lang.Override @JsonSetter(value = "product", nulls = Nulls.SKIP) - public _FinalStage product(Optional product) { + public _FinalStage product(Optional product) { this.product = product; return this; } diff --git a/src/main/java/com/schematic/api/types/BillingProductRecordResponseData.java b/src/main/java/com/schematic/api/types/BillingProductRecordResponseData.java new file mode 100644 index 0000000..3e7f6c2 --- /dev/null +++ b/src/main/java/com/schematic/api/types/BillingProductRecordResponseData.java @@ -0,0 +1,342 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.schematic.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BillingProductRecordResponseData.Builder.class) +public final class BillingProductRecordResponseData { + private final String accountId; + + private final OffsetDateTime createdAt; + + private final String environmentId; + + private final String externalId; + + private final String id; + + private final boolean isActive; + + private final String name; + + private final BillingProviderType providerType; + + private final OffsetDateTime updatedAt; + + private final Map additionalProperties; + + private BillingProductRecordResponseData( + String accountId, + OffsetDateTime createdAt, + String environmentId, + String externalId, + String id, + boolean isActive, + String name, + BillingProviderType providerType, + OffsetDateTime updatedAt, + Map additionalProperties) { + this.accountId = accountId; + this.createdAt = createdAt; + this.environmentId = environmentId; + this.externalId = externalId; + this.id = id; + this.isActive = isActive; + this.name = name; + this.providerType = providerType; + this.updatedAt = updatedAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_id") + public String getAccountId() { + return accountId; + } + + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + @JsonProperty("environment_id") + public String getEnvironmentId() { + return environmentId; + } + + @JsonProperty("external_id") + public String getExternalId() { + return externalId; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("provider_type") + public BillingProviderType getProviderType() { + return providerType; + } + + @JsonProperty("updated_at") + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BillingProductRecordResponseData && equalTo((BillingProductRecordResponseData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BillingProductRecordResponseData other) { + return accountId.equals(other.accountId) + && createdAt.equals(other.createdAt) + && environmentId.equals(other.environmentId) + && externalId.equals(other.externalId) + && id.equals(other.id) + && isActive == other.isActive + && name.equals(other.name) + && providerType.equals(other.providerType) + && updatedAt.equals(other.updatedAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountId, + this.createdAt, + this.environmentId, + this.externalId, + this.id, + this.isActive, + this.name, + this.providerType, + this.updatedAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountIdStage builder() { + return new Builder(); + } + + public interface AccountIdStage { + CreatedAtStage accountId(@NotNull String accountId); + + Builder from(BillingProductRecordResponseData other); + } + + public interface CreatedAtStage { + EnvironmentIdStage createdAt(@NotNull OffsetDateTime createdAt); + } + + public interface EnvironmentIdStage { + ExternalIdStage environmentId(@NotNull String environmentId); + } + + public interface ExternalIdStage { + IdStage externalId(@NotNull String externalId); + } + + public interface IdStage { + IsActiveStage id(@NotNull String id); + } + + public interface IsActiveStage { + NameStage isActive(boolean isActive); + } + + public interface NameStage { + ProviderTypeStage name(@NotNull String name); + } + + public interface ProviderTypeStage { + UpdatedAtStage providerType(@NotNull BillingProviderType providerType); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); + } + + public interface _FinalStage { + BillingProductRecordResponseData build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AccountIdStage, + CreatedAtStage, + EnvironmentIdStage, + ExternalIdStage, + IdStage, + IsActiveStage, + NameStage, + ProviderTypeStage, + UpdatedAtStage, + _FinalStage { + private String accountId; + + private OffsetDateTime createdAt; + + private String environmentId; + + private String externalId; + + private String id; + + private boolean isActive; + + private String name; + + private BillingProviderType providerType; + + private OffsetDateTime updatedAt; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BillingProductRecordResponseData other) { + accountId(other.getAccountId()); + createdAt(other.getCreatedAt()); + environmentId(other.getEnvironmentId()); + externalId(other.getExternalId()); + id(other.getId()); + isActive(other.getIsActive()); + name(other.getName()); + providerType(other.getProviderType()); + updatedAt(other.getUpdatedAt()); + return this; + } + + @java.lang.Override + @JsonSetter("account_id") + public CreatedAtStage accountId(@NotNull String accountId) { + this.accountId = Objects.requireNonNull(accountId, "accountId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("created_at") + public EnvironmentIdStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("environment_id") + public ExternalIdStage environmentId(@NotNull String environmentId) { + this.environmentId = Objects.requireNonNull(environmentId, "environmentId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("external_id") + public IdStage externalId(@NotNull String externalId) { + this.externalId = Objects.requireNonNull(externalId, "externalId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public IsActiveStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public NameStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ProviderTypeStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("provider_type") + public UpdatedAtStage providerType(@NotNull BillingProviderType providerType) { + this.providerType = Objects.requireNonNull(providerType, "providerType must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("updated_at") + public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); + return this; + } + + @java.lang.Override + public BillingProductRecordResponseData build() { + return new BillingProductRecordResponseData( + accountId, + createdAt, + environmentId, + externalId, + id, + isActive, + name, + providerType, + updatedAt, + 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/CompanyFeatureUsageExportMetadata.java b/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadata.java index fc76779..7b1e4dc 100644 --- a/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadata.java +++ b/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadata.java @@ -12,7 +12,6 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.schematic.api.core.ObjectMappers; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -26,7 +25,7 @@ public final class CompanyFeatureUsageExportMetadata { private final Optional> creditTypeIds; - private final List featureIds; + private final Optional> featureIds; private final Optional hasScheduledDowngrade; @@ -42,10 +41,16 @@ public final class CompanyFeatureUsageExportMetadata { private final Optional q; + private final Optional sortOrderColumn; + + private final Optional sortOrderDirection; + private final Optional> subscriptionStatuses; private final Optional> subscriptionTypes; + private final Optional> visibleColumns; + private final Optional withEntitlementFor; private final Optional withSubscription; @@ -61,7 +66,7 @@ public final class CompanyFeatureUsageExportMetadata { private CompanyFeatureUsageExportMetadata( Optional> companyIds, Optional> creditTypeIds, - List featureIds, + Optional> featureIds, Optional hasScheduledDowngrade, Optional monetizedSubscriptions, Optional> notificationEmailRecipientEmailAddresses, @@ -69,8 +74,11 @@ private CompanyFeatureUsageExportMetadata( Optional> planIds, Optional planVersionId, Optional q, + Optional sortOrderColumn, + Optional sortOrderDirection, Optional> subscriptionStatuses, Optional> subscriptionTypes, + Optional> visibleColumns, Optional withEntitlementFor, Optional withSubscription, Optional withoutFeatureOverrideFor, @@ -87,8 +95,11 @@ private CompanyFeatureUsageExportMetadata( this.planIds = planIds; this.planVersionId = planVersionId; this.q = q; + this.sortOrderColumn = sortOrderColumn; + this.sortOrderDirection = sortOrderDirection; this.subscriptionStatuses = subscriptionStatuses; this.subscriptionTypes = subscriptionTypes; + this.visibleColumns = visibleColumns; this.withEntitlementFor = withEntitlementFor; this.withSubscription = withSubscription; this.withoutFeatureOverrideFor = withoutFeatureOverrideFor; @@ -114,10 +125,10 @@ public Optional> getCreditTypeIds() { } /** - * @return Schematic feature IDs (starting with 'feat_') to include as usage columns; at least one is required + * @return Schematic feature IDs (starting with 'feat_') to include as usage columns; empty means no usage columns */ @JsonProperty("feature_ids") - public List getFeatureIds() { + public Optional> getFeatureIds() { return featureIds; } @@ -177,6 +188,22 @@ public Optional getQ() { return q; } + /** + * @return Column to sort the exported rows by (e.g. name, created_at, plan); defaults to name + */ + @JsonProperty("sort_order_column") + public Optional getSortOrderColumn() { + return sortOrderColumn; + } + + /** + * @return Direction to sort the exported rows by; defaults to asc + */ + @JsonProperty("sort_order_direction") + public Optional getSortOrderDirection() { + return sortOrderDirection; + } + /** * @return Restrict the export to companies whose subscription has one of these statuses */ @@ -193,6 +220,14 @@ public Optional> getSubscriptionTypes() { return subscriptionTypes; } + /** + * @return Company columns to include, mirroring the companies list; omit to include the plan column only + */ + @JsonProperty("visible_columns") + public Optional> getVisibleColumns() { + return visibleColumns; + } + /** * @return Restrict the export to companies that have an entitlement for this feature ID */ @@ -255,8 +290,11 @@ private boolean equalTo(CompanyFeatureUsageExportMetadata other) { && planIds.equals(other.planIds) && planVersionId.equals(other.planVersionId) && q.equals(other.q) + && sortOrderColumn.equals(other.sortOrderColumn) + && sortOrderDirection.equals(other.sortOrderDirection) && subscriptionStatuses.equals(other.subscriptionStatuses) && subscriptionTypes.equals(other.subscriptionTypes) + && visibleColumns.equals(other.visibleColumns) && withEntitlementFor.equals(other.withEntitlementFor) && withSubscription.equals(other.withSubscription) && withoutFeatureOverrideFor.equals(other.withoutFeatureOverrideFor) @@ -277,8 +315,11 @@ public int hashCode() { this.planIds, this.planVersionId, this.q, + this.sortOrderColumn, + this.sortOrderDirection, this.subscriptionStatuses, this.subscriptionTypes, + this.visibleColumns, this.withEntitlementFor, this.withSubscription, this.withoutFeatureOverrideFor, @@ -301,7 +342,7 @@ public static final class Builder { private Optional> creditTypeIds = Optional.empty(); - private List featureIds = new ArrayList<>(); + private Optional> featureIds = Optional.empty(); private Optional hasScheduledDowngrade = Optional.empty(); @@ -317,10 +358,16 @@ public static final class Builder { private Optional q = Optional.empty(); + private Optional sortOrderColumn = Optional.empty(); + + private Optional sortOrderDirection = Optional.empty(); + private Optional> subscriptionStatuses = Optional.empty(); private Optional> subscriptionTypes = Optional.empty(); + private Optional> visibleColumns = Optional.empty(); + private Optional withEntitlementFor = Optional.empty(); private Optional withSubscription = Optional.empty(); @@ -347,8 +394,11 @@ public Builder from(CompanyFeatureUsageExportMetadata other) { planIds(other.getPlanIds()); planVersionId(other.getPlanVersionId()); q(other.getQ()); + sortOrderColumn(other.getSortOrderColumn()); + sortOrderDirection(other.getSortOrderDirection()); subscriptionStatuses(other.getSubscriptionStatuses()); subscriptionTypes(other.getSubscriptionTypes()); + visibleColumns(other.getVisibleColumns()); withEntitlementFor(other.getWithEntitlementFor()); withSubscription(other.getWithSubscription()); withoutFeatureOverrideFor(other.getWithoutFeatureOverrideFor()); @@ -386,26 +436,16 @@ public Builder creditTypeIds(List creditTypeIds) { } /** - *

Schematic feature IDs (starting with 'feat_') to include as usage columns; at least one is required

+ *

Schematic feature IDs (starting with 'feat_') to include as usage columns; empty means no usage columns

*/ @JsonSetter(value = "feature_ids", nulls = Nulls.SKIP) - public Builder featureIds(List featureIds) { - this.featureIds.clear(); - if (featureIds != null) { - this.featureIds.addAll(featureIds); - } - return this; - } - - public Builder addFeatureIds(String featureIds) { - this.featureIds.add(featureIds); + public Builder featureIds(Optional> featureIds) { + this.featureIds = featureIds; return this; } - public Builder addAllFeatureIds(List featureIds) { - if (featureIds != null) { - this.featureIds.addAll(featureIds); - } + public Builder featureIds(List featureIds) { + this.featureIds = Optional.ofNullable(featureIds); return this; } @@ -509,6 +549,35 @@ public Builder q(String q) { return this; } + /** + *

Column to sort the exported rows by (e.g. name, created_at, plan); defaults to name

+ */ + @JsonSetter(value = "sort_order_column", nulls = Nulls.SKIP) + public Builder sortOrderColumn(Optional sortOrderColumn) { + this.sortOrderColumn = sortOrderColumn; + return this; + } + + public Builder sortOrderColumn(String sortOrderColumn) { + this.sortOrderColumn = Optional.ofNullable(sortOrderColumn); + return this; + } + + /** + *

Direction to sort the exported rows by; defaults to asc

+ */ + @JsonSetter(value = "sort_order_direction", nulls = Nulls.SKIP) + public Builder sortOrderDirection( + Optional sortOrderDirection) { + this.sortOrderDirection = sortOrderDirection; + return this; + } + + public Builder sortOrderDirection(CompanyFeatureUsageExportMetadataSortOrderDirection sortOrderDirection) { + this.sortOrderDirection = Optional.ofNullable(sortOrderDirection); + return this; + } + /** *

Restrict the export to companies whose subscription has one of these statuses

*/ @@ -537,6 +606,21 @@ public Builder subscriptionTypes(List subscriptionTypes) { return this; } + /** + *

Company columns to include, mirroring the companies list; omit to include the plan column only

+ */ + @JsonSetter(value = "visible_columns", nulls = Nulls.SKIP) + public Builder visibleColumns( + Optional> visibleColumns) { + this.visibleColumns = visibleColumns; + return this; + } + + public Builder visibleColumns(List visibleColumns) { + this.visibleColumns = Optional.ofNullable(visibleColumns); + return this; + } + /** *

Restrict the export to companies that have an entitlement for this feature ID

*/ @@ -619,8 +703,11 @@ public CompanyFeatureUsageExportMetadata build() { planIds, planVersionId, q, + sortOrderColumn, + sortOrderDirection, subscriptionStatuses, subscriptionTypes, + visibleColumns, withEntitlementFor, withSubscription, withoutFeatureOverrideFor, diff --git a/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadataSortOrderDirection.java b/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadataSortOrderDirection.java new file mode 100644 index 0000000..d76c55a --- /dev/null +++ b/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadataSortOrderDirection.java @@ -0,0 +1,86 @@ +/** + * 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 CompanyFeatureUsageExportMetadataSortOrderDirection { + public static final CompanyFeatureUsageExportMetadataSortOrderDirection ASC = + new CompanyFeatureUsageExportMetadataSortOrderDirection(Value.ASC, "asc"); + + public static final CompanyFeatureUsageExportMetadataSortOrderDirection DESC = + new CompanyFeatureUsageExportMetadataSortOrderDirection(Value.DESC, "desc"); + + private final Value value; + + private final String string; + + CompanyFeatureUsageExportMetadataSortOrderDirection(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 CompanyFeatureUsageExportMetadataSortOrderDirection + && this.string.equals(((CompanyFeatureUsageExportMetadataSortOrderDirection) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ASC: + return visitor.visitAsc(); + case DESC: + return visitor.visitDesc(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CompanyFeatureUsageExportMetadataSortOrderDirection valueOf(String value) { + switch (value) { + case "asc": + return ASC; + case "desc": + return DESC; + default: + return new CompanyFeatureUsageExportMetadataSortOrderDirection(Value.UNKNOWN, value); + } + } + + public enum Value { + ASC, + + DESC, + + UNKNOWN + } + + public interface Visitor { + T visitAsc(); + + T visitDesc(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadataVisibleColumnsItem.java b/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadataVisibleColumnsItem.java new file mode 100644 index 0000000..5de7356 --- /dev/null +++ b/src/main/java/com/schematic/api/types/CompanyFeatureUsageExportMetadataVisibleColumnsItem.java @@ -0,0 +1,108 @@ +/** + * 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 CompanyFeatureUsageExportMetadataVisibleColumnsItem { + public static final CompanyFeatureUsageExportMetadataVisibleColumnsItem PLAN = + new CompanyFeatureUsageExportMetadataVisibleColumnsItem(Value.PLAN, "plan"); + + public static final CompanyFeatureUsageExportMetadataVisibleColumnsItem SUBSCRIPTION = + new CompanyFeatureUsageExportMetadataVisibleColumnsItem(Value.SUBSCRIPTION, "subscription"); + + public static final CompanyFeatureUsageExportMetadataVisibleColumnsItem USERS = + new CompanyFeatureUsageExportMetadataVisibleColumnsItem(Value.USERS, "users"); + + public static final CompanyFeatureUsageExportMetadataVisibleColumnsItem LAST_SEEN_AT = + new CompanyFeatureUsageExportMetadataVisibleColumnsItem(Value.LAST_SEEN_AT, "last_seen_at"); + + private final Value value; + + private final String string; + + CompanyFeatureUsageExportMetadataVisibleColumnsItem(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 CompanyFeatureUsageExportMetadataVisibleColumnsItem + && this.string.equals(((CompanyFeatureUsageExportMetadataVisibleColumnsItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PLAN: + return visitor.visitPlan(); + case SUBSCRIPTION: + return visitor.visitSubscription(); + case USERS: + return visitor.visitUsers(); + case LAST_SEEN_AT: + return visitor.visitLastSeenAt(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CompanyFeatureUsageExportMetadataVisibleColumnsItem valueOf(String value) { + switch (value) { + case "plan": + return PLAN; + case "subscription": + return SUBSCRIPTION; + case "users": + return USERS; + case "last_seen_at": + return LAST_SEEN_AT; + default: + return new CompanyFeatureUsageExportMetadataVisibleColumnsItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PLAN, + + SUBSCRIPTION, + + USERS, + + LAST_SEEN_AT, + + UNKNOWN + } + + public interface Visitor { + T visitPlan(); + + T visitSubscription(); + + T visitUsers(); + + T visitLastSeenAt(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/schematic/api/types/DataExportMetadata.java b/src/main/java/com/schematic/api/types/DataExportMetadata.java index 407f0b9..b573b31 100644 --- a/src/main/java/com/schematic/api/types/DataExportMetadata.java +++ b/src/main/java/com/schematic/api/types/DataExportMetadata.java @@ -34,6 +34,10 @@ public static DataExportMetadata companyFeatureUsage(CompanyFeatureUsageExportMe return new DataExportMetadata(new CompanyFeatureUsageValue(value)); } + public static DataExportMetadata event(EventExportMetadata value) { + return new DataExportMetadata(new EventValue(value)); + } + public boolean isAuditLog() { return value instanceof AuditLogValue; } @@ -42,6 +46,10 @@ public boolean isCompanyFeatureUsage() { return value instanceof CompanyFeatureUsageValue; } + public boolean isEvent() { + return value instanceof EventValue; + } + public boolean _isUnknown() { return value instanceof _UnknownValue; } @@ -60,6 +68,13 @@ public Optional getCompanyFeatureUsage() { return Optional.empty(); } + public Optional getEvent() { + if (isEvent()) { + return Optional.of(((EventValue) value).value); + } + return Optional.empty(); + } + public Optional _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); @@ -93,6 +108,8 @@ public interface Visitor { T visitCompanyFeatureUsage(CompanyFeatureUsageExportMetadata companyFeatureUsage); + T visitEvent(EventExportMetadata event); + T _visitUnknown(Object unknownType); } @@ -101,7 +118,11 @@ public interface Visitor { property = "export_type", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(AuditLogValue.class), @JsonSubTypes.Type(CompanyFeatureUsageValue.class)}) + @JsonSubTypes({ + @JsonSubTypes.Type(AuditLogValue.class), + @JsonSubTypes.Type(CompanyFeatureUsageValue.class), + @JsonSubTypes.Type(EventValue.class) + }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { T visit(Visitor visitor); @@ -187,6 +208,46 @@ public String toString() { } } + @JsonTypeName("event") + @JsonIgnoreProperties("export_type") + private static final class EventValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "export_type", allowSetters = true) + private EventExportMetadata value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private EventValue() {} + + private EventValue(EventExportMetadata value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitEvent(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventValue && equalTo((EventValue) other); + } + + private boolean equalTo(EventValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "DataExportMetadata{" + "value: " + value + "}"; + } + } + @JsonIgnoreProperties("export_type") private static final class _UnknownValue implements Value { private String type; diff --git a/src/main/java/com/schematic/api/types/DataExportType.java b/src/main/java/com/schematic/api/types/DataExportType.java index 774c1f9..eb91f17 100644 --- a/src/main/java/com/schematic/api/types/DataExportType.java +++ b/src/main/java/com/schematic/api/types/DataExportType.java @@ -12,6 +12,8 @@ public final class DataExportType { public static final DataExportType AUDIT_LOG = new DataExportType(Value.AUDIT_LOG, "audit-log"); + public static final DataExportType EVENT = new DataExportType(Value.EVENT, "event"); + private final Value value; private final String string; @@ -48,6 +50,8 @@ public T visit(Visitor visitor) { return visitor.visitCompanyFeatureUsage(); case AUDIT_LOG: return visitor.visitAuditLog(); + case EVENT: + return visitor.visitEvent(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,6 +65,8 @@ public static DataExportType valueOf(String value) { return COMPANY_FEATURE_USAGE; case "audit-log": return AUDIT_LOG; + case "event": + return EVENT; default: return new DataExportType(Value.UNKNOWN, value); } @@ -71,6 +77,8 @@ public enum Value { COMPANY_FEATURE_USAGE, + EVENT, + UNKNOWN } @@ -79,6 +87,8 @@ public interface Visitor { T visitCompanyFeatureUsage(); + T visitEvent(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/schematic/api/types/EventExportMetadata.java b/src/main/java/com/schematic/api/types/EventExportMetadata.java new file mode 100644 index 0000000..ee313eb --- /dev/null +++ b/src/main/java/com/schematic/api/types/EventExportMetadata.java @@ -0,0 +1,344 @@ +/** + * 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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EventExportMetadata.Builder.class) +public final class EventExportMetadata { + private final Optional companyId; + + private final Optional endTime; + + private final Optional eventSubtype; + + private final Optional> eventTypes; + + private final Optional flagId; + + private final Optional> notificationEmailRecipientEmailAddresses; + + private final Optional startTime; + + private final Optional userId; + + private final Map additionalProperties; + + private EventExportMetadata( + Optional companyId, + Optional endTime, + Optional eventSubtype, + Optional> eventTypes, + Optional flagId, + Optional> notificationEmailRecipientEmailAddresses, + Optional startTime, + Optional userId, + Map additionalProperties) { + this.companyId = companyId; + this.endTime = endTime; + this.eventSubtype = eventSubtype; + this.eventTypes = eventTypes; + this.flagId = flagId; + this.notificationEmailRecipientEmailAddresses = notificationEmailRecipientEmailAddresses; + this.startTime = startTime; + this.userId = userId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Restrict the export to events for this company ID (starting with 'comp_') + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return Restrict the export to events captured at or before this time + */ + @JsonProperty("end_time") + public Optional getEndTime() { + return endTime; + } + + /** + * @return Restrict the export to track events with this subtype + */ + @JsonProperty("event_subtype") + public Optional getEventSubtype() { + return eventSubtype; + } + + /** + * @return Restrict the export to these event types (e.g. "track", "identify"); defaults to track, identify and inference events. Flag check events are only exported when requested here explicitly, and require a flag_id. + */ + @JsonProperty("event_types") + public Optional> getEventTypes() { + return eventTypes; + } + + /** + * @return Restrict the export to flag-check events for this flag ID (starting with 'flag_') + */ + @JsonProperty("flag_id") + public Optional getFlagId() { + return flagId; + } + + /** + * @return Account member emails to notify when the export completes; empty means the artifact is only retrievable via the API + */ + @JsonProperty("notification_email_recipient_email_addresses") + public Optional> getNotificationEmailRecipientEmailAddresses() { + return notificationEmailRecipientEmailAddresses; + } + + /** + * @return Restrict the export to events captured at or after this time + */ + @JsonProperty("start_time") + public Optional getStartTime() { + return startTime; + } + + /** + * @return Restrict the export to events for this user ID (starting with 'user_') + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EventExportMetadata && equalTo((EventExportMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EventExportMetadata other) { + return companyId.equals(other.companyId) + && endTime.equals(other.endTime) + && eventSubtype.equals(other.eventSubtype) + && eventTypes.equals(other.eventTypes) + && flagId.equals(other.flagId) + && notificationEmailRecipientEmailAddresses.equals(other.notificationEmailRecipientEmailAddresses) + && startTime.equals(other.startTime) + && userId.equals(other.userId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.companyId, + this.endTime, + this.eventSubtype, + this.eventTypes, + this.flagId, + this.notificationEmailRecipientEmailAddresses, + this.startTime, + this.userId); + } + + @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(); + + private Optional endTime = Optional.empty(); + + private Optional eventSubtype = Optional.empty(); + + private Optional> eventTypes = Optional.empty(); + + private Optional flagId = Optional.empty(); + + private Optional> notificationEmailRecipientEmailAddresses = Optional.empty(); + + private Optional startTime = Optional.empty(); + + private Optional userId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EventExportMetadata other) { + companyId(other.getCompanyId()); + endTime(other.getEndTime()); + eventSubtype(other.getEventSubtype()); + eventTypes(other.getEventTypes()); + flagId(other.getFlagId()); + notificationEmailRecipientEmailAddresses(other.getNotificationEmailRecipientEmailAddresses()); + startTime(other.getStartTime()); + userId(other.getUserId()); + return this; + } + + /** + *

Restrict the export to events for this company ID (starting with 'comp_')

+ */ + @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; + } + + /** + *

Restrict the export to events captured at or before this time

+ */ + @JsonSetter(value = "end_time", nulls = Nulls.SKIP) + public Builder endTime(Optional endTime) { + this.endTime = endTime; + return this; + } + + public Builder endTime(OffsetDateTime endTime) { + this.endTime = Optional.ofNullable(endTime); + return this; + } + + /** + *

Restrict the export to track events with this subtype

+ */ + @JsonSetter(value = "event_subtype", nulls = Nulls.SKIP) + public Builder eventSubtype(Optional eventSubtype) { + this.eventSubtype = eventSubtype; + return this; + } + + public Builder eventSubtype(String eventSubtype) { + this.eventSubtype = Optional.ofNullable(eventSubtype); + return this; + } + + /** + *

Restrict the export to these event types (e.g. "track", "identify"); defaults to track, identify and inference events. Flag check events are only exported when requested here explicitly, and require a flag_id.

+ */ + @JsonSetter(value = "event_types", nulls = Nulls.SKIP) + public Builder eventTypes(Optional> eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder eventTypes(List eventTypes) { + this.eventTypes = Optional.ofNullable(eventTypes); + return this; + } + + /** + *

Restrict the export to flag-check events for this flag ID (starting with 'flag_')

+ */ + @JsonSetter(value = "flag_id", nulls = Nulls.SKIP) + public Builder flagId(Optional flagId) { + this.flagId = flagId; + return this; + } + + public Builder flagId(String flagId) { + this.flagId = Optional.ofNullable(flagId); + return this; + } + + /** + *

Account member emails to notify when the export completes; empty means the artifact is only retrievable via the API

+ */ + @JsonSetter(value = "notification_email_recipient_email_addresses", nulls = Nulls.SKIP) + public Builder notificationEmailRecipientEmailAddresses( + Optional> notificationEmailRecipientEmailAddresses) { + this.notificationEmailRecipientEmailAddresses = notificationEmailRecipientEmailAddresses; + return this; + } + + public Builder notificationEmailRecipientEmailAddresses(List notificationEmailRecipientEmailAddresses) { + this.notificationEmailRecipientEmailAddresses = + Optional.ofNullable(notificationEmailRecipientEmailAddresses); + return this; + } + + /** + *

Restrict the export to events captured at or after this time

+ */ + @JsonSetter(value = "start_time", nulls = Nulls.SKIP) + public Builder startTime(Optional startTime) { + this.startTime = startTime; + return this; + } + + public Builder startTime(OffsetDateTime startTime) { + this.startTime = Optional.ofNullable(startTime); + return this; + } + + /** + *

Restrict the export to events for this user ID (starting with 'user_')

+ */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + public EventExportMetadata build() { + return new EventExportMetadata( + companyId, + endTime, + eventSubtype, + eventTypes, + flagId, + notificationEmailRecipientEmailAddresses, + startTime, + userId, + 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/types/EventExportMetadataEventTypesItem.java b/src/main/java/com/schematic/api/types/EventExportMetadataEventTypesItem.java new file mode 100644 index 0000000..7647c12 --- /dev/null +++ b/src/main/java/com/schematic/api/types/EventExportMetadataEventTypesItem.java @@ -0,0 +1,108 @@ +/** + * 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 EventExportMetadataEventTypesItem { + public static final EventExportMetadataEventTypesItem INFERENCE = + new EventExportMetadataEventTypesItem(Value.INFERENCE, "inference"); + + public static final EventExportMetadataEventTypesItem FLAG_CHECK = + new EventExportMetadataEventTypesItem(Value.FLAG_CHECK, "flag_check"); + + public static final EventExportMetadataEventTypesItem TRACK = + new EventExportMetadataEventTypesItem(Value.TRACK, "track"); + + public static final EventExportMetadataEventTypesItem IDENTIFY = + new EventExportMetadataEventTypesItem(Value.IDENTIFY, "identify"); + + private final Value value; + + private final String string; + + EventExportMetadataEventTypesItem(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 EventExportMetadataEventTypesItem + && this.string.equals(((EventExportMetadataEventTypesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case INFERENCE: + return visitor.visitInference(); + case FLAG_CHECK: + return visitor.visitFlagCheck(); + case TRACK: + return visitor.visitTrack(); + case IDENTIFY: + return visitor.visitIdentify(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventExportMetadataEventTypesItem valueOf(String value) { + switch (value) { + case "inference": + return INFERENCE; + case "flag_check": + return FLAG_CHECK; + case "track": + return TRACK; + case "identify": + return IDENTIFY; + default: + return new EventExportMetadataEventTypesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + FLAG_CHECK, + + IDENTIFY, + + INFERENCE, + + TRACK, + + UNKNOWN + } + + public interface Visitor { + T visitFlagCheck(); + + T visitIdentify(); + + T visitInference(); + + T visitTrack(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/schematic/api/types/FeatureView.java b/src/main/java/com/schematic/api/types/FeatureView.java index 9abc1d8..3940826 100644 --- a/src/main/java/com/schematic/api/types/FeatureView.java +++ b/src/main/java/com/schematic/api/types/FeatureView.java @@ -28,7 +28,7 @@ public final class FeatureView { private final Optional billingLinkedResource; - private final Optional billingProduct; + private final Optional billingProduct; private final OffsetDateTime createdAt; @@ -71,7 +71,7 @@ public final class FeatureView { private FeatureView( String accountId, Optional billingLinkedResource, - Optional billingProduct, + Optional billingProduct, OffsetDateTime createdAt, String description, Optional eventSubtype, @@ -126,7 +126,7 @@ public Optional getBillingLinkedResource() { } @JsonProperty("billing_product") - public Optional getBillingProduct() { + public Optional getBillingProduct() { return billingProduct; } @@ -335,9 +335,9 @@ public interface _FinalStage { _FinalStage billingLinkedResource(BillingLinkedResourceResponseData billingLinkedResource); - _FinalStage billingProduct(Optional billingProduct); + _FinalStage billingProduct(Optional billingProduct); - _FinalStage billingProduct(BillingProductResponseData billingProduct); + _FinalStage billingProduct(BillingProductRecordResponseData billingProduct); _FinalStage eventSubtype(Optional eventSubtype); @@ -437,7 +437,7 @@ public static final class Builder private Optional eventSubtype = Optional.empty(); - private Optional billingProduct = Optional.empty(); + private Optional billingProduct = Optional.empty(); private Optional billingLinkedResource = Optional.empty(); @@ -694,14 +694,14 @@ public _FinalStage eventSubtype(Optional eventSubtype) { } @java.lang.Override - public _FinalStage billingProduct(BillingProductResponseData billingProduct) { + public _FinalStage billingProduct(BillingProductRecordResponseData billingProduct) { this.billingProduct = Optional.ofNullable(billingProduct); return this; } @java.lang.Override @JsonSetter(value = "billing_product", nulls = Nulls.SKIP) - public _FinalStage billingProduct(Optional billingProduct) { + public _FinalStage billingProduct(Optional billingProduct) { this.billingProduct = billingProduct; return this; } diff --git a/src/main/java/com/schematic/api/types/TestWebhookResponseData.java b/src/main/java/com/schematic/api/types/TestWebhookResponseData.java index 86f5ac1..d38f8bd 100644 --- a/src/main/java/com/schematic/api/types/TestWebhookResponseData.java +++ b/src/main/java/com/schematic/api/types/TestWebhookResponseData.java @@ -9,27 +9,41 @@ 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 = TestWebhookResponseData.Builder.class) public final class TestWebhookResponseData { + private final Optional failureReason; + private final long responseCode; private final boolean success; private final Map additionalProperties; - private TestWebhookResponseData(long responseCode, boolean success, Map additionalProperties) { + private TestWebhookResponseData( + Optional failureReason, + long responseCode, + boolean success, + Map additionalProperties) { + this.failureReason = failureReason; this.responseCode = responseCode; this.success = success; this.additionalProperties = additionalProperties; } + @JsonProperty("failure_reason") + public Optional getFailureReason() { + return failureReason; + } + @JsonProperty("response_code") public long getResponseCode() { return responseCode; @@ -52,12 +66,14 @@ public Map getAdditionalProperties() { } private boolean equalTo(TestWebhookResponseData other) { - return responseCode == other.responseCode && success == other.success; + return failureReason.equals(other.failureReason) + && responseCode == other.responseCode + && success == other.success; } @java.lang.Override public int hashCode() { - return Objects.hash(this.responseCode, this.success); + return Objects.hash(this.failureReason, this.responseCode, this.success); } @java.lang.Override @@ -85,6 +101,10 @@ public interface _FinalStage { _FinalStage additionalProperty(String key, Object value); _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage failureReason(Optional failureReason); + + _FinalStage failureReason(String failureReason); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -93,6 +113,8 @@ public static final class Builder implements ResponseCodeStage, SuccessStage, _F private boolean success; + private Optional failureReason = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -100,6 +122,7 @@ private Builder() {} @java.lang.Override public Builder from(TestWebhookResponseData other) { + failureReason(other.getFailureReason()); responseCode(other.getResponseCode()); success(other.getSuccess()); return this; @@ -119,9 +142,22 @@ public _FinalStage success(boolean success) { return this; } + @java.lang.Override + public _FinalStage failureReason(String failureReason) { + this.failureReason = Optional.ofNullable(failureReason); + return this; + } + + @java.lang.Override + @JsonSetter(value = "failure_reason", nulls = Nulls.SKIP) + public _FinalStage failureReason(Optional failureReason) { + this.failureReason = failureReason; + return this; + } + @java.lang.Override public TestWebhookResponseData build() { - return new TestWebhookResponseData(responseCode, success, additionalProperties); + return new TestWebhookResponseData(failureReason, responseCode, success, additionalProperties); } @java.lang.Override